import std.algorithm;
import std.range;
import std.math;
import std.regex;
import std.array;
import std.container;
import std.stdio;
import std.string;
import std.conv;

string[] readStrs() { return readln.chomp.split(' '); }
T[] readInts(T)() { return readln.chomp.split(' ').map!(to!T).array(); }
T readInt(T)() { return readln.chomp.to!T; }

void main()
{
    auto N = readInt!int;
    auto Ts = readInts!int;
    auto M = readInt!int;
    foreach(i; 0 .. M){
        auto px = readInts!int;
        auto p = px[0] - 1,
             x = px[1];

        auto v = Ts[p];
        Ts[p] = x;
        writeln(Ts.sum);
        Ts[p] = v;
    }
}