#!/bin/python import sys def costlyIntervals(n, k, A): #print n,k,A costi = [-1 for i in range(n)] for l in range(0,n): for r in range(l,n): ar = A[l:r+1] ror = reduce(lambda x,y: x | y,ar) rand = reduce(lambda x,y: x & y,ar) ma = max(ar) mi = min(ar) costo = (ror - rand) - (ma - mi) if costo >= k: costi[l] = r+1-l costi[r] = r+1-l return costi # Return a list of length n consisting of the answers 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))