import std.stdio, std.string, std.array, std.conv;

void main() {
    long[] tmp = readln.chomp.split.to!(long[]);
    long a = tmp[0], b = tmp[1];
    long m = a & b, n = a | b, l = a ^ b;
    int[] x = new int[32];
    int[] y = new int[32];
    int[] z = new int[32];
    foreach_reverse (i; 0 .. 32) {
        x[i] = m & 1;
        m /= 2;
        y[i] = n & 1;
        n /= 2;
        z[i] = l & 1;
        l /= 2;
    }
    x.to!(string[]).join.writeln;
    y.to!(string[]).join.writeln;
    z.to!(string[]).join.writeln;
}
