import scala.io.StdIn._
object Main extends App{
  val sc = new java.util.Scanner(System.in)
  var n = sc.nextInt
  val tlist = List.fill(n)(sc.nextInt)
  val m = sc.nextInt
  val plist = List.fill(m,2)(sc.nextInt)
  for(i<-0 to m-1){
    var sum=0
    for(j<-0 to n-1){
      if(plist(i)(0)==j+1){
       sum+=plist(i)(1)
      }
      else{
       sum+=tlist(j) 
      }
    }
    println(sum)
  }
}