import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val t: MutableList<Int> = (0 until n).map { sc.nextInt() } as MutableList<Int>
    val m = sc.nextInt()
    val p = Array<MutableList<Int>>(m) { mutableListOf() }
    for (index in 0 until m) {
        p[index].add(sc.nextInt())
        p[index].add(sc.nextInt())
    }
    answer050bAlt(t, m, p)
}

fun answer050bAlt(t: MutableList<Int>, m: Int, p: Array<MutableList<Int>>) {
    for (i in 0 until m) {
        var tempList = t.toMutableList()
        var sum: Int
        tempList[(p[i][0].toInt()) - 1] = p[i][1]
        sum = tempList.sum()
        println(sum)
    }
}
