#include <iostream>
#include <fstream>
#include <algorithm>
#include <bits/stdc++.h>
//#define LOCAL
using namespace std;
typedef long long ll;


int main() {
#ifdef LOCAL
ifstream fin("1.txt");
streambuf*p;
p=cin.rdbuf(fin.rdbuf());
#endif // LOCAL
ll num1,num2;
cin>>num1>>num2;
bitset<32>a(num1), b(num2);
cout<< (a&b) <<endl;
cout<< (a|b) <<endl;
cout<< (a^b) <<endl;


#ifdef LOCAL
fin.close();
#endif // LOCAL
}

