n,s,k=map(int,input().split()) ansd=-1 ansno=-1 for i in range(1,n+1): d=abs(s-int(input())) if d<=k: if ansd==-1 or d