#include <bits/stdc++.h>
using namespace std;
long long int max_3(long long int a, long long int b, long long int c) {
  return max(a, max(b, c));
}
long long int min_3(long long int a, long long int b, long long int c) {
  return min(a, min(b, c));
}
long long int concate(long long int a, long long int b) {
  ostringstream os;
  os << a << b;
  istringstream is(os.str());
  long long int c;
  is >> c;
  return c;
}
long long int check(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
int main() {
  long long int q, t;
  long long int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0,
                j = 0, k = 0, l = 0, m = 0, n = 0, o = 0, r = 0, u = 0, w = 0,
                x = 0, y = 0, z = 0;
  long long int aa[1000];
  long long int flag = 0, flag1 = 0, co = 0, co1 = 0, co2 = 0, co3 = 0, x1 = 0,
                x2 = 0, y1 = 0, y2 = 0, z1 = 0, z2 = 0;
  long long int ma = 0, mi = 100000000;
  long long int mid = 0, temp = 0, stop = 0, start = 0;
  double pi = 3.141592653589793;
  double d1 = 0.0, d2, d3, d4;
  vector<long long int> v, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10;
  vector<string> vs, vs1, vs2, vs3, vs4;
  vector<pair<long long int, long long int> > vp, vp1, vp2;
  char ch, ch1, ch2[1001];
  string str, str1, str2, str3, str4, str5;
  pair<long long int, long long int> pa;
  set<long long int> st;
  vector<long long int>::iterator ivll;
  set<long long int>::iterator isll;
  vector<pair<long long int, long long int> >::iterator ivp;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a;
    v.push_back(a);
  }
  cin >> k;
  for (i = 0; i < k; i++) {
    cin >> a >> b;
    co = 0;
    v[a - 1] = b;
    for (j = 0; j < n; j++) co += v[j];
    v1.push_back(co);
  }
  for (i = 0; i < k; i++) cout << co << endl;
  ;
  return 0;
}
