# Program for bit manipulation

n1 = int(input())
n2 = int(input())

# Left shift

print(n1<<n2)

# Right Shift

print(n1>>n2)

# Bitwise AND

print(n1&n2)

#Bitwise OR

print(n1|n2)

#Bitwise EX-OR

print(n1^n2)

#Bitwise NOT

print(~n1)
