r = int(input())
m = []
for i in range(r):
    curr = [int(v) for v in input().split()]
    m.append(curr)
n1, n2 = input().split()
n1, n2 = int(n1), int(n2)
print(m[n1 - 1][n2 - 1])

93046717752971c336289dc5c2e534e0f6e44897
<mask token>

<mask token>
for i in range(r):
    curr = [int(v) for v in input().split()]
    m.append(curr)
<mask token>
print(m[n1 - 1][n2 - 1])

r = int(input())
m = []
for i in range(r):
    curr = [int(v) for v in input().split()]
    m.append(curr)
n1, n2 = input().split()
n1, n2 = int(n1), int(n2)
print(m[n1 - 1][n2 - 1])
