Var a,b:array[1..2,1..3]of integer;
i, j:byte;
Begin
for i:=1 to 2 do
for j:=1 to 3 do readln(a[i,j]);
for i:=1 to 2 do
begin
for j:=1 to 3 do write(a[i,j]:3);
writeln
end;
for i:=1 to 2 do
for j:=1 to 3 do
if i = 1 then b[i,j]:=a[2,j] else
b[i,j]:=a[1,j];
for i:=1 to 2 do
begin
for j:=1 to 3 do write (b[i,j]:3);
writeln
end;
readln
End.
write