import copy

n = int(eval(input()))

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

m = int(eval(input()))

a = copy.copy(t)

for i in range(m):

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

  a[p - 1] = x

  print((sum(a)))

  a = copy.copy(t)
n = int(eval(input()))

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

m = int(eval(input()))

s = sum(t)

for i in range(m):

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

  print((s - t[p - 1] + x))

import copy

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

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

-import copy - -a = copy.copy(t) +s = sum(t) -    a[p - 1] = x -    print((sum(a))) -    a = copy.copy(t) +    print((s - t[p - 1] + x))