"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = require("fs");
const main = () => fs_1.readFileSync('/dev/stdin', 'utf8').slice(0, -1);
const args = main().split('\n');
const t = args[1].split(' ').map(x => +x);
const ans = args.slice(3).map(v => {
    const [p, x] = v.split(' ');
    return [...t.filter((_, i) => i !== +p - 1), +x].reduce((ac, cu) => ac + cu);
});
console.log(ans);
