import copy

n = int(eval(input()))

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

m = int(eval(input()))

for i in range(m):

    t = copy.copy(T)

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

    t[p-1] = x

    print((sum(t)))
n = int(eval(input()))

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

m = int(eval(input()))

for i in range(m):

    t = T.copy()

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

    t[p-1] = x

    print((sum(t)))
import copy

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

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

-import copy - -    t = copy.copy(T) +    t = T.copy()