n,t,e = list(map(int,input().split()))

x = list(map(int,input().split()))

for i in range(n):

	if t%x[i] <= e or x[i] - t%x[i] <= e:

		print(i+1)

		break

else:

	print(-1)
n,t,e = list(map(int,input().split()))

x = list(map(int,input().split()))

for i in range(n):

	r = t%x[i]

	if min(r, x[i] - r) <= e:

		print(i+1)

		break

else:

	print(-1)
n, t, e = list(map(int, input().split()))
x = list(map(int, input().split()))
for i in range(n):
    if t % x[i] <= e or x[i] - t % x[i] <= e:
        print(i + 1)
        break
else:
    print(-1)

n, t, e = list(map(int, input().split()))
x = list(map(int, input().split()))
for i in range(n):
    r = t % x[i]
    if min(r, x[i] - r) <= e:
        print(i + 1)
        break
else:
    print(-1)

-    if t % x[i] <= e or x[i] - t % x[i] <= e: +    r = t % x[i] +    if min(r, x[i] - r) <= e: