program xor_sum_3
  implicit none
  integer :: n, i, j, k, c(0:59) = 0, cr(0:59) = 0, cb(0:59) = 0
  integer(8) :: a(100000) = 0_8, x = 0_8, y = 0_8
  logical :: used(100000) = .false.
  read(*,*) n
  read(*,*) a(1:n)
  do i = 1, n
    x = xor(x,a(i))
    do j = 0, 59
      if (btest(a(i),j)) c(j) = c(j)+1
    end do
  end do
  do j = 59, 0, -1
    if (mod(c(j),2) == 1 .or. mod(c(j)/2,2) == 0) cycle
    do i = 1, n
      if (used(i) .or. .not.btest(a(i),j)) cycle
      used(i) = .true.
      if (mod(cr(j),2) == mod(cb(j),2)) then
        do k = 0, j
          if (btest(a(i),k)) cr(k) = cr(k)+1
        end do
      else
        do k = 0, j
          if (btest(a(i),k)) cb(k) = cb(k)+1
        end do
      end if
    end do
    if (mod(cr(j),2) == 1) y = or(y,lshift(1_8,j))
  end do
  write(*,'(i0)') x+2_8*y
end program xor_sum_3