#include<iostream>
#include<algorithm>
#include<bitset>
using namespace std;
int main() {
  long long a,b;
  cin >> a >> b;
  bitset<32> ba(a),bb(b);
  cout << (ba&bb) << endl;
  cout << (ba|bb) << endl;
  cout << (ba^bb) << endl;
}
