if __name__ == '__main__':
    def judge(x):
        if x % 4 == 0:
            return x
        elif x % 4 == 1:
            return 1
        elif x % 4 == 2:
            return x + 1
        else:
            return 0

    a, b = map(int, input().split())
    fa = judge(a - 1)
    fb = judge(b)
    print(fa ^ fb) if __name__ == '__main__':
    def judge(x):
        if x % 4 == 0:
            return x
        elif x % 4 == 1:
            return 1
        elif x % 4 == 2:
            return x + 1
        else:
            return 0

    a, b = map(int, input().split())
    fa = judge(a - 1)
    fb = judge(b)
    print(fa ^ fb) __name__ == '__main__' __name__ '__main__' def judge(x):
        if x % 4 == 0:
            return x
        elif x % 4 == 1:
            return 1
        elif x % 4 == 2:
            return x + 1
        else:
            return 0

     judge if x % 4 == 0:
            return x
        elif x % 4 == 1:
            return 1
        elif x % 4 == 2:
            return x + 1
        else:
            return 0

     x % 4 == 0 x % 4 x 4 0 return x x elif x % 4 == 1:
            return 1
         x % 4 == 1 x % 4 x 4 1 return 1 1 elif x % 4 == 2:
            return x + 1
         x % 4 == 2 x % 4 x 4 2 return x + 1 x + 1 x 1 return 0 0 x x a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b fa = judge(a - 1) fa judge(a - 1) judge a - 1 a 1 fb = judge(b) fb judge(b) judge b print(fa ^ fb) print fa ^ fb fa fb fa = judge(a - 1) judge(a - 1) fa def judge(x):
        if x % 4 == 0:
            return x
        elif x % 4 == 1:
            return 1
        elif x % 4 == 2:
            return x + 1
        else:
            return 0

     def judge(x):
        if x % 4 == 0:
            return x
        elif x % 4 == 1:
            return 1
        elif x % 4 == 2:
            return x + 1
        else:
            return 0

     judge b = map(int, input().split()) map(int, input().split()) b fb = judge(b) judge(b) fb a, b = map(int, input().split()) map(int, input().split()) a
if __name__ == '__main__':
    def judge(x):
        if x % 4 == 0:
            return x
        elif x % 4 == 1:
            return 1
        elif x % 4 == 2:
            return x + 1
        else:
            return 0

    a, b = map(int, input().split())
    fa = judge(a - 1)
    fb = judge(b)
    print(fa ^ fb)
