
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 px = Array.fill(m)((sc.nextInt(), sc.nextInt()))
  px.foreach{ i =>
    var array = t.clone
    array(i._1 - 1) = i._2
    println(array.sum)
  }
}