import scala.io.{ StdIn => in}

object Main extends App {
  val out = new java.io.PrintWriter(System.out)
  val n = in.readInt
  val t = in.readLine.split(" ").map(_.toInt)
  val m = in.readInt

  Iterator.continually(in.readLine)
    .take(m)
    .map(_.split(" ").map(_.toInt))
    .foreach(arr => {
      val pi = arr(0) - 1
      val xi = arr(1)
      out.println(t.sum - t(pi) + xi)
    })
  out.flush
}