#include<bits/stdc++.h>
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using namespace std;
int main(){
  int n;cin>>n;
  int sum=0;
  int t[n];rep(i,n){cin>>t[i];sum+=t[i];}
  int m;cin>>m;
  int p[m],x[m];
  rep(i,m){
    cin>>p[i]>>x[i];
    cout<<sum-(t[p[i]-1]-x[i])<<endl;
  }
}