import copy



N = int(eval(input()))

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

M = int(eval(input()))



for i in range(M):

    T_Copy = copy.copy(T)

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

    T_Copy[P-1] = X

    print((sum(T_Copy)))

N = int(eval(input()))

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

M = int(eval(input()))

T_sum = sum(T)



for i in range(M):

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

    print((T_sum - 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):
    T_Copy = copy.copy(T)
    P, X = list(map(int, input().split()))
    T_Copy[P - 1] = X
    print((sum(T_Copy)))

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

-import copy - +T_sum = sum(T) -    T_Copy = copy.copy(T) -    T_Copy[P - 1] = X -    print((sum(T_Copy))) +    print((T_sum - T[P - 1] + X))