import copy

n=int(eval(input()))

t=[int(i) for i in input().split()]

m=int(eval(input()))

for i in range(m):

    cur=copy.deepcopy(t)

    drink=[int(i) for i in input().split()]

    cur[drink[0]-1]=drink[1]

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

t=[int(i) for i in input().split()]

s=sum(t)

m=int(eval(input()))

for i in range(m):

    p,m=[int(i) for i in input().split()]

    print((s-(t[p-1]-m)))
import copy

n = int(eval(input()))
t = [int(i) for i in input().split()]
m = int(eval(input()))
for i in range(m):
    cur = copy.deepcopy(t)
    drink = [int(i) for i in input().split()]
    cur[drink[0] - 1] = drink[1]
    print((sum(cur)))

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

-import copy - +s = sum(t) -    cur = copy.deepcopy(t) -    drink = [int(i) for i in input().split()] -    cur[drink[0] - 1] = drink[1] -    print((sum(cur))) +    p, m = [int(i) for i in input().split()] +    print((s - (t[p - 1] - m)))