import copy

N=int(eval(input()))

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

M=int(eval(input()))

Drink=[list(map(int,input().split())) for _ in range(M)]

for i in range(M):

    p=Drink[i][0]

    x=Drink[i][1]

    answer=copy.deepcopy(T)

    answer[p-1]=x

    print((sum(answer)))

N=int(eval(input()))

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

M=int(eval(input()))

Drink=[list(map(int,input().split())) for _ in range(M)]

answer=sum(T)

for i in range(M):

    p=Drink[i][0]

    x=Drink[i][1]

    print((answer-T[p-1]+x))

import copy

N = int(eval(input()))
T = list(map(int, input().split()))
M = int(eval(input()))
Drink = [list(map(int, input().split())) for _ in range(M)]
for i in range(M):
    p = Drink[i][0]
    x = Drink[i][1]
    answer = copy.deepcopy(T)
    answer[p - 1] = x
    print((sum(answer)))

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

-import copy - +answer = sum(T) -    answer = copy.deepcopy(T) -    answer[p - 1] = x -    print((sum(answer))) +    print((answer - T[p - 1] + x))