a,b=map(int,input().split())


def F(a:int):
    if a%2==1:
        if a%4==1:
            return 1
        else:
            return 0
    else:
        return F(a+1)^(a+1)
ans=F(a-1)^F(b)
print(ans) a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b def F(a:int):
    if a%2==1:
        if a%4==1:
            return 1
        else:
            return 0
    else:
        return F(a+1)^(a+1) F if a%2==1:
        if a%4==1:
            return 1
        else:
            return 0
    else:
        return F(a+1)^(a+1) a%2==1 a%2 a 2 1 if a%4==1:
            return 1
        else:
            return 0
     a%4==1 a%4 a 4 1 return 1 1 return 0 0 return F(a+1)^(a+1) F(a+1)^(a+1) F(a+1) F a+1 a 1 a+1 a 1 a:int a ans=F(a-1)^F(b) ans F(a-1)^F(b) F(a-1) F a-1 a 1 F(b) F b print(ans) print ans ans=F(a-1)^F(b) F(a-1)^F(b) ans a,b=map(int,input().split()) map(int,input().split()) a def F(a:int):
    if a%2==1:
        if a%4==1:
            return 1
        else:
            return 0
    else:
        return F(a+1)^(a+1) def F(a:int):
    if a%2==1:
        if a%4==1:
            return 1
        else:
            return 0
    else:
        return F(a+1)^(a+1) F b=map(int,input().split()) map(int,input().split()) b
a,b=map(int,input().split())


def F(a:int):
    if a%2==1:
        if a%4==1:
            return 1
        else:
            return 0
    else:
        return F(a+1)^(a+1)
ans=F(a-1)^F(b)
print(ans)