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

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

    def lowerBound(a: Array[Int], 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)) & 1) == 1) {
        even = !even
      }
    }

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

  println(ans)
}

class FastScanner(source: java.io.InputStream) {
  val buf = new Array[Byte](1024)
  var now, end = 0

  def isPrintable(b: Byte): Boolean = 33 <= b && b <= 126
  def isNum(b: Byte): Boolean = 48 <= b && b <= 57

  def hasNextByte: Boolean = {
    if (now < end) {
      true
    } else {
      now = 0
      end = source.read(buf)
      end > 0
    }
  }

  def nextByte(): Byte = {
    if (hasNextByte) {
      val b = buf(now)
      now += 1
      b
    } else {
      -1
    }
  }

  def hasNext: Boolean = {
    while (hasNextByte && !isPrintable(buf(now))) {
      now += 1
    }
    hasNextByte
  }

  def next(): String = {
    if (hasNext) {
      val sb = new StringBuilder()
      var b = nextByte()
      while (isPrintable(b)) {
        sb += b.toChar
        b = nextByte()
      }
      sb.toString
    } else {
      throw new NoSuchElementException()
    }
  }

  def nextInt(): Int = {
    nextLong().toInt
  }

  def nextLong(): Long = {
    if (hasNext) {
      var b = nextByte()
      var sign = 1
      var n = 0L
      if (b == '-') {
        sign = -1
        b = nextByte()
      }
      while (isNum(b)) {
        n = n * 10 + (b - 48)
        b = nextByte()
      }
      sign * n
    } else {
      throw new NoSuchElementException()
    }
  }

  def nextDouble(): Double = next().toDouble
}
