#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
#include <stack>
#include <cctype>
#include <cmath>
#include <bitset>

using namespace std;

/* typedef */
typedef long long ll;

/* constant */
const int INF = 1 << 30;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;

/* global variables */

/* function */

/* main */
int main(){

    ll a, b;
    cin >> a >> b;
    bitset<32> bs_a(a);
    bitset<32> bs_b(b);

    // AND
    bitset<32> and_bits = bs_a & bs_b;
    // OR
    bitset<32> or_bits = bs_a | bs_b;
    // XOR
    bitset<32> xor_bits = bs_a ^ bs_b;
    
    cout << and_bits << '\n';
    cout << or_bits << '\n';
    cout << xor_bits << '\n';
}

