Joisino is about to compete in the final round of a certain programming competition.
In this contest, there are N problems, numbered 1 through N.
Joisino knows that it takes her T_i seconds to solve problem i(1≦i≦N).
Also, there are M kinds of drinks offered to the contestants, numbered 1 through M.
If Joisino takes drink i(1≦i≦M), her brain will be stimulated and the time it takes for her to solve problem P_i will become X_i seconds.
It does not affect the time to solve the other problems.
A contestant is allowed to take exactly one of the drinks before the start of the contest.
For each drink, Joisino wants to know how many seconds it takes her to solve all the problems if she takes that drink.
Here, assume that the time it takes her to solve all the problems is equal to the sum of the time it takes for her to solve individual problems.
Your task is to write a program to calculate it instead of her.

-----Constraints-----
 - All input values are integers.
 - 1≦N≦100
 - 1≦T_i≦10^5
 - 1≦M≦100
 - 1≦P_i≦N
 - 1≦X_i≦10^5

-----Input-----
The input is given from Standard Input in the following format:
N
T_1 T_2 ... T_N
M
P_1 X_1
P_2 X_2
:
P_M X_M

-----Output-----
For each drink, calculate how many seconds it takes Joisino to solve all the problems if she takes that drink, and print the results, one per line.

-----Sample Input-----
3
2 1 4
2
1 1
2 3

-----Sample Output-----
6
9

If Joisino takes drink 1, the time it takes her to solve each problem will be 1, 1 and 4 seconds, respectively, totaling 6 seconds.
If Joisino takes drink 2, the time it takes her to solve each problem will be 2, 3 and 4 seconds, respectively, totaling 9 seconds.

Difficulty: EASY

Solutions:
input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
	(p, x) = map(int, input().split())
	t = T[:]
	t[p - 1] = x
	print(sum(t))


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


N = int(input())
L1 = list(map(int, input().split()))
M = int(input())
for _ in range(M):
	(x, y) = map(int, input().split())
	print(sum(L1) - L1[x - 1] + y)


N = int(input())
T = list(map(int, input().split()))
S = sum(T)
M = int(input())
for k in range(M):
	(P, X) = map(int, input().split())
	print(S - T[P - 1] + X)


n = int(input())
tl = [int(i) for i in input().split()]
ts = sum(tl)
for i in range(int(input())):
	(p, x) = map(int, input().split())
	print(ts - tl[p - 1] + x)


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


num_problems = int(input())
t = [int(n) for n in input().split()]
total = sum(t)
num_drinks = int(input())
for i in range(num_drinks):
	(m_id, m_val) = [int(n) for n in input().split()]
	ans = total - t[m_id - 1] + m_val
	print(ans)


N = int(input())
t = list(map(int, input().split()))
T = sum(t)
M = int(input())
for _ in range(M):
	(p, x) = map(int, input().split())
	print(T - (t[p - 1] - x))


N = int(input())
T = list(map(int, input().split()))
M = int(input())
s = sum(T)
for i in range(M):
	(P, X) = map(int, input().split())
	print(s - T[P - 1] + X)


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


n = int(input())
x = list(map(int, input().split()))
g = sum(x)
for i in range(int(input())):
	(a, b) = map(int, input().split())
	print(g - x[a - 1] + b)


n = int(input())
A = list(map(int, input().split()))
B = A
m = int(input())
for i in range(m):
	(a, b) = map(int, input().split())
	print(sum(A) - A[a - 1] + b)


from typing import List

def answer(n: int, t: List[int], m: int, pxs: List[List[int]]) -> str:
	result = []
	for px in pxs:
		t_copy = t.copy()
		t_copy[px[0] - 1] = px[1]
		result.append(str(sum(t_copy)))
	return '\n'.join(result)

def main():
	n = int(input())
	t = list(map(int, input().split()))
	m = int(input())
	pxs = [list(map(int, input().split())) for _ in range(m)]
	print(answer(n, t, m, pxs))

def __starting_point():
	main()
__starting_point()


