Problem: Given two non-negative decimal integers $a$ and $b$, calculate their AND (logical conjunction), OR (logical disjunction) and XOR (exclusive disjunction) and print them in binary representation of 32 bits.

Constraints

* $0 \leq a, b \leq 2^{32} - 1$

Input

The input is given in the following format.


$a \; b$


Output

Print results of AND, OR and XOR in a line respectively.

Example

Input

8 10


Output

00000000000000000000000000001000
00000000000000000000000000001010
00000000000000000000000000000010

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;

//整数转换成二进制串
char* itobs(int n,char *ps){
    int i;
    int size = 8 * sizeof(int);
    for(i=size-1;i>=0;i--,n >>=1)
        ps[i]=(1&n) + '0'; //如果前面是1，‘0’+1变‘1’，前面是0，‘0’+0变‘0’
    return ps;
}

void andOp(char *a, char *b, char *res){
    for(int i =0;i<32;++i){
        if(a[i]=='1' && b[i]=='1') res[i] = '1';
        else res[i] = '0';
    }
}

void orOp(char *a, char *b, char *res){
    for(int i =0;i<32;++i){
        if(a[i]=='0' && b[i]=='0') res[i] = '0';
        else res[i] = '1';
    }
}

void xorOp(char *a, char *b, char *res){
    for(int i =0;i<32;++i){
        if(a[i]==b[i]) res[i] = '0';
        else res[i] = '1';
    }
}


void show_bstr(char *str){
    for(int i =0;i<32;++i){
        putchar(str[i]);
    }
}

int main(void){
    char bin_a[8*sizeof(int)];
    char bin_b[8*sizeof(int)];
    char bin_op[8*sizeof(int)];
    int a, b;
    scanf("%d %d",&a,&b);
    itobs(a,bin_a);
    itobs(b,bin_b);
    andOp(bin_a,bin_b,bin_op);
    show_bstr(bin_op);
    printf("\n");

    orOp(bin_a,bin_b,bin_op);
    show_bstr(bin_op);
    printf("\n");

    xorOp(bin_a,bin_b,bin_op);
    show_bstr(bin_op);
    printf("\n");
    return 0;
}