xor表示异或,(a^b=c )<==>( a^c=b)
Xor Transformation
https://ac.nowcoder.com/acm/contest/13605/G
a^b=c <==> a^c=b <==> b^c=a
//
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll x,y,a;
queue<ll>q;
void pri(){
cout << q.size() << "\n";
while(!q.empty()){
cout << q.front() << " ";
q.pop();
}
}
void fun(ll a,ll b,ll c){
c=a^b;
if(c==y&&c<a){
pri();return ;
}
if(c>=a){
q.push((a^c));
fun(c,b,c);
}
else{
q.push(c);
pri();
}
}
int main(){
cin >> x >> y;
fun(x,y,x);
return 0;
}
