import Control.Applicative ((<$>), (<*>), (<*), (*>), (<$))
import Control.Monad
import Data.List

main :: IO ()
main = do
  n <- getl read
  ts <- getl $ map read . words
  m <- getl read
  pxs <- replicateM m (getl $ map read . words)
  mapM_ print $ solve n ts pxs

solve :: Int -> [Int] -> [[Int]] -> [Int]
solve n ts pxs = map f pxs
  where
    s = sum ts
    f [p, x] = s - (ts !! (p-1)) + x

getl :: (String -> a) -> IO a
getl f = f <$> getLine
