#include <bits/stdc++.h>

using namespace std;


int main(){
    unsigned int a,b;
    
    cin >> a >> b ;
    bitset<32> a_bit(a);
    bitset<32> b_bit(b);

    cout << (a_bit & b_bit) << "\n";
    cout << (a_bit | b_bit) << "\n";
    cout << (a_bit ^ b_bit) << "\n";
    return 0;   
}

