open Printf open Scanf
open Array

let () = scanf " %d %d" @@ fun a b ->
  if a=b then print_int a
  else if b=a+1 then print_int @@ a lxor b
  else
    let l = if a mod 2 = 0 then a else a+1 in
    let r = if b mod 2 = 1 then b else b-1 in
    print_int @@
      let pairs = (r-l+1) / 2 in
      let w = if pairs mod 2 = 0 then 0 else 1
      in
      w lxor (if l=a+1 then a else 0) lxor (if r=b-1 then b else 0)