问题描述
background = []
block = []
bottom_line = 0
for i in range(15):background.append(list(map(int, input().split())))
for i in range(4):block.append(list(map(int, input().split())))
bias = int(input())
for i in range(3):a = [1]*10background.append(a)
def run():for j in range(15):for i in range(4):line_copy = [a + b for a,b in zip(block[i], background[i + j][bias - 1: bias + 3])]if 2 in line_copy:return j - 1return 14
bottom_line = run()
for i in range(4):line_copy = [a + b for a,b in zip(block[i], background[i + bottom_line][bias - 1: bias + 3])]background[i + bottom_line][bias - 1: bias + 3] = line_copy
for i in range(15):print(" ".join(map(str,background[i])))