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