import math A, B = map(int, input().split()) ans=0 amin=max(2**int(math.log2(A))-10,0) bmin=max(2**int(math.log2(B))-10,0) amax=min(amin+20,A+1) bmax=min(bmin+20,B+1) #print(amin, amax, bmin, bmax) for a in range(amin, amax, 1): for b in range(bmin, bmax, 1): ans1=min(a, b, a^b) # print(a,b,a^b) if ans