Const n1='file1'; n2='file2'; n3='file3';
var f1,f2,f3:file of char; c:char;
begin
assign(f1,n1); assign(f2,n2); assign(f3,n3);
reset(f1); rewrite(f3);
while not(eof(f1)) do begin read(f1,c); write(f3,c) end;
close(f1); close(f3);
reset(f2); rewrite(f1);
while not(eof(f2)) do begin read(f2,c); write(f1,c) end;
close(f1); close(f2);
reset(f3); rewrite(f2);
while not(eof(f3)) do begin read(f3,c); write(f2,c) end;
close(f3); close(f2);
erase(f3)
end.