import sys input = sys.stdin.readline N,X,Y=map(int,input().split()) if X==Y: print(0) ans=[] print(*ans) exit() if Y%2==0: print(-1) exit() ans=[] ans.append(N) S=bin(Y)[2:] c=0;f=0 for s in S: c+=1 if s=='1': if f==0: f=1 else: ans.append(c) c=0 print(len(ans)) print(*ans)