import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    readint;
    auto ts = readints;
    int sum = ts.sum;
    int m = readint;
    for (int i = 0; i < m; i++) {
        auto px = readints;
        int p = px[0] - 1;
        int x = px[1];
        writeln(sum - ts[p] + x);
    }
}
