def cum2(n): return ((1 + n) * n)//2 ans = [] N,S = map(int,input().split()) for i in reversed(range(1,N+1)): if S >= i: S -= i ans.append(i) print(len(ans)) print(*ans)