A,B = map(int,input().split())
a = A%2>0
b = B%2<1
print((A*a)^(((B-b)-(A-1^a))//2%2)^(B*b)) A,B = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B a = A%2>0 a A%2>0 A%2 A 2 0 b = B%2<1 b B%2<1 B%2 B 2 1 print((A*a)^(((B-b)-(A-1^a))//2%2)^(B*b)) print (A*a)^(((B-b)-(A-1^a))//2%2)^(B*b) (A*a)^(((B-b)-(A-1^a))//2%2) A*a A a ((B-b)-(A-1^a))//2%2 ((B-b)-(A-1^a))//2 (B-b)-(A-1^a) B-b B b A-1^a A-1 A 1 a 2 2 B*b B b A,B = map(int,input().split()) map(int,input().split()) A a = A%2>0 A%2>0 a b = B%2<1 B%2<1 b B = map(int,input().split()) map(int,input().split()) B
A,B = map(int,input().split())
a = A%2>0
b = B%2<1
print((A*a)^(((B-b)-(A-1^a))//2%2)^(B*b))