N = int(input())
T = [int(i) for i in input().split()]
M = int(input())
ans = sum(T)
for i in range(M):
	(P, X) = map(int, input().split())
	print(ans - T[P - 1] + X)


a = int(input())
b = list(map(int, input().split()))
c = int(input())
for _ in range(c):
	d = list(map(int, input().split()))
	e = b[:]
	e[d[0] - 1] = d[1]
	print(sum(e))


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


N = int(input())
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
	(p, x) = list(map(int, input().split()))
	s = sum(T) - T[p - 1] + x
	print(s)


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


n = int(input())
t = list(map(int, input().split()))
m = int(input())
for i in range(m):
	(a, b) = map(int, input().split())
	T = sum(t) - t[a - 1] + b
	print(T)


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


n = int(input())
T = list(map(int, input().split()))
m = int(input())
sumT = sum(T)
for _ in range(m):
	(p, x) = map(int, input().split())
	print(sumT - T[p - 1] + x)


import copy

def main():
	N = int(input())
	T = list(map(int, input().split()))
	M = int(input())
	PX = []
	for i in range(M):
		(P, X) = list(map(int, input().split()))
		tmp = copy.copy(T)
		tmp[P - 1] = X
		print(sum(tmp))

def __starting_point():
	main()
__starting_point()


N = int(input())
T = list(map(int, input().split()))
M = int(input())
drink = []
for i in range(M):
	(P, X) = map(int, input().split())
	drink.append([P, X])
for j in range(len(drink)):
	(P, X) = drink[j]
	time = X + sum(T) - T[P - 1]
	print(time)


n = int(input())
t = list(map(int, input().split()))
m = int(input())
for _ in ['0'] * m:
	(p, x) = map(int, input().split())
	print(sum(t) - t[p - 1] + x)


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


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


(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())
D = [tuple(map(int, input().split())) for _ in range(m)]
sum_T = sum(T)
for i in range(m):
	print(sum_T - T[D[i][0] - 1] + D[i][1])


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


import copy
n = int(input())
li = list(map(int, input().split()))
lis = copy.copy(li)
m = int(input())
dri = [list(map(int, input().split())) for i in range(m)]
for i in range(len(dri)):
	lis = copy.copy(li)
	lis[dri[i][0] - 1] = dri[i][1]
	print(sum(lis))


N = int(input())
T = list(map(int, input().split()))
M = int(input())
P = []
X = []
for i in range(M):
	(p, x) = list(map(int, input().split()))
	P.append(p)
	X.append(x)
Sum = sum(T)
for i in range(M):
	print(Sum - T[P[i] - 1] + X[i])


n = int(input())
timeList = list(map(int, input().split()))
m = int(input())
argList = [list(map(int, input().split())) for _ in range(m)]
res_time = sum(timeList)
for a in argList:
	print(res_time - timeList[a[0] - 1] + a[1])


N = int(input())
T = input()
M = int(input())
P = [input() for i in range(M)]

def ans050(N: int, T: str, M: int, P: list):
	T_list = list(map(int, T.split()))
	ans_list = []
	for i in range(M):
		T_list = list(map(int, T.split()))
		P_list = list(map(int, P[i].split()))
		del T_list[P_list[0] - 1]
		T_list.append(P_list[1])
		ans_list.append(sum(T_list))
	return ans_list
for i in range(M):
	print(ans050(N, T, M, P)[i])


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


N = int(input())
times = list(map(int, input().split()))
M = int(input())
drinks = [tuple(map(int, input().split())) for _ in range(M)]
time_sum_raw = sum(times)
for (pi, xi) in drinks:
	print(time_sum_raw - times[pi - 1] + xi)


n = int(input())
d = list(map(int, input().split()))
s = sum(d)
m = int(input())
for i in range(m):
	(k, v) = map(int, input().split())
	print(s - d[k - 1] + v)


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


n = int(input())
t = list(map(int, input().split()))
for a in range(int(input())):
	(x, y) = map(int, input().split())
	print(sum(t) + y - t[x - 1])


