import copy

n=int(eval(input()))

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

m=int(eval(input()))

for i in range(m):

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

    tmp=copy.deepcopy(t)

    tmp[p-1]=q

    print((sum(tmp)))

n = int(eval(input()))

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

s = sum(t)

m = int(eval(input()))

for i in range(m):

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

    print((s - t[p-1] + x))

import copy

n = int(eval(input()))
t = list(map(int, input().split()))
m = int(eval(input()))
for i in range(m):
    p, q = list(map(int, input().split()))
    tmp = copy.deepcopy(t)
    tmp[p - 1] = q
    print((sum(tmp)))

n = int(eval(input()))
t = list(map(int, input().split()))
s = sum(t)
m = int(eval(input()))
for i in range(m):
    p, x = list(map(int, input().split()))
    print((s - t[p - 1] + x))

-import copy - +s = sum(t) -    p, q = list(map(int, input().split())) -    tmp = copy.deepcopy(t) -    tmp[p - 1] = q -    print((sum(tmp))) +    p, x = list(map(int, input().split())) +    print((s - t[p - 1] + x))