Question and Answer from L4-M1
# Read big matrix
N = int(input().strip())
big = [list(map(int, input().split())) for _ in range(N)]
# Read small matrix
M = int(input().strip())
small = [list(map(int, input().split())) for _ in range(M)]
found = False
# Slide over all possible top-left positions
for i in range(N - M + 1):
for j in range(N - M + 1):
match = True
for x in range(M):
for y in range(M):
if big[i + x][j + y] != small[x][y]:
match = False
break
if not match:
break
if match:
found = True
break
if found:
break
print("True" if found else "False")