N=int(input());T=list(map(int,input().split()));M=int(input());total=sum(T)

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

[print(total + px[i][1] - T[px[i][0]-1]) for i in range(M)]

n,t=int(input()),list(map(int,input().split()));T=sum(t)

print(*[T-t[i-1]+j for i,j in [list(map(int,input().split())) for _ in range(int(input()))]],sep='\n')

N = int(input())
T = list(map(int, input().split()))
M = int(input())
total = sum(T)
px = [list(map(int, input().split())) for _ in range(M)]
[print(total + px[i][1] - T[px[i][0] - 1]) for i in range(M)]

n, t = int(input()), list(map(int, input().split()))
T = sum(t)
print(
    *[
        T - t[i - 1] + j
        for i, j in [list(map(int, input().split())) for _ in range(int(input()))]
    ],
    sep="\n"
)

-N = int(input()) -T = list(map(int, input().split())) -M = int(input()) -total = sum(T) -px = [list(map(int, input().split())) for _ in range(M)] -[print(total + px[i][1] - T[px[i][0] - 1]) for i in range(M)] +n, t = int(input()), list(map(int, input().split())) +T = sum(t) +print( +    *[ +        T - t[i - 1] + j +        for i, j in [list(map(int, input().split())) for _ in range(int(input()))] +    ], +    sep="\n" +)