import copy

N = int(eval(input()))

Ts = list(map(int, input().split()))

M = int(eval(input()))

for i in range(M):

  P, x = list(map(int, input().split()))

  Ts_2 = copy.copy(Ts) #コピーを行う

  Ts_2[P-1] = x

  print((sum(Ts_2)))

  
N = int(eval(input()))

Ts = list(map(int, input().split()))

M = int(eval(input()))

for i in range(M):

  p, x = list(map(int, input().split()))

  print((sum(Ts)-Ts[p-1]+x))
import copy

N = int(eval(input()))
Ts = list(map(int, input().split()))
M = int(eval(input()))
for i in range(M):
    P, x = list(map(int, input().split()))
    Ts_2 = copy.copy(Ts)  # コピーを行う
    Ts_2[P - 1] = x
    print((sum(Ts_2)))

N = int(eval(input()))
Ts = list(map(int, input().split()))
M = int(eval(input()))
for i in range(M):
    p, x = list(map(int, input().split()))
    print((sum(Ts) - Ts[p - 1] + x))

-import copy - -    P, x = list(map(int, input().split())) -    Ts_2 = copy.copy(Ts)  # コピーを行う -    Ts_2[P - 1] = x -    print((sum(Ts_2))) +    p, x = list(map(int, input().split())) +    print((sum(Ts) - Ts[p - 1] + x))