#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repd(i,a,b) for (int i = (a); i < (b); i++)
typedef long long ll;
int main(void)
{
    ll a, b;
    cin >> a >> b;
    bitset<32> a_bit(a);
    bitset<32> b_bit(b);
    cout << (a_bit & b_bit) << endl;
    cout << (a_bit | b_bit) << endl;
    cout << (a_bit ^ b_bit) << endl;
}

