import sys

x , y = map(int,input().split())

# 如何输入 位 
print(x & y)
print(x | y)