#include #define rep(i,s,n) for (int i = (int)(s); i < (int)(n); i++) #define all(v) begin(v),end(v) using namespace std; using ll = long long; bool chmin(auto &a, auto b){ return a > b ? a = b, 1 : 0; } bool chmax(auto &a, auto b){ return a < b ? a = b, 1 : 0; } int main(){ cin.tie(0)->sync_with_stdio(0); ll n,x,y; cin >> n >> x >> y; if (x==y){ cout << 0 << '\n'; return 0; } if ((y&1) == 0) { cout << -1 << '\n'; return 0; } deque bits(n); rep(i,0,n){ bits[n-1-i] = (y>>i&1); } while(bits.front() == 0) { bits.pop_front(); } bits.pop_front(); vector ls; while(!bits.empty()){ int cnt = 0; while(bits.front() == 0) { cnt++; bits.pop_front(); } cnt++; bits.pop_front(); ls.push_back(cnt); } vector a; a.push_back(n); rep(i,0,(int)ls.size()){ a.push_back(ls[i]); } cout << (int)a.size() << '\n'; rep(i,0,(int)a.size()){ cout << a[i] << ' '; } cout << '\n'; }