n = int(input())
t = tuple(map(int, input().split()))
m = int(input())
x = [list(map(int, input().split())) for _ in range(m)]
i = 0
for x[i] in x:
	l = list(t)
	j = x[i][0] - 1
	k = x[i][1]
	i += i
	l[j] = k
	print(sum(l))


import sys
input = sys.stdin.readline
import copy

def main():
	questions = []
	dp = []
	n = int(input())
	questions = list(map(int, input().split()))
	m = int(input())
	drinks = [list(map(int, input().split())) for _ in range(m)]
	for drink in drinks:
		dp = copy.deepcopy(questions)
		dp[drink[0] - 1] = drink[1]
		print(sum(dp))

def __starting_point():
	main()
__starting_point()


n = int(input())
t = list(map(int, input().split()))
sum_t = sum(t)
d = int(input())
for _ in range(d):
	(p, time) = map(int, input().split())
	print(sum_t - t[p - 1] + time)


import copy
n = int(input())
t = [int(x) for x in input().split()]
m = int(input())
p = []
for i in range(m):
	p.append([int(x) for x in input().split()])
for i in range(m):
	r = copy.copy(t)
	r[p[i][0] - 1] = p[i][1]
	print(sum(r))


N = int(input())
T = list(map(int, input().split()))
M = int(input())
for n in range(M):
	(P, X) = map(int, input().split())
	T_copied = T.copy()
	T_copied[P - 1] = X
	print(sum(T_copied))


N = int(input())
li = list(map(int, input().split()))
M = int(input())
an = sum(li)
for i in range(M):
	(p, x) = map(int, input().split())
	h = x - li[p - 1]
	print(sum(li) + h)


N = int(input())
T = [int(x) for x in input().split()]
M = int(input())
for _ in range(M):
	(P, X) = map(int, input().split())
	print(sum(T) - T[P - 1] + X)


a = int(input())
b = list(map(int, input().split()))
c = int(input())
d = []
for i in range(c):
	d.append(list(map(int, input().split())))
for i in range(c):
	f = b.copy()
	p = d[i][0] - 1
	f[p] = d[i][1]
	print(sum(f))


n = int(input())
T = tuple(map(int, input().split()))
s = sum(T)
m = int(input())
for _ in range(m):
	(p, x) = map(int, input().split())
	print(s - T[p - 1] + x)


quiznum = int(input())
timeline = input().split(' ')
timeline = [int(n) for n in timeline]
time_0 = 0
for i in range(quiznum):
	time_0 += timeline[i]
medinum = int(input())
for i in range(medinum):
	temp_line = input().split(' ')
	a = int(temp_line[0])
	b = int(temp_line[1])
	time = time_0 - timeline[a - 1] + b
	print(time)


n = int(input())
t = list(map(int, input().split()))
m = int(input())
while m:
	(p, x) = map(int, input().split())
	print(sum(t) - t[p - 1] + x)
	m -= 1


N = int(input())
T = list(map(int, input().split()))
sumT = sum(T)
for i in range(int(input())):
	(p, x) = map(int, input().split())
	print(sumT - T[p - 1] + x)


N = int(input())
T = list(map(int, input().split()))
M = int(input())
S = sum(T)
for i in range(M):
	(a, b) = map(int, input().split())
	SS = S - T[a - 1] + b
	print(SS)


n = int(input())
li = list(map(int, input().split()))
m = int(input())
c = sum(li)
for i in range(m):
	(a, b) = map(int, input().split())
	print(c - li[a - 1] + b)


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


f = lambda : map(int, input().split())
n = int(input())
l = list(f())
for _ in range(int(input())):
	(p, x) = f()
	print(sum(l) - l[p - 1] + x)


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


import sys, math
from itertools import combinations as c, product as p
from collections import deque
sys.setrecursionlimit(10 ** 9)

def si():
	return input()

def ii():
	return int(input())

def fi():
	return float(input())

def lstr():
	return input().split()

def lint():
	return list(map(int, input().split()))

def lint_dec():
	return list(map(lambda x: int(x) - 1, input().split()))

def lnstr(n):
	return [input() for _ in range(n)]

def lnint(n):
	return [int(input()) for _ in range(n)]

