fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val T = readLine()!!.split(" ").map(String::toInt)

    val PX = Array(readLine()!!.toInt()) { readLine()!!.split(" ").map(String::toInt) }.map {
        Pair(it[0], it[1])
    }

    PX.forEach {
        println(T.sum() - T[it.first - 1] + it.second)
    }

}

