#include<bits/stdc++.h>
using namespace std;

int in(){int x;scanf("%d",&x);return x;}

signed main(){

  bitset<32> a(in()),b(in());
  cout<< (a&b) <<endl;
  cout<< (a|b) <<endl;
  cout<< (a^b) <<endl;
  

}
