"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
    for (var r = Array(s), k = 0, i = 0; i < il; i++)
        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
            r[k] = a[j];
    return r;
};
exports.__esModule = true;
var fs_1 = require("fs");
var main = function () { return fs_1.readFileSync('/dev/stdin', 'utf8').slice(0, -1); };
var args = main().split('\n');
var t = args[1].split(' ').map(function (x) { return +x; });
var ans = args
    .slice(3)
    .map(function (v) {
    var _a = v.split(' '), p = _a[0], x = _a[1];
    return __spreadArrays(t.filter(function (_, i) { return i !== +p - 1; }), [+x]).reduce(function (ac, cu) { return ac + cu; });
})
    .join('\n');
console.log(ans);
