A, B = map(int, input().split())
if A == B:
    print(A)
else:
    K = []
    if A % 2 == 1:
        K.append(A)
        A += 1
    if (B - A) % 2 == 0:
        if ((B - A) // 2) % 2 == 0:
            K.append(B)
        else:
            K.append(1)
            K.append(B)
    else:
        if ((B - A - 1) // 2) % 2 == 0:
            K.append(B-1)
            K.append(B)
        else:
            K.append(1)
            K.append(B-1)
            K.append(B)
    ans = 0
    for i in K:
        ans = (ans ^ i)
    print(ans) A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B if A == B:
    print(A)
else:
    K = []
    if A % 2 == 1:
        K.append(A)
        A += 1
    if (B - A) % 2 == 0:
        if ((B - A) // 2) % 2 == 0:
            K.append(B)
        else:
            K.append(1)
            K.append(B)
    else:
        if ((B - A - 1) // 2) % 2 == 0:
            K.append(B-1)
            K.append(B)
        else:
            K.append(1)
            K.append(B-1)
            K.append(B)
    ans = 0
    for i in K:
        ans = (ans ^ i)
    print(ans) A == B A B print(A) print A K = [] K [] if A % 2 == 1:
        K.append(A)
        A += 1
     A % 2 == 1 A % 2 A 2 1 K.append(A) K.append K append A A += 1 A 1 if (B - A) % 2 == 0:
        if ((B - A) // 2) % 2 == 0:
            K.append(B)
        else:
            K.append(1)
            K.append(B)
    else:
        if ((B - A - 1) // 2) % 2 == 0:
            K.append(B-1)
            K.append(B)
        else:
            K.append(1)
            K.append(B-1)
            K.append(B)
     (B - A) % 2 == 0 (B - A) % 2 B - A B A 2 0 if ((B - A) // 2) % 2 == 0:
            K.append(B)
        else:
            K.append(1)
            K.append(B)
     ((B - A) // 2) % 2 == 0 ((B - A) // 2) % 2 (B - A) // 2 B - A B A 2 2 0 K.append(B) K.append K append B K.append(1) K.append K append 1 K.append(B) K.append K append B if ((B - A - 1) // 2) % 2 == 0:
            K.append(B-1)
            K.append(B)
        else:
            K.append(1)
            K.append(B-1)
            K.append(B)
     ((B - A - 1) // 2) % 2 == 0 ((B - A - 1) // 2) % 2 (B - A - 1) // 2 B - A - 1 B - A B A 1 2 2 0 K.append(B-1) K.append K append B-1 B 1 K.append(B) K.append K append B K.append(1) K.append K append 1 K.append(B-1) K.append K append B-1 B 1 K.append(B) K.append K append B ans = 0 ans 0 for i in K:
        ans = (ans ^ i)
     i K ans = (ans ^ i) ans ans ^ i ans i print(ans) print ans B = map(int, input().split()) map(int, input().split()) B K = [] [] K A, B = map(int, input().split()) map(int, input().split()) A A += 1 1 A ans = (ans ^ i) ans ^ i ans ans = 0 0 ans
A, B = map(int, input().split())
if A == B:
    print(A)
else:
    K = []
    if A % 2 == 1:
        K.append(A)
        A += 1
    if (B - A) % 2 == 0:
        if ((B - A) // 2) % 2 == 0:
            K.append(B)
        else:
            K.append(1)
            K.append(B)
    else:
        if ((B - A - 1) // 2) % 2 == 0:
            K.append(B-1)
            K.append(B)
        else:
            K.append(1)
            K.append(B-1)
            K.append(B)
    ans = 0
    for i in K:
        ans = (ans ^ i)
    print(ans)