a = int(input())
b = int(input())
nb = a ^ b
na = a & b
na = na << 1
print(na, nb)
