#!/bin/python import sys def cost(s): return ((reduce(lambda a, b: a | b, s) - reduce(lambda a, b: a & b, s)) - (max(s)-min(s))) def costlyIntervals(n, k, x): su=[] sud={} y=[-1]*n for i in range(len(x)): e=i+1 while e<=len(x): s=x[i:e] c=cost(s) if c>=k: #su.append(s) #sud[len(su)-1]=c #print i,e-1 for j in range(i,e): if len(s)>y[j]: y[j]=len(s) e+=1 #print su return y # 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))