import sys input = sys.stdin.readline N,S=map(int,input().split()) SET=set(range(1,N+1)) SUM=N*(N+1)//2 MAX=N while SUM>S: if SUM-S>MAX: SET.remove(MAX) SUM-=MAX MAX-=1 else: x=SUM-S SET.remove(x) SUM-=x print(len(SET)) print(*sorted(SET))