'use strict'

function main(input) {
  input = input
    .trim()
    .split('\n')
    .map(v => v.split(' ').map(v => Number(v)))
  const N = input[0][0]
  const T = input[1]
  const M = input[2][0]
  const P = input.slice(3)

  // console.log(M, P)

  const total = T.reduce((a, b) => a + b)

  let ans = []
  for (let i = 0; i < M; i++) {
    const a = P[i][0]
    const b = P[i][1]

    ans.push(total - (T[P[i][0] - 1] - P[i][1]))
  }
  console.log(ans.join('\n'))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))