program main
  integer(8) :: A,B
  integer(8) :: out
  integer(8) :: N
  integer(8) :: i
  read(*,*) A,B
  N=B-A
  out=A
  do i = 1, N
     out = IEOR(out,A+i)
  end do
  write(*,'(i0)') out
!  write(*,'(i0)')

end program main
  