#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long int a,b;
  cin>>a>>b;
  bitset<32>b1(a);
  bitset<32>b2(b);
  cout<<(b1&b2)<<endl;
  cout<<(b1|b2)<<endl;
  cout<<(b1^b2)<<endl;
}
