A,B = map(int,input().split())
A2 = bin(A)[2:]
B2 = bin(B)[2:]
N = len(B2)
A2 = "0"*(N-len(A2))+A2
C = [0 for _ in range(N)]
T = B-A
for k in range(N):
    ind = A%(2**(k+1))
    if k==0:
        t = T%(2**(k+2))
        s = "01010101"
        c1 = 0
        for i in range(ind,ind+t+1):
            if s[i]=="1":
                c1 += 1
    else:
        t = T%(2**(k+1))
        if ind<2**k:
            if ind+t<2**k:
                c1 = 0
            elif ind+t<2**(k+1):
                c1 = ind+t-(2**k-1)
            else:
                c1 = 2**k
        else:
            if ind+t<2**(k+1):
                c1 = t+1
            elif ind+t<3*(2**k):
                c1 = 2**(k+1)-ind
            else:
                c1 = t-2**k+1
    C[N-1-k] = c1%2
a = 0
for i in range(N):
    a = 2*a+C[i]
print(a) A,B = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B A2 = bin(A)[2:] A2 bin(A)[2:] (A) bin A 2: 2 B2 = bin(B)[2:] B2 bin(B)[2:] (B) bin B 2: 2 N = len(B2) N len(B2) len B2 A2 = "0"*(N-len(A2))+A2 A2 "0"*(N-len(A2))+A2 "0"*(N-len(A2)) "0" N-len(A2) N len(A2) len A2 A2 0 for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) 0 C = [0 for _ in range(N)] C [0 for _ in range(N)] T = B-A T B-A B A for k in range(N):
    ind = A%(2**(k+1))
    if k==0:
        t = T%(2**(k+2))
        s = "01010101"
        c1 = 0
        for i in range(ind,ind+t+1):
            if s[i]=="1":
                c1 += 1
    else:
        t = T%(2**(k+1))
        if ind<2**k:
            if ind+t<2**k:
                c1 = 0
            elif ind+t<2**(k+1):
                c1 = ind+t-(2**k-1)
            else:
                c1 = 2**k
        else:
            if ind+t<2**(k+1):
                c1 = t+1
            elif ind+t<3*(2**k):
                c1 = 2**(k+1)-ind
            else:
                c1 = t-2**k+1
    C[N-1-k] = c1%2 k range(N) range N ind = A%(2**(k+1)) ind A%(2**(k+1)) A 2**(k+1) 2 k+1 k 1 if k==0:
        t = T%(2**(k+2))
        s = "01010101"
        c1 = 0
        for i in range(ind,ind+t+1):
            if s[i]=="1":
                c1 += 1
    else:
        t = T%(2**(k+1))
        if ind<2**k:
            if ind+t<2**k:
                c1 = 0
            elif ind+t<2**(k+1):
                c1 = ind+t-(2**k-1)
            else:
                c1 = 2**k
        else:
            if ind+t<2**(k+1):
                c1 = t+1
            elif ind+t<3*(2**k):
                c1 = 2**(k+1)-ind
            else:
                c1 = t-2**k+1
     k==0 k 0 t = T%(2**(k+2)) t T%(2**(k+2)) T 2**(k+2) 2 k+2 k 2 s = "01010101" s "01010101" c1 = 0 c1 0 for i in range(ind,ind+t+1):
            if s[i]=="1":
                c1 += 1
     i range(ind,ind+t+1) range ind ind+t+1 ind+t ind t 1 if s[i]=="1":
                c1 += 1
     s[i]=="1" s[i] s i "1" c1 += 1 c1 1 t = T%(2**(k+1)) t T%(2**(k+1)) T 2**(k+1) 2 k+1 k 1 if ind<2**k:
            if ind+t<2**k:
                c1 = 0
            elif ind+t<2**(k+1):
                c1 = ind+t-(2**k-1)
            else:
                c1 = 2**k
        else:
            if ind+t<2**(k+1):
                c1 = t+1
            elif ind+t<3*(2**k):
                c1 = 2**(k+1)-ind
            else:
                c1 = t-2**k+1
     ind<2**k ind 2**k 2 k if ind+t<2**k:
                c1 = 0
            elif ind+t<2**(k+1):
                c1 = ind+t-(2**k-1)
            else:
                c1 = 2**k
         ind+t<2**k ind+t ind t 2**k 2 k c1 = 0 c1 0 elif ind+t<2**(k+1):
                c1 = ind+t-(2**k-1)
             ind+t<2**(k+1) ind+t ind t 2**(k+1) 2 k+1 k 1 c1 = ind+t-(2**k-1) c1 ind+t-(2**k-1) ind+t ind t 2**k-1 2**k 2 k 1 c1 = 2**k c1 2**k 2 k if ind+t<2**(k+1):
                c1 = t+1
            elif ind+t<3*(2**k):
                c1 = 2**(k+1)-ind
            else:
                c1 = t-2**k+1
     ind+t<2**(k+1) ind+t ind t 2**(k+1) 2 k+1 k 1 c1 = t+1 c1 t+1 t 1 elif ind+t<3*(2**k):
                c1 = 2**(k+1)-ind
             ind+t<3*(2**k) ind+t ind t 3*(2**k) 3 2**k 2 k c1 = 2**(k+1)-ind c1 2**(k+1)-ind 2**(k+1) 2 k+1 k 1 ind c1 = t-2**k+1 c1 t-2**k+1 t-2**k t 2**k 2 k 1 C[N-1-k] = c1%2 C[N-1-k] C N-1-k N-1 N 1 k c1%2 c1 2 a = 0 a 0 for i in range(N):
    a = 2*a+C[i] i range(N) range N a = 2*a+C[i] a 2*a+C[i] 2*a 2 a C[i] C i print(a) print a A2 = bin(A)[2:] bin(A)[2:] A2 s = "01010101" "01010101" s T = B-A B-A T ind = A%(2**(k+1)) A%(2**(k+1)) ind a = 0 0 a t = T%(2**(k+1)) T%(2**(k+1)) t c1 = 0 0 c1 B2 = bin(B)[2:] bin(B)[2:] B2 C = [0 for _ in range(N)] [0 for _ in range(N)] C t = T%(2**(k+2)) T%(2**(k+2)) t c1 = 2**(k+1)-ind 2**(k+1)-ind c1 c1 = 0 0 c1 N = len(B2) len(B2) N A,B = map(int,input().split()) map(int,input().split()) A c1 = 2**k 2**k c1 c1 = t-2**k+1 t-2**k+1 c1 c1 = t+1 t+1 c1 c1 = ind+t-(2**k-1) ind+t-(2**k-1) c1 a = 2*a+C[i] 2*a+C[i] a A2 = "0"*(N-len(A2))+A2 "0"*(N-len(A2))+A2 A2 c1 += 1 1 c1 B = map(int,input().split()) map(int,input().split()) B
A,B = map(int,input().split())
A2 = bin(A)[2:]
B2 = bin(B)[2:]
N = len(B2)
A2 = "0"*(N-len(A2))+A2
C = [0 for _ in range(N)]
T = B-A
for k in range(N):
    ind = A%(2**(k+1))
    if k==0:
        t = T%(2**(k+2))
        s = "01010101"
        c1 = 0
        for i in range(ind,ind+t+1):
            if s[i]=="1":
                c1 += 1
    else:
        t = T%(2**(k+1))
        if ind<2**k:
            if ind+t<2**k:
                c1 = 0
            elif ind+t<2**(k+1):
                c1 = ind+t-(2**k-1)
            else:
                c1 = 2**k
        else:
            if ind+t<2**(k+1):
                c1 = t+1
            elif ind+t<3*(2**k):
                c1 = 2**(k+1)-ind
            else:
                c1 = t-2**k+1
    C[N-1-k] = c1%2
a = 0
for i in range(N):
    a = 2*a+C[i]
print(a)