import Data.Char
import Data.List
import Control.Monad

step :: [Int] -> (Int, Int) -> Int
step ts (p,x) = sum ts - t + x
    where
        t = ts !! (p-1)

main = do
    n <- readLn :: IO Int
    ts <- map read . words <$> getLine :: IO [Int]
    m <- readLn :: IO Int
    ps <- replicateM m $ do
        [x,y] <- map read . words <$> getLine :: IO [Int]
        return (x,y)
    forM_ ps $ \px -> do
        print $ step ts px 