import Control.Applicative
import Control.Monad

main = do
  n <- (read::String->Int) <$> getLine
  ts <- (map (read::String->Int)) . words <$> getLine
  m <- (read::String->Int) <$> getLine
  pxs <- (map ((map (read::String->Int)) . words)) . lines <$> getContents

  forM_ pxs $ \(p:x:[]) ->
    print (sum ts - (ts!!(p-1)) + x)
