N = int(eval(input()))

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

M = int(eval(input()))







for i in range(M):

    SUM = 0

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

    for i in range(N):

        Z = T[P-1]

        T[P-1] = X

        SUM = SUM + T[i]

        T[P-1] = Z

    print(SUM)
N = int(eval(input()))

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

M = int(eval(input()))

SUM = 0

for i in range(N):

    SUM = SUM + T[i]



for i in range(M):

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

    print((SUM-(T[P-1]-X)))
N = int(eval(input()))
T = list(map(int, input().split()))
M = int(eval(input()))
for i in range(M):
    SUM = 0
    P, X = list(map(int, input().split()))
    for i in range(N):
        Z = T[P - 1]
        T[P - 1] = X
        SUM = SUM + T[i]
        T[P - 1] = Z
    print(SUM)

N = int(eval(input()))
T = list(map(int, input().split()))
M = int(eval(input()))
SUM = 0
for i in range(N):
    SUM = SUM + T[i]
for i in range(M):
    P, X = list(map(int, input().split()))
    print((SUM - (T[P - 1] - X)))

+SUM = 0 +for i in range(N): +    SUM = SUM + T[i] -    SUM = 0 -    for i in range(N): -        Z = T[P - 1] -        T[P - 1] = X -        SUM = SUM + T[i] -        T[P - 1] = Z -    print(SUM) +    print((SUM - (T[P - 1] - X)))