const fi1='nguyen1.txt'
fi2='nguyen2.txt'
fo='nguyen.txt'
var f1,f2,f3:text;
a,b:array[1..100]of integer;
n,m,i:integer;
begin
assign(f1,fi1); reset(f1);
assign(f2,fi2); reset(f2);
assign(f3,fo); rewrite(f3);
n:=0;
while not eof(f1) do
begin
inc(n);
readln(f1,a[n]);
end;
m:=0;
while not eof(f2) do
begin
m:=m+1;
readln(f1,b[m]);
end;
for i:=1 to n do
writeln(f3,a[i]);
for i:=1 to m do
writeln(f3,b[i]);
close(f1);
close(f2);
close(f3);
end.