var a:string;
begin
readln(a);
writeln(a[3],a[2],a[8],a[2],a[length(a)]);
writeln(a[1],a[2],a[3],a[2],a[1]);
writeln(a[4],a[5],a[6],a[2],a[8]);
end.
var a:string;
begin
readln(a);
writeln(a[3],a[2],a[8],a[2],a[length(a)]);
writeln(a[1],a[2],a[3],a[2],a[1]);
writeln(a[4],a[5],a[6],a[2],a[8]);
end.