object Main {
	def main(args: Array[String]): Unit = {
		val sc = new java.util.Scanner(System.in)

    	val n: Int = sc.nextLine.toInt
    	val ts: Array[Int] = sc.nextLine.split(" ").map(_.toInt)
    	val m: Int = sc.nextLine.toInt
    	val pxs = for (_ <- 0 until m) yield {
    		sc.nextLine.split(" ").map(_.toInt)
    	}

    	for (px <- pxs) {
    		var t_net = 0
    		for ((t, i) <- ts.zipWithIndex) {
    			val t_ = if (px(0) == (i+1)) px(1) else t
    			t_net += t_
    		}
    		println(t_net)
    	}
	}
}