import Data.Array

main = interact $ put . sol . get

get = map (map read . words) . lines

put = unlines . map show

sol ([n]:ts:_:px) = map (\[p,x] -> s+x-t!p) px
  where
  s = sum ts
  t = listArray (1,n) ts