import Control.Monad

main :: IO ()
main = do
    _ <- getLine
    ts <- map read . words <$> getLine
    m <- readLn
    px <- replicateM m $ map read . words <$> getLine
    forM_ px $ \[p, x] -> print $ sum ts - ts !! (p - 1) + x
