object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt()
    sc.nextLine()
    val tList = sc.nextLine().replaceAll("\n", "").split(" ").toList.map(_.toInt)
    val m = sc.nextInt()
    sc.nextLine()
    var xtimes = List[List[Int]]()
    for (i <- 0 until m) {
      val t = sc.nextLine().replaceAll("\n", "").split(" ").toList.map(_.toInt)
      xtimes = xtimes :+ t
    }

    for (i <- xtimes) {
      val p = i.head
      val x = i(1)
      val sum = tList.sum
      val diff = x - tList(p - 1)
      println(sum + diff)
    }

  }

}
