#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vecll = vector<long long>;
#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)

int main()
{
    ll a, b;
    cin >> a >> b;

    cout << bitset<32>(a & b) << endl;
    cout << bitset<32>(a | b) << endl;
    cout << bitset<32>(a ^ b) << endl;
    return 0;
}
