n = int(eval(input()))

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

m = int(eval(input()))



d = []

for _ in range(m):

  d.append(tuple(map(int,input().split())))



base = sum(t)

for i,t_i in d:

  print((base-t[i-1]+t_i))

n = int(eval(input()))

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

m = int(eval(input()))



d = []

for _ in range(m):

  d.append(tuple(map(int,input().split())))



for i,t_i in d:

  print((sum(t)-t[i-1]+t_i))
n = int(eval(input()))
t = tuple(map(int, input().split()))
m = int(eval(input()))
d = []
for _ in range(m):
    d.append(tuple(map(int, input().split())))
base = sum(t)
for i, t_i in d:
    print((base - t[i - 1] + t_i))

n = int(eval(input()))
t = tuple(map(int, input().split()))
m = int(eval(input()))
d = []
for _ in range(m):
    d.append(tuple(map(int, input().split())))
for i, t_i in d:
    print((sum(t) - t[i - 1] + t_i))

-base = sum(t) -    print((base - t[i - 1] + t_i)) +    print((sum(t) - t[i - 1] + t_i))