import Control.Monad
import Data.List
import qualified Data.Vector.Unboxed as V

main=do
    n<-readLn::IO Int
    ts<-map read.words<$>getLine::IO[Int]
    m<-readLn
    pxs<-replicateM m $ map read.words<$>getLine
    --
    let s = sum ts
    putStr.unlines $ map (show.f s (V.fromList ts)) pxs

f s ts [p,x] = s - ts V.! (p-1) + x