A,B = map(int,input().split())
def f(B):
  return ((B+1)%2==0)*((B+1)//2%2==1) + ((B+1)%2!=0)*(((B+1)//2%2==1)^B)
print(f(A-1)^f(B)) A,B = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B def f(B):
  return ((B+1)%2==0)*((B+1)//2%2==1) + ((B+1)%2!=0)*(((B+1)//2%2==1)^B) f return ((B+1)%2==0)*((B+1)//2%2==1) + ((B+1)%2!=0)*(((B+1)//2%2==1)^B) ((B+1)%2==0)*((B+1)//2%2==1) + ((B+1)%2!=0)*(((B+1)//2%2==1)^B) ((B+1)%2==0)*((B+1)//2%2==1) (B+1)%2==0 (B+1)%2 B+1 B 1 2 0 (B+1)//2%2==1 (B+1)//2%2 (B+1)//2 B+1 B 1 2 2 1 ((B+1)%2!=0)*(((B+1)//2%2==1)^B) (B+1)%2!=0 (B+1)%2 B+1 B 1 2 0 ((B+1)//2%2==1)^B (B+1)//2%2==1 (B+1)//2%2 (B+1)//2 B+1 B 1 2 2 1 B B B print(f(A-1)^f(B)) print f(A-1)^f(B) f(A-1) f A-1 A 1 f(B) f B def f(B):
  return ((B+1)%2==0)*((B+1)//2%2==1) + ((B+1)%2!=0)*(((B+1)//2%2==1)^B) def f(B):
  return ((B+1)%2==0)*((B+1)//2%2==1) + ((B+1)%2!=0)*(((B+1)//2%2==1)^B) f B = map(int,input().split()) map(int,input().split()) B A,B = map(int,input().split()) map(int,input().split()) A
A,B = map(int,input().split())
def f(B):
  return ((B+1)%2==0)*((B+1)//2%2==1) + ((B+1)%2!=0)*(((B+1)//2%2==1)^B)
print(f(A-1)^f(B))