A,B=list(map(int,input().split()))
C,D,s=0,0,B-A+1
C=0 if A%2==0 else A
D=0 if B%2==1 else B
if ((s-(0 if C==0 else 1)-(0 if D==0 else 1))//2)%2==0:
   E=0
else:
   E=1
print(C^D^E) A,B=list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split B C,D,s=0,0,B-A+1 C 0 D 0 s B-A+1 B-A B A 1 C=0 if A%2==0 else A C 0 if A%2==0 else A A%2==0 A%2 A 2 0 0 A D=0 if B%2==1 else B D 0 if B%2==1 else B B%2==1 B%2 B 2 1 0 B if ((s-(0 if C==0 else 1)-(0 if D==0 else 1))//2)%2==0:
   E=0
else:
   E=1 ((s-(0 if C==0 else 1)-(0 if D==0 else 1))//2)%2==0 ((s-(0 if C==0 else 1)-(0 if D==0 else 1))//2)%2 (s-(0 if C==0 else 1)-(0 if D==0 else 1))//2 s-(0 if C==0 else 1)-(0 if D==0 else 1) s-(0 if C==0 else 1) s 0 if C==0 else 1 C==0 C 0 0 1 0 if D==0 else 1 D==0 D 0 0 1 2 2 0 E=0 E 0 E=1 E 1 print(C^D^E) print C^D^E C^D C D E B=list(map(int,input().split())) list(map(int,input().split())) B D=0 if B%2==1 else B 0 if B%2==1 else B D E=1 1 E C=0 if A%2==0 else A 0 if A%2==0 else A C A,B=list(map(int,input().split())) list(map(int,input().split())) A C,D,s=0,0,B-A+1 0 C D,s=0,0,B-A+1 0 D E=0 0 E s=0,0,B-A+1 B-A+1 s
A,B=list(map(int,input().split()))
C,D,s=0,0,B-A+1
C=0 if A%2==0 else A
D=0 if B%2==1 else B
if ((s-(0 if C==0 else 1)-(0 if D==0 else 1))//2)%2==0:
   E=0
else:
   E=1
print(C^D^E)