def lint_list(n):
	return [lint() for _ in range(n)]
N = ii()
T = lint()
M = ii()
total = sum(T)
for _ in range(M):
	(P, X) = lint()
	print(total - T[P - 1] + X)


n = int(input())
times = list(map(int, input().split()))
m = int(input())
drinks = []
for _ in range(m):
	drink = list(map(int, input().split()))
	drinks.append(drink)
for drink in drinks:
	time = 0
	copy = times.copy()
	copy[drink[0] - 1] = drink[1]
	for i in copy:
		time += i
	print(time)


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


N = int(input())
T = list(map(int, input().split()))
total = sum(T)
M = int(input())
for m in range(M):
	(p, x) = map(int, input().split())
	print(total - T[p - 1] + x)


N = int(input())
T = list(map(int, input().split()))
M = int(input())
X = []
for i in range(M):
	X.append(list(map(int, input().split())))
	X[i][0] = X[i][0] - 1
Y = []
for i in range(N):
	Y.append(T[i])
for i in range(len(X)):
	Y_copy = Y.copy()
	Y_copy[X[i][0]] = X[i][1]
	print(sum(Y_copy))


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


N = int(input())
Ts = list(map(int, input().split()))
M = int(input())
for i in range(M):
	(p, x) = map(int, input().split())
	print(sum(Ts) - Ts[p - 1] + x)


N = int(input())
L = list(map(int, input().split()))
Q = int(input())
c = sum(L)
for i in range(Q):
	(a, b) = map(int, input().split())
	print(c - (L[a - 1] - b))


N = int(input())
T = list(map(int, input().split()))
M = int(input())
U = sum(T)
for _ in range(M):
	(P, X) = map(int, input().split())
	print(U - T[P - 1] + X)


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


N = int(input())
T = list(map(int, input().split()))
for _ in [0] * int(input()):
	(p, x) = map(int, input().split())
	print(sum(T) - T[p - 1] + x)


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


l = lambda : map(int, input().split())
l()
(*T,) = l()
(*M,) = l()
S = sum(T)
for (P, X) in [l() for _ in [0] * M[0]]:
	print(S - T[P - 1] + X)


n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = [list(map(int, input().split())) for _ in range(m)]
for i in b:
	print(sum(a) - a[i[0] - 1] + i[1])


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


n = int(input())
l = [int(x) for x in input().split()]
tt = sum(l)
for _ in range(int(input())):
	(p, x) = map(int, input().split())
	print(tt - l[p - 1] + x)


n = int(input())
t = list(map(int, input().split()))
y = 0
for l in t:
	y += l
for k in range(int(input())):
	(p, x) = map(int, input().split())
	print(y - t[p - 1] + x)


n = int(input())
(*pr,) = map(int, input().split())
for i in range(int(input())):
	(n, v) = map(int, input().split())
	print(sum(pr) - pr[n - 1] + v)


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


n = int(input())
p = list(map(int, input().split()))
k = int(input())
for i in range(k):
	(a, b) = list(map(int, input().split()))
	c = p[a - 1]
	p[a - 1] = b
	print(sum(p))
	p[a - 1] = c


input()
(*t,) = map(int, input().split())
sum_t = sum(t)
for _ in range(int(input())):
	(p, x) = map(int, input().split())
	print(sum_t - t[p - 1] + x)


n = int(input())
data_1 = list(map(int, input().split()))
m = int(input())
data_2 = [input().split() for i in range(m)]
for i in range(m):
	sum = 0
	b = int(data_2[i][0]) - 1
	a = data_1[b]
	data_1[b] = int(data_2[i][1])
	for j in range(n):
		sum += data_1[j]
	print(sum)
	data_1[b] = a


input()
(*a,) = map(int, input().split())
for _ in [0] * int(input()):
	(i, x) = map(int, input().split())
	print(sum(a) - a[~-i] + x)


n = int(input())
t = list(map(int, input().split()))
m = int(input())
for i in range(m):
	c = list(map(int, input().split()))
	print(sum(t) - (t[c[0] - 1] - c[1]))


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


