a,b=map(int,input().split())
a-=1
a_=[a,1,a+1,0]
b_=[b,1,b+1,0]
print(a_[a%4]^b_[b%4]) a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b a-=1 a 1 a_=[a,1,a+1,0] a_ [a,1,a+1,0] a 1 a+1 a 1 0 b_=[b,1,b+1,0] b_ [b,1,b+1,0] b 1 b+1 b 1 0 print(a_[a%4]^b_[b%4]) print a_[a%4]^b_[b%4] a_[a%4] a_ a%4 a 4 b_[b%4] b_ b%4 b 4 b_=[b,1,b+1,0] [b,1,b+1,0] b_ a-=1 1 a a_=[a,1,a+1,0] [a,1,a+1,0] a_ 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())
a-=1
a_=[a,1,a+1,0]
b_=[b,1,b+1,0]
print(a_[a%4]^b_[b%4])