#include <algorithm>
#include<iostream>
#include<vector>
#include<deque>
#include<queue>
#include<list>
#include<stack>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<bitset>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;


int main(){
  long ii,jj,kk;

  unsigned int a,b;

  std::bitset<32> dx;
  
  cin >> a >> b;

  dx = a & b;
  
  cout << dx << endl;

  dx = a | b;
  
  cout << dx << endl;

  dx = a ^ b;

  cout << dx << endl;
  

  
  return 0;
}

