{PACKING THE SAME CHARACTER}
var	fi,fo:file of char;
	o,g:char;
	fid,fod,s:string;
        i:byte;
        decrypt:boolean;
procedure writeprocedure;
begin
	decrypt:=true;
	for i:= 1 to ord(s[0]) do
	begin
                o:=s[i];
                write(fo,o);
	end
end;
begin
	write('Input file : ');readln(fid);
	write('Output file: ');readln(fod);
	assign(fi,fid);reset(fi);
	assign(fo,fod);rewrite(fo);
        i:=1;
	while not eof(fi) do
	begin
		read(fi,g);
                decrypt:=false;
                {----}
                if g=chr(1) then
                begin
                   s:='for';
                   writeprocedure;
                end;
                {----}
                if g=chr(2) then
                begin
                   s:='while';
                   writeprocedure;
                end;
                {----}
                if not decrypt then write(fo,g);
        end;
	close(fo);
end.