N,K=map(int,input().split()) for _ in range(N-1): input() s=K-1 if N>=K else -1 print(s)