bin = [1,0]

print((bin[int(eval(input()))]))
print((int(bin(int(eval(input())) ^ 1), 2)))
bin = [1, 0]
print((bin[int(eval(input()))]))

print((int(bin(int(eval(input())) ^ 1), 2)))

-bin = [1, 0] -print((bin[int(eval(input()))])) +print((int(bin(int(eval(input())) ^ 1), 2)))