#include #include #include using namespace std; typedef long long ll; ll a[200010]; vector ans,p; map dp[200010]; void dfs(int i,int n,ll x, ll y){ //cout << i << " " << n << " " << x << " " << y << " " << p.size() << endl; if(i>n || dp[i].find(x)!=dp[i].end()) return; dp[i][x] = true; if(p.size()==n && x==y){ ans = p; return; } if(false){ //p.push_back(1); //dfs(i,x); }else{ p.push_back(1); dfs(i + 1,n,x&a[i],y); p.pop_back(); p.push_back(2); dfs(i + 1,n,x|a[i],y); p.pop_back(); p.push_back(3); dfs(i + 1,n,a[i],y); p.pop_back(); } } int main(){ ll i,j,n,x,y; cin >> n >> x >> y; for(i=0;i> a[i]; dfs(0,n,x,y); if(ans.size()==n){ for(int x:ans) cout << x << " "; cout << endl; }else{ cout << -1 << endl; } }