# https://yukicoder.me/problems/no/2881 def main(): N, X, Y = map(int, input().split()) if X == Y: print(0) print("".join(map(str, []))) else: y = Y y_array = [] while y > 0: y_array.append(y % 2) y //= 2 y_array.reverse() if len(y_array) == 0 or y_array[-1] == 0: print(-1) return A = [N] index = 0 while index < len(y_array) - 1: i = 0 while index + i + 1 < len(y_array) and y_array[index + i + 1] == 0: i += 1 A.append(i + 1) index += i + 1 print(len(A)) print(" ".join(map(str, A))) if __name__ == "__main__": main()