N=input() N=N.rstrip().split(" ") list1=[] list2=[] N1=int(N[0]) N2=int(N[1]) for i in range(41): list1.append(N1//(2**(40-i))) N1=N1%(2**(40-i)) list2.append(N2//(2**(40-i))) N2=N2%(2**(40-i)) #print(list1) #print(list2) list3=[] for j in range(41): if list1[j]+list2[j]==2: list3.append(0) else: list3.append(list1[j]+list2[j]) ans=0 for k in range(41): ans=ans+list3[k]*2**(40-k) print(ans)