n,m = map(int,input().split()) lst = [m] tmp = [] def opposite(): lst.insert(0,-1) for i in range(2,n+1): p = (i+2)//2 get_p = 1 use_m = 0 tmp = [] over0 = [] for j in range(i-1): apd = 0 if lst[j]==0: get_p+=1 use_m+=1 apd = 1 elif lst[j]==-1: get_p+=1 else: over0.append(lst[j]) tmp.append(apd) if get_p>p: get_p -= p p = get_p use_m -= p for j in range(p): for k in range(i-1): if tmp[k]==1: tmp[k]=0 break if get_p==p: if use_m<=m: lst = [m-use_m]+tmp[:] else: opposite() continue p -= get_p over0.sort() if m < use_m+sum(over0[:p])+p: opposite() else: for j in range(p): for l in range(i-2,-1,-1): if lst[l]==1: lst[l] = 2 tmp[l] = lst[l] use_m += lst[l] break lst = [m-use_m]+tmp[:] print(*lst)