a = int(input())
b = int(input())
while a != 0 and b != 0
	c = a ^ b
	d = (a & b) << 1
	a = c
	b = d
print(a)