N,S = map(int,input().split()) cnt = 0 for i in range(N,0,-1): if cnt+i<=S: cnt += i ind = i-1 else: ind = i break if cnt==S: A = list(range(ind+1,N+1)) print(N-ind) else: A = list(range(ind+1,N+1)) A.insert(0,S-cnt) print(N-ind+1) print(*A)