from itertools import pairwise N, X, Y = map(int, input().split()) if Y % 2 == 0: if X == Y: print(0) print() else: print(-1) exit() op = [] op.append(N) idxes = [i + 1 for i in range(N) if (Y >> i) & 1][::-1] for next_i, curr_i in pairwise(idxes): op.append(next_i - curr_i) print(len(op)) print(*op) # test _x = X print(_x) for cmd in op: _x = (_x * 2**cmd + 1) % 2**N assert _x == Y, f"{_x=}, {Y=}"