import java.util.Scanner

object Main extends App{
  val sc = new Scanner(System.in)

  val n  = sc.nextInt
  val tl = List.fill(n)(sc.nextInt)
  val m  = sc.nextInt
  val cl = List.fill(m)((sc.nextInt, sc.nextInt))

  val nSum = tl.sum

  val ress = cl.map{case (p,x) => nSum - tl(p - 1) + x}

  ress.foreach(println)
}
