import copy

n=int(input())

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

m=int(input())

pt=[list(map(int,input().split())) for _ in range(m)]

ans=[0]*m

for i in range(m):

    tmp=copy.deepcopy(t)

    tmp[pt[i][0]-1]=pt[i][1]

    for j in range(n):

        ans[i]+=tmp[j]

for i in range(m):

    print((ans[i]))
n=int(input())

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

m=int(input())

pt=[list(map(int,input().split())) for _ in range(m)]

ans=[0]*m

for i in range(m):

    tmp=list(t)

    tmp[pt[i][0]-1]=pt[i][1]

    for j in range(n):

        ans[i]+=tmp[j]

for i in range(m):

    print((ans[i]))
import copy

n = int(input())
t = list(map(int, input().split()))
m = int(input())
pt = [list(map(int, input().split())) for _ in range(m)]
ans = [0] * m
for i in range(m):
    tmp = copy.deepcopy(t)
    tmp[pt[i][0] - 1] = pt[i][1]
    for j in range(n):
        ans[i] += tmp[j]
for i in range(m):
    print((ans[i]))

n = int(input())
t = list(map(int, input().split()))
m = int(input())
pt = [list(map(int, input().split())) for _ in range(m)]
ans = [0] * m
for i in range(m):
    tmp = list(t)
    tmp[pt[i][0] - 1] = pt[i][1]
    for j in range(n):
        ans[i] += tmp[j]
for i in range(m):
    print((ans[i]))

-import copy - -    tmp = copy.deepcopy(t) +    tmp = list(t)