#pragma GCC optimize(3)
#include<cstdio>
using namespace std;
int a[110],b,c,d,e;
int main(){
scanf("%d",&b);
for(int i=0;i<b;i++){
scanf("%d",&a[i]);d+=a[i];}
scanf("%d",&c),e=d;
while(c--){
int p,x;scanf("%d%d",&p,&x);
if(x>=a[p-1])d+=x-a[p-1];
else d-=a[p-1]-x;
printf("%d\n",d);
d=e;}}