void main() {
    int n = readln.chomp.to!int;
    int[] t = readln.split.to!(int[]);
    int m = readln.chomp.to!int;
    int[] p = new int[m], x = new int[m];
    foreach (i; 0 .. m) {
        int[] tmp = readln.split.to!(int[]);
        p[i] = tmp[0], x[i] = tmp[1];
    }
    foreach (i; 0 .. m) {
        writeln(x[i] + t[0..p[i]-1].sum + t[p[i]..$].sum);
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;