left, right = map(int, input(">>>").split(" ")) a1 = int(left & right) a2 = int(left | right) print(a1, a2)