program xor_sum_3
  implicit none
  integer :: n, i, j, x(100000,60) = 0
  integer(8) :: a(100000) = 0_8, ans1 = 0_8, ans2 = 0_8
  read(*,*) n
  read(*,*) a(1:n)
  do i = 1, n
    do j = 1, 60
      if (btest(a(i),j-1)) x(i,j) = 1
    end do
  end do
  do j = 1, 60
    if (mod(sum(x(1:n,j)),2) == 1) then
      ans1 = or(ans1,lshift(1_8,j-1))
      x(1:n,j) = 0
    end if
  end do
  x(1:n,1:60) = x(1:n,60:1:-1)
  call normal_form(x(1:n,:))
  x(1:n,1:60) = x(1:n,60:1:-1)
  j = 60
  do i = 1, n
    do while (j > 0 .and. x(i,j) == 0)
      j = j-1
    end do
    if (j == 0) exit
    ans2 = or(ans2,lshift(1_8,j-1))
  end do
  write(*,'(i0)') ans1+2_8*ans2
contains
  subroutine normal_form(a)
    integer, intent(inout) :: a(:,:)
    integer :: n, m, i, j, k, l
    n = size(a,1)
    m = size(a,2)
    i = 1
    do j = 1, m
      if (sum(a(i:n,j)) == 0) cycle
      if (a(i,j) == 0) then
        do k = i+1, n
          if (a(k,j) == 1) then
            do l = j, m
              a(i,l) = xor(a(i,l),a(k,l))
            end do
            exit
          end if
        end do
      end if
      do k = 1, n
        if (k == i) cycle
        if (a(k,j) == 0) cycle
        do l = j, m
          a(k,l) = xor(a(k,l),a(i,l))
        end do
      end do
      i = i+1
      if (i > n) exit
    end do
  end
end program xor_sum_3