l = [0] * 3

for i in range(3):

    l[i] = list(input())



for i in range(3):

    for j in range(3):

        if i == j:

            print(l[i][j], end='')

print("")

for i in range(3):

    print(input()[i], end='')

print()

l = [0] * 3
for i in range(3):
    l[i] = list(input())
for i in range(3):
    for j in range(3):
        if i == j:
            print(l[i][j], end="")
print("")

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

-l = [0] * 3 -    l[i] = list(input()) -for i in range(3): -    for j in range(3): -        if i == j: -            print(l[i][j], end="") -print("") +    print(input()[i], end="") +print()