a,b=map(int,input().split())
lenb=len(str(bin(b)))-2

#a=2、b=8とする
#0000 0
#0001 1
#0010 2
#0011 3
#0100 4
#0101 5 
#0110 6
#0111 7
#1000
#各桁の1の個数を数えればよさそう
#i桁目のX番目までの１の数
#(x+1)%(2**(i+1))-(2*(i))

result=""

if a!=0:
    a-=1
if a%4 in [1,2]:
    a4="1"
else:
    a4="0"
if b%4 in [1,2]:
    b4="1"
else:
    b4="0"

if a4==b4:
    result="0"
else:
    result="1"

for i in range(1,lenb):
    a4=(max(0,(a+1)%(2**(i+1))-(2**(i))))%2
    b4=(max(0,(b+1)%(2**(i+1))-(2**(i))))%2
    if a4==b4:
        result="0"+result
    else:
        result="1"+result


print(int(result,2))
 a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b lenb=len(str(bin(b)))-2 lenb len(str(bin(b)))-2 len(str(bin(b))) len str(bin(b)) str bin(b) bin b 2 result="" result "" if a!=0:
    a-=1 a!=0 a 0 a-=1 a 1 if a%4 in [1,2]:
    a4="1"
else:
    a4="0" a%4 in [1,2] a%4 a 4 [1,2] 1 2 a4="1" a4 "1" a4="0" a4 "0" if b%4 in [1,2]:
    b4="1"
else:
    b4="0" b%4 in [1,2] b%4 b 4 [1,2] 1 2 b4="1" b4 "1" b4="0" b4 "0" if a4==b4:
    result="0"
else:
    result="1" a4==b4 a4 b4 result="0" result "0" result="1" result "1" for i in range(1,lenb):
    a4=(max(0,(a+1)%(2**(i+1))-(2**(i))))%2
    b4=(max(0,(b+1)%(2**(i+1))-(2**(i))))%2
    if a4==b4:
        result="0"+result
    else:
        result="1"+result i range(1,lenb) range 1 lenb a4=(max(0,(a+1)%(2**(i+1))-(2**(i))))%2 a4 (max(0,(a+1)%(2**(i+1))-(2**(i))))%2 max(0,(a+1)%(2**(i+1))-(2**(i))) max 0 (a+1)%(2**(i+1))-(2**(i)) (a+1)%(2**(i+1)) a+1 a 1 2**(i+1) 2 i+1 i 1 2**(i) 2 i 2 b4=(max(0,(b+1)%(2**(i+1))-(2**(i))))%2 b4 (max(0,(b+1)%(2**(i+1))-(2**(i))))%2 max(0,(b+1)%(2**(i+1))-(2**(i))) max 0 (b+1)%(2**(i+1))-(2**(i)) (b+1)%(2**(i+1)) b+1 b 1 2**(i+1) 2 i+1 i 1 2**(i) 2 i 2 if a4==b4:
        result="0"+result
    else:
        result="1"+result a4==b4 a4 b4 result="0"+result result "0"+result "0" result result="1"+result result "1"+result "1" result print(int(result,2)) print int(result,2) int result 2 a4="1" "1" a4 result="0"+result "0"+result result a4=(max(0,(a+1)%(2**(i+1))-(2**(i))))%2 (max(0,(a+1)%(2**(i+1))-(2**(i))))%2 a4 result="0" "0" result a,b=map(int,input().split()) map(int,input().split()) a result="1"+result "1"+result result lenb=len(str(bin(b)))-2 len(str(bin(b)))-2 lenb b4="0" "0" b4 b4=(max(0,(b+1)%(2**(i+1))-(2**(i))))%2 (max(0,(b+1)%(2**(i+1))-(2**(i))))%2 b4 a4="0" "0" a4 a-=1 1 a result="1" "1" result b=map(int,input().split()) map(int,input().split()) b result="" "" result b4="1" "1" b4
a,b=map(int,input().split())
lenb=len(str(bin(b)))-2

#a=2、b=8とする
#0000 0
#0001 1
#0010 2
#0011 3
#0100 4
#0101 5 
#0110 6
#0111 7
#1000
#各桁の1の個数を数えればよさそう
#i桁目のX番目までの１の数
#(x+1)%(2**(i+1))-(2*(i))

result=""

if a!=0:
    a-=1
if a%4 in [1,2]:
    a4="1"
else:
    a4="0"
if b%4 in [1,2]:
    b4="1"
else:
    b4="0"

if a4==b4:
    result="0"
else:
    result="1"

for i in range(1,lenb):
    a4=(max(0,(a+1)%(2**(i+1))-(2**(i))))%2
    b4=(max(0,(b+1)%(2**(i+1))-(2**(i))))%2
    if a4==b4:
        result="0"+result
    else:
        result="1"+result


print(int(result,2))

