object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val a, b = Array.fill(n)(sc.nextLong())

  var ans = 0L
  for (i <- 0 to 29) {
    val t = 1 << i
    val am = a.map(_ % (t << 1))
    val bm = b.map(_ % (t << 1)).sorted

    def lowerBound(a: Array[Long], k: Long): Int = {
      def lowerBound(begin: Int, end: Int): Int = {
        if (end - begin <= 1) {
          end
        } else {
          val m = begin + (end - begin) / 2
          if (k <= a(m)) lowerBound(begin, m) else lowerBound(m, end)
        }
      }

      lowerBound(-1, a.length)
    }

    var even = true
    for (x <- am) {
      val i1 = lowerBound(bm, t - x)
      val i2 = lowerBound(bm, 2 * t - x)
      val i3 = lowerBound(bm, 3 * t - x)
      val i4 = lowerBound(bm, 4 * t - x)
      if (((i2 - i1) + (i4 - i3)) % 2 == 1) {
        even = !even
      }
    }

    if (!even) {
      ans += t
    }
  }

  println(ans)
}