a, b = map(int, input().split())
a, b = min(a, b), max(a, b)
def f(a):
    if a % 2 == 0:
        return a ^ (a+1)//2%2
    else:
        return (a+1)//2%2
    
print(f(b) ^ f(a-1)) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b a, b = min(a, b), max(a, b) a min(a, b) min a b b max(a, b) max a b def f(a):
    if a % 2 == 0:
        return a ^ (a+1)//2%2
    else:
        return (a+1)//2%2
     f if a % 2 == 0:
        return a ^ (a+1)//2%2
    else:
        return (a+1)//2%2
     a % 2 == 0 a % 2 a 2 0 return a ^ (a+1)//2%2 a ^ (a+1)//2%2 a (a+1)//2%2 (a+1)//2 a+1 a 1 2 2 return (a+1)//2%2 (a+1)//2%2 (a+1)//2 a+1 a 1 2 2 a a print(f(b) ^ f(a-1)) print f(b) ^ f(a-1) f(b) f b f(a-1) f a-1 a 1 a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b b = min(a, b), max(a, b) max(a, b) b def f(a):
    if a % 2 == 0:
        return a ^ (a+1)//2%2
    else:
        return (a+1)//2%2
     def f(a):
    if a % 2 == 0:
        return a ^ (a+1)//2%2
    else:
        return (a+1)//2%2
     f a, b = min(a, b), max(a, b) min(a, b) a
a, b = map(int, input().split())
a, b = min(a, b), max(a, b)
def f(a):
    if a % 2 == 0:
        return a ^ (a+1)//2%2
    else:
        return (a+1)//2%2
    
print(f(b) ^ f(a-1))
