main = do
 getLine
 ts <- map read . words <$> getLine
 getLine
 pxs <- map (map read . words) . lines <$> getContents
 let tsum = sum ts
 mapM_ (print . drink tsum ts) pxs

drink tsum ts [p,x] = tsum + (x - ts!!(p-1))