#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"n,*t=map(int,open(0).read().split())\n"
"for p,x in zip(t[n+1::2],t[n+2::2]):print(sum(t[:n])-t[p-1]+x)\n"
"\"";
  system(s);
  return 0;
}            