import Control.Monad

solve :: Int -> Int -> [Int] -> Int
solve n m xs = sum xs - xs!!(n-1) + m

main = do
  _ <- getLine
  xs <- map (read::String->Int) . words <$> getLine
  n <- read <$> getLine
  replicateM n $ do 
    [p, x] <- map (read::String->Int) . words <$> getLine
    putStrLn . show $ solve p x xs