a,b=map(int,input().split())
def xor_sum(x):
  r=x%2^x//2%2
  p=2
  for i in range(len(bin(x))-3):
    r+=p*(x%2<1 and x%(p*2)>=p)
    p*=2
  return r
print(xor_sum(a-1)^xor_sum(b)) a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b def xor_sum(x):
  r=x%2^x//2%2
  p=2
  for i in range(len(bin(x))-3):
    r+=p*(x%2<1 and x%(p*2)>=p)
    p*=2
  return r xor_sum r=x%2^x//2%2 r x%2^x//2%2 x%2 x 2 x//2%2 x//2 x 2 2 p=2 p 2 for i in range(len(bin(x))-3):
    r+=p*(x%2<1 and x%(p*2)>=p)
    p*=2
   i range(len(bin(x))-3) range len(bin(x))-3 len(bin(x)) len bin(x) bin x 3 r+=p*(x%2<1 and x%(p*2)>=p) r p*(x%2<1 and x%(p*2)>=p) p x%2<1 and x%(p*2)>=p x%2<1 x%2 x 2 1 x%(p*2)>=p x%(p*2) x p*2 p 2 p p*=2 p 2 return r r x x print(xor_sum(a-1)^xor_sum(b)) print xor_sum(a-1)^xor_sum(b) xor_sum(a-1) xor_sum a-1 a 1 xor_sum(b) xor_sum b a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b def xor_sum(x):
  r=x%2^x//2%2
  p=2
  for i in range(len(bin(x))-3):
    r+=p*(x%2<1 and x%(p*2)>=p)
    p*=2
  return r def xor_sum(x):
  r=x%2^x//2%2
  p=2
  for i in range(len(bin(x))-3):
    r+=p*(x%2<1 and x%(p*2)>=p)
    p*=2
  return r xor_sum
a,b=map(int,input().split())
def xor_sum(x):
  r=x%2^x//2%2
  p=2
  for i in range(len(bin(x))-3):
    r+=p*(x%2<1 and x%(p*2)>=p)
    p*=2
  return r
print(xor_sum(a-1)^xor_sum(b))