#include using namespace std; using ll = long long; using P = pair; #define rep(i, a, b) for(long long i = (a); i < (b); ++i) #define rrep(i, a, b) for(long long i = (a); i >= (b); --i) constexpr long long inf = 4e18; struct SetupIO { SetupIO() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(30); } } setup_io; int main(void) { ll n, x, y; cin >> n >> x >> y; if(y % 2 == 0) { if(x == y) { cout << 0 << '\n'; } else { cout << -1 << '\n'; } return 0; } vector a; while(true) { y--; if(y == 0) break; a.push_back(0); while(y % 2 == 0) { y /= 2; a.back()++; } } a.push_back(n); ranges::reverse(a); cout << ssize(a) << '\n'; rep(i, 0, ssize(a)) { cout << a[i] << " \n"[i + 1 == ssize(a)]; } }