object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val t = Array.fill(n)(sc.nextInt())
  val m = sc.nextInt()
  val sx = Array.fill(m)((sc.nextInt()-1, sc.nextInt()))
  val sum = t.sum
  for ((s, x) <- sx) {
    println(sum - t(s) + x)
  }
}
