N, S = map(int, input().split()) for k in range(1, N+1): l = k*(k+1)//2 r = (2*N-k+1)*k//2 if l<=S<=r: ans = list(range(1, k+1)) s = k*(k+1)//2 for i in range(k-1, -1, -1): add = min(S-s, N-(k-1-i)-ans[i]) ans[i] += add s += add print(k) print(*ans) exit()