open Printf open Scanf
open Array

let calc c =
  let r = if c mod 2 = 0 then c-1 else c in
  let pairs = (r+1)/2 in
  (if pairs mod 2 = 0 then 0 else 1) lxor (if r=c-1 then c else 0)

let () = scanf " %d %d" @@ fun a b ->
  print_int @@ (calc b) lxor (calc (a-1))


