A,B=map(int,input().split())

if A==0:
    n=(B+1)//2
    if n%2==0:
        if B%2==0:
            print(B)
        else:
            print(0)
    else:
        if B%2==0:
            print(1^B)
        else:
            print(1)
else:
    m=A//2
    if m%2==0:
        if (A-1)%2==0:
            a=A-1
        else:
            a=0
    else:
        if (A-1)%2==0:
            a=1^(A-1)
        else:
            a=1
    n=(B+1)//2
    if n%2==0:
        if B%2==0:
            b=B
        else:
            b=0
    else:
        if B%2==0:
            b=1^B
        else:
            b=1
    ans=a^b
    print(ans) A,B=map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B if A==0:
    n=(B+1)//2
    if n%2==0:
        if B%2==0:
            print(B)
        else:
            print(0)
    else:
        if B%2==0:
            print(1^B)
        else:
            print(1)
else:
    m=A//2
    if m%2==0:
        if (A-1)%2==0:
            a=A-1
        else:
            a=0
    else:
        if (A-1)%2==0:
            a=1^(A-1)
        else:
            a=1
    n=(B+1)//2
    if n%2==0:
        if B%2==0:
            b=B
        else:
            b=0
    else:
        if B%2==0:
            b=1^B
        else:
            b=1
    ans=a^b
    print(ans) A==0 A 0 n=(B+1)//2 n (B+1)//2 B+1 B 1 2 if n%2==0:
        if B%2==0:
            print(B)
        else:
            print(0)
    else:
        if B%2==0:
            print(1^B)
        else:
            print(1) n%2==0 n%2 n 2 0 if B%2==0:
            print(B)
        else:
            print(0)
     B%2==0 B%2 B 2 0 print(B) print B print(0) print 0 if B%2==0:
            print(1^B)
        else:
            print(1) B%2==0 B%2 B 2 0 print(1^B) print 1^B 1 B print(1) print 1 m=A//2 m A//2 A 2 if m%2==0:
        if (A-1)%2==0:
            a=A-1
        else:
            a=0
    else:
        if (A-1)%2==0:
            a=1^(A-1)
        else:
            a=1
     m%2==0 m%2 m 2 0 if (A-1)%2==0:
            a=A-1
        else:
            a=0
     (A-1)%2==0 (A-1)%2 A-1 A 1 2 0 a=A-1 a A-1 A 1 a=0 a 0 if (A-1)%2==0:
            a=1^(A-1)
        else:
            a=1
     (A-1)%2==0 (A-1)%2 A-1 A 1 2 0 a=1^(A-1) a 1^(A-1) 1 A-1 A 1 a=1 a 1 n=(B+1)//2 n (B+1)//2 B+1 B 1 2 if n%2==0:
        if B%2==0:
            b=B
        else:
            b=0
    else:
        if B%2==0:
            b=1^B
        else:
            b=1
     n%2==0 n%2 n 2 0 if B%2==0:
            b=B
        else:
            b=0
     B%2==0 B%2 B 2 0 b=B b B b=0 b 0 if B%2==0:
            b=1^B
        else:
            b=1
     B%2==0 B%2 B 2 0 b=1^B b 1^B 1 B b=1 b 1 ans=a^b ans a^b a b print(ans) print ans b=B B b b=1 1 b a=A-1 A-1 a B=map(int,input().split()) map(int,input().split()) B n=(B+1)//2 (B+1)//2 n b=0 0 b a=0 0 a b=1^B 1^B b n=(B+1)//2 (B+1)//2 n m=A//2 A//2 m ans=a^b a^b ans a=1^(A-1) 1^(A-1) a a=1 1 a A,B=map(int,input().split()) map(int,input().split()) A
A,B=map(int,input().split())

if A==0:
    n=(B+1)//2
    if n%2==0:
        if B%2==0:
            print(B)
        else:
            print(0)
    else:
        if B%2==0:
            print(1^B)
        else:
            print(1)
else:
    m=A//2
    if m%2==0:
        if (A-1)%2==0:
            a=A-1
        else:
            a=0
    else:
        if (A-1)%2==0:
            a=1^(A-1)
        else:
            a=1
    n=(B+1)//2
    if n%2==0:
        if B%2==0:
            b=B
        else:
            b=0
    else:
        if B%2==0:
            b=1^B
        else:
            b=1
    ans=a^b
    print(ans)