n, k = map(int, input().split()) x = list(map(int, input().split())) for i in range(k - 1, n, k): print(x[i])