import copy



n = int(eval(input()))

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





n = int(eval(input()))

for i in range(n):

    idx, value = list(map(int, input().split()))

    T = copy.deepcopy(t)

    t[idx - 1] = value

    print((sum(t)))

    t = copy.deepcopy(T)

import copy



n = int(eval(input()))

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

sum_t = sum(t)





m = int(eval(input()))

for _ in range(m):

    idx, value = list(map(int, input().split()))

    print((sum_t - t[idx - 1] + value))



import copy

n = int(eval(input()))
t = list(map(int, input().split()))
n = int(eval(input()))
for i in range(n):
    idx, value = list(map(int, input().split()))
    T = copy.deepcopy(t)
    t[idx - 1] = value
    print((sum(t)))
    t = copy.deepcopy(T)

import copy

n = int(eval(input()))
t = list(map(int, input().split()))
sum_t = sum(t)
m = int(eval(input()))
for _ in range(m):
    idx, value = list(map(int, input().split()))
    print((sum_t - t[idx - 1] + value))

-n = int(eval(input())) -for i in range(n): +sum_t = sum(t) +m = int(eval(input())) +for _ in range(m): -    T = copy.deepcopy(t) -    t[idx - 1] = value -    print((sum(t))) -    t = copy.deepcopy(T) +    print((sum_t - t[idx - 1] + value))