fun main(args: Array<String>) {
    abc050b()
}

fun abc050b() {
    val n = readLine()!!.toInt()
    val tList = readLine()!!.split(" ").map { it.toInt() }.toIntArray()
    val m = readLine()!!.toInt()
    val pxList = (1..m).map { readLine()!!.split(" ").map { it.toInt() } }
        .map { Pair(it[0], it[1]) }

    val answer = pxList.map { px ->
        val times = tList.clone()
        times[px.first - 1] = px.second
        times.sum()
    }

    println(answer.joinToString(System.lineSeparator()))
}
