N, M = list(map(int, input().split()))

A = [int(eval(input())) for _ in range(N)]

B = [int(eval(input())) for _ in range(M)]



ans = []

for x in B:

    for i, v in enumerate(A):

        if x - v > -1:

            ans.append(i)

            break

print((max(ans, key=ans.count) + 1))
N, M = list(map(int, input().split()))

A = [int(eval(input())) for _ in range(N)]

B = [int(eval(input())) for _ in range(M)]



votes = [0] * N

for x in B:

    for i, v in enumerate(A):

        if x - v > -1:

            votes[i] += 1

            break

print((votes.index(max(votes)) + 1))
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(N)]
B = [int(eval(input())) for _ in range(M)]
ans = []
for x in B:
    for i, v in enumerate(A):
        if x - v > -1:
            ans.append(i)
            break
print((max(ans, key=ans.count) + 1))

N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(N)]
B = [int(eval(input())) for _ in range(M)]
votes = [0] * N
for x in B:
    for i, v in enumerate(A):
        if x - v > -1:
            votes[i] += 1
            break
print((votes.index(max(votes)) + 1))

-ans = [] +votes = [0] * N -            ans.append(i) +            votes[i] += 1 -print((max(ans, key=ans.count) + 1)) +print((votes.index(max(votes)) + 1))