Program qq;
var a:array[1..9] of string;
b:array[1..3,1..3] of string;
i, j, k:integer;
begin
i:=0;
for i:=1 to 9 do readln(a[i]);
i:=0;
j:=0;
k:=1;
for i:=1 to 3 do
for j:=1 to 3 do
begin
b[i, j]:=a[k];
k:=k+1;
end;
for i:=1 to 3 do
for j:=1 to 3 do
begin
write(b[i, j]);
if (j=3) then writeln();
end;
end.