for i in range(3):

    a=input()

    print(a[i],end="")

print(input()[0],end="")

print(input()[1],end="")

print(input()[2],end="")

for i in range(3):
    a = input()
    print(a[i], end="")

print(input()[0], end="")
print(input()[1], end="")
print(input()[2], end="")

-for i in range(3): -    a = input() -    print(a[i], end="") +print(input()[0], end="") +print(input()[1], end="") +print(input()[2], end="")