
import scala.io.StdIn._

object Solution {

  def solve(index: Int, value: Int, arr: Array[Int]) : Unit = {
    println(arr.sum - arr(index) + value)
  }

  def main(args: Array[String]): Unit = {
    val n = readLine.toInt
    val arr = readLine.split(" ").map(_.toInt)
    val k = readLine.toInt
    for (i <- 0 until k) {
      val temp = readLine.split(" ").map(_.toInt)
      solve(temp(0) - 1, temp(1), arr)
    }
  }
}
