a, b = map(int, input().split())
c, d = a, b
l = []
m = []
n = []
t = 0
while b > 0:
    l.append(b%2)
    b //= 2
k = len(l)
for i in range(k):
    m.append(a%2)
    a //= 2
if d%2 == 1:
    l = [0]*(k)
if c%2 == 0:
    m = [0]*(k)
for i in range(k):
    n.append((l[i]+m[i])%2)
c = (c+1)//2*2
d = (d+1)//2*2
if (d-c)%4 == 2 or (d-c)%4 == 3:
    n[0] = (n[0]+1)%2
for i in range(k):
    t += n[i]*(2**i)
print(t) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b c, d = a, b c a d b l = [] l [] m = [] m [] n = [] n [] t = 0 t 0 while b > 0:
    l.append(b%2)
    b //= 2 b > 0 b 0 l.append(b%2) l.append l append b%2 b 2 b //= 2 b 2 k = len(l) k len(l) len l for i in range(k):
    m.append(a%2)
    a //= 2 i range(k) range k m.append(a%2) m.append m append a%2 a 2 a //= 2 a 2 if d%2 == 1:
    l = [0]*(k) d%2 == 1 d%2 d 2 1 l = [0]*(k) l [0]*(k) [0] 0 k if c%2 == 0:
    m = [0]*(k) c%2 == 0 c%2 c 2 0 m = [0]*(k) m [0]*(k) [0] 0 k for i in range(k):
    n.append((l[i]+m[i])%2) i range(k) range k n.append((l[i]+m[i])%2) n.append n append (l[i]+m[i])%2 l[i]+m[i] l[i] l i m[i] m i 2 c = (c+1)//2*2 c (c+1)//2*2 (c+1)//2 c+1 c 1 2 2 d = (d+1)//2*2 d (d+1)//2*2 (d+1)//2 d+1 d 1 2 2 if (d-c)%4 == 2 or (d-c)%4 == 3:
    n[0] = (n[0]+1)%2 (d-c)%4 == 2 or (d-c)%4 == 3 (d-c)%4 == 2 (d-c)%4 d-c d c 4 2 (d-c)%4 == 3 (d-c)%4 d-c d c 4 3 n[0] = (n[0]+1)%2 n[0] n 0 (n[0]+1)%2 n[0]+1 n[0] n 0 1 2 for i in range(k):
    t += n[i]*(2**i) i range(k) range k t += n[i]*(2**i) t n[i]*(2**i) n[i] n i 2**i 2 i print(t) print t c, d = a, b a c l = [] [] l m = [0]*(k) [0]*(k) m m = [] [] m n = [] [] n c = (c+1)//2*2 (c+1)//2*2 c t += n[i]*(2**i) n[i]*(2**i) t b = map(int, input().split()) map(int, input().split()) b d = a, b b d t = 0 0 t l = [0]*(k) [0]*(k) l a //= 2 2 a k = len(l) len(l) k d = (d+1)//2*2 (d+1)//2*2 d a, b = map(int, input().split()) map(int, input().split()) a b //= 2 2 b
a, b = map(int, input().split())
c, d = a, b
l = []
m = []
n = []
t = 0
while b > 0:
    l.append(b%2)
    b //= 2
k = len(l)
for i in range(k):
    m.append(a%2)
    a //= 2
if d%2 == 1:
    l = [0]*(k)
if c%2 == 0:
    m = [0]*(k)
for i in range(k):
    n.append((l[i]+m[i])%2)
c = (c+1)//2*2
d = (d+1)//2*2
if (d-c)%4 == 2 or (d-c)%4 == 3:
    n[0] = (n[0]+1)%2
for i in range(k):
    t += n[i]*(2**i)
print(t)