c = [eval(input()) for _ in range(3)]

print((c[0][0] + c[1][1] + c[2][2]))

c = [input()[_] for _ in range(3)]

print(("".join(c)))
c = [eval(input()) for _ in range(3)]
print((c[0][0] + c[1][1] + c[2][2]))

c = [input()[_] for _ in range(3)]
print(("".join(c)))

-c = [eval(input()) for _ in range(3)] -print((c[0][0] + c[1][1] + c[2][2])) +c = [input()[_] for _ in range(3)] +print(("".join(c)))