N = int(input())
T = list(map(int, input().split()))
M = int(input())
for m in range(M):
	(P, X) = list(map(int, input().split()))
	T_ans = T.copy()
	T_ans[P - 1] = X
	print(sum(T_ans))


n = int(input())
t_l = list(map(int, input().split()))
m = int(input())
import copy
for _ in range(m):
	(k, v) = map(int, input().split())
	tmp_t = copy.deepcopy(t_l)
	tmp_t[k - 1] = v
	print(sum(tmp_t))


_ = int(input())
T = list(map(int, input().split()))
M = int(input())
ans = sum(T)
for _ in range(M):
	(p, x) = map(int, input().split())
	print(ans - T[p - 1] + x)


N = int(input())
(*T,) = map(int, input().split())
M = int(input())
PX = [list(map(int, input().split())) for _ in [0] * M]
S = sum(T)
for (P, X) in PX:
	print(S - T[P - 1] + X)


N = int(input())
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
	(Pi, Xi) = map(int, input().split())
	a = T[Pi - 1]
	T[Pi - 1] = Xi
	b = 0
	for j in range(N):
		b = b + T[j]
	print(b)
	T[Pi - 1] = a


n = int(input())
t = [int(x) for x in input().split()]
m = int(input())
S = sum(t)
for _ in [0] * m:
	(p, x) = [int(x) for x in input().split()]
	print(S - t[p - 1] + x)


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


import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce
rr = lambda : sys.stdin.readline().rstrip()
rs = lambda : sys.stdin.readline().split()
ri = lambda : int(sys.stdin.readline())
rm = lambda : list(map(int, sys.stdin.readline().split()))
rl = lambda : list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10 ** 9 + 7
n = ri()
t = rl()
sum_ = sum(t)
m = ri()
for _ in range(m):
	(p, x) = rm()
	p -= 1
	print(sum_ - t[p] + x)


num = int(input())
times = list(map(int, input().split()))
M = int(input())
t = sum(times)
for a in range(M):
	(P, X) = map(int, input().split())
	print(t - times[P - 1] + X)


n = int(input())
q = list(map(int, input().split()))
m = int(input())
for i in range(m):
	clist = q
	(num, t) = map(int, input().split())
	print(sum(clist) - clist[num - 1] + t)


n = int(input())
t = list(map(int, input().split()))
m = int(input())
px = [list(map(int, input().split())) for _ in range(m)]
for i in px:
	print(sum(t) - t[i[0] - 1] + i[1])


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


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


a = int(input())
x = list(map(int, input().split()))
b = int(input())
for i in range(b):
	(ta, tb) = map(int, input().split())
	print(sum(x) + tb - x[ta - 1])


N = int(input())
T = list(map(int, input().split()))
S = sum(T)
for _ in range(int(input())):
	(P, X) = map(int, input().split())
	print(S + X - T[P - 1])


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


input()
T = list(map(int, input().split(' ')))
S = sum(T)
for i in range(int(input())):
	(P, X) = map(int, input().split(' '))
	print(S - T[P - 1] + X)


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


n = int(input())
a = list(map(int, input().split()))
m = int(input())
alls = sum(a)
for _ in range(m):
	(p, x) = map(int, input().split())
	print(alls + x - a[p - 1])


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


import copy
n = int(input())
T = list(map(int, input().split()))
m = int(input())
for _ in range(m):
	A = copy.copy(T)
	(a, b) = map(int, input().split())
	A[a - 1] = b
	print(sum(A))


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


n = int(input())
a = list(map(int, input().split()))
num_drink = int(input())
for i in range(num_drink):
	(P, X) = map(int, input().split())
	A = a.copy()
	A[P - 1] = X
	print(sum(A))


N = int(input())
T = [int(TN) for TN in input().split()]
SumT = sum(T)
M = int(input())
PX = [[] for TM in range(0, M)]
for TM in range(0, M):
	PX[TM] = [int(TPX) for TPX in input().split()]
for TM in range(0, M):
	print(SumT - T[PX[TM][0] - 1] + PX[TM][1])