N, K = input().split(" ") N = int(N) K = int(K) for i in range(N): a = input() if N < K: print("-1") else: print(K-1)