#include #include #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace atcoder; using namespace std; typedef long long ll; int n; ll f(ll x, int i) { return (x * (1LL << i) + 1) % (1LL << n); } void out(vector a) { cout << a.size() << endl; for (auto x : a) { cout << x << ' '; } cout << endl; } int main() { ll x, y; cin >> n >> x >> y; vector ans; if (x == y) { out(ans); return 0; } if (y == 0) { cout << -1 << endl; return 0; } if (y % 2) { cout << -1 << endl; return 0; } vector bits; rep(i, 0, 61) { if (y & (1LL << i)) { bits.push_back(i); } } x = 1; ans.push_back(n); reverse(bits.begin(), bits.end()); rep(i, 0, bits.size() - 1) { ans.push_back(bits[i] - bits[i + 1]); } out(ans); // rep(i, 0, ans.size()) { x = f(x, ans[i]); } // assert(x == y); }