#!/bin/python import sys def calcCost(subarr): bitwise_or = subarr[0] bitwise_and = subarr[0] min_val = subarr[0] max_val = subarr[0] for elem in subarr[1:]: bitwise_or ^= elem bitwise_and &= elem if elem > max_val: max_val = elem if elem < min_val: min_val = elem return (bitwise_or - bitwise_and) - (max_val - min_val) def costlyIntervals(n, p, A): # Return a list of length n consisting of the answers result = [-1 for _ in range(n)] for j in range(n): for k in range(j+1,n): cost = calcCost(A[j:k]) for a in range(j,k): if cost >= p: result[a] = k-j return result if __name__ == "__main__": n, k = raw_input().strip().split(' ') n, k = [int(n), int(k)] A = map(int, raw_input().strip().split(' ')) result = costlyIntervals(n, k, A) print "\n".join(map(str, result))