n,kk=list(map(int,input().split())) a=list(map(int,input().split())) ans=[-1]*n for i in range(n): for j in range(i,n): MAX=max(a[i:j+1]) MIN=min(a[i:j+1]) OR=AND=a[i] for k in range(i+1,j+1): OR|=a[k] AND&=a[k] cost=OR-AND-MAX+MIN if(cost>=kk): #print(i,j,cost) for ele in range(i,j+1): ans[ele]=max(ans[ele],j-i+1) for i in ans: print(i)