#include using namespace std; using ll = long long; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int N; ll X, Y; cin >> N >> X >> Y; if (Y % 2 == 0) { cout << -1 << "\n"; return 0; } vector ops; ops.push_back(N); int it = 0; for (int i = 0; i < N; i++) if (Y >> i & 1) it = i; for (int j = it - 1; j >= 0; j--) { if (Y >> j & 1) { int w = it - j; ops.push_back(w); it = j; } } cout << ops.size() << "\n"; for (int i = 0; i < (int)ops.size(); i++) cout << ops[i] << " \n"[i == N - 1]; return 0; const ll MOD = 1LL << N; for (int i = 0; i < (int)ops.size(); i++) { long long t = X; for (int j = 0; j < ops[i]; j++) { t *= 2; t %= MOD; } t += 1; X = t; } cout << X << " " << Y << endl; }