#include "bits/stdc++.h"
using namespace std;
#define long int64_t

struct Solver {
	void solve() {
		uint32_t a, b;
		cin >> a >> b;

		bitset<32> bt( a ), bt2( b );
		cout << (bt & bt2) << '\n'
			<< (bt | bt2) << '\n'
			<< (bt ^ bt2) << endl;
	}
};

int main() {
	ios::sync_with_stdio( false );
	cout << fixed << setprecision( 10 );
	Solver().solve();
	return 0;
}

