n,s = map(int,input().split()) v = [] for i in range(n,0,-1): if s>=i: s-=i v.append(i) print(len(v)) print(*v[::-1])