# 两个有序数组 首尾指针
def main():
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
i, j = 0, M - 1
if X > A[N - 1] + B[M - 1] or X < A[0] + B[0]:
print('no result')
return
while True:
while A[i] + B[j] > X:
j -= 1
while A[i] + B[j] < X:
i += 1
if A[i] + B[j] == X:
print(i, j)
break
main()