a=input().split( )
x=int(a[0])
y=int(a[1])
print(x and y)
print(x or y)
print(not x)
print(not y)


bool