import sys
# 位与:& ,位或:|
x, y = map(int, input().split())
print(x & y)
print(x | y)