import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
    getLine
    ts <- fmap read . words <$> getLine
    let sumts = sum ts
    m <- readLn
    ps <- replicateM m $ do
        [p, x] <- fmap read . words <$> getLine
        return (p, x)

    forM_ ps $ \(p, x) -> do
        let d = x - (ts !! (p - 1))
        print $ sumts + d