

import copy



n = int(eval(input()))

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

m = int(eval(input()))



l = []



for i in range(m):

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

    l = copy.copy(t)

    l[p-1] = x

#    print(t)

#    print(l)

    print((sum(l)))



n = int(eval(input()))

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



m = int(eval(input()))



for i in range(m):

    tmp = t.copy()

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

    tmp[p-1] = x

    print((sum(tmp)))

import copy

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

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

-import copy - -l = [] +    tmp = t.copy() -    l = copy.copy(t) -    l[p - 1] = x -    #    print(t) -    #    print(l) -    print((sum(l))) +    tmp[p - 1] = x +    print((sum(tmp)))