import copy

n = int(eval(input()))

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

m = int(eval(input()))

for _ in range(m):

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

  t_copy = copy.deepcopy(t)

  t_copy[p-1] = x

  print((sum(t_copy)))
import copy

n = int(eval(input()))

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

m = int(eval(input()))

sum_t = sum(t)

for _ in range(m):

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

  print((sum_t - (t[p-1] - x)))
import copy

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

import copy

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

+sum_t = sum(t) -    t_copy = copy.deepcopy(t) -    t_copy[p - 1] = x -    print((sum(t_copy))) +    print((sum_t - (t[p - 1] - x)))