x, y = map(int, input().split())
print(x and y)  # 逻辑与:只有x真才会计算y
print(x or y)  # 逻辑或:只有x假才会计算y 
print(not x)  # 逻辑非:取反
print(not y)