import Data.List

main = do
    _ <- getLine
    ts <- map read . words <$> getLine
    _ <- getLine
    pxs <- tuplify . map read . words <$> getContents
    let t = sum ts
    mapM_ print $ map (\(p,x) -> t - (ts!!(p-1) - x)) pxs

tuplify [] = []
tuplify (x:y:xs) = (x,y):tuplify xs
