#!/bin/python import sys q={} def f(n, k, a): for i in xrange(n): b=a[i] c=a[i] d=a[i] e=a[i] for j in xrange(i+1,n): b=max(b,a[j]) c=min(c,a[j]) d|=a[j] e&=a[j] if (d-e)-(b-c)>=k: for t in xrange(i,j+1): q[t]=max(q[t],j-i+1) if __name__ == "__main__": n, k = raw_input().strip().split(' ') n, k = [int(n), int(k)] for i in xrange(n): q[i]=-1 a = map(int, raw_input().strip().split(' ')) f(n, k, a) for i in xrange(n): print q[i]