program contest_with_drinks_easy
  implicit none
  integer :: n, m, t(100), p, x, i, s
  t = 0
  read(*,*) n
  read(*,*) t(1:n)
  read(*,*) m
  s = sum(t(1:n))
  do i = 1, m
    read(*,*) p, x
    write(*,'(i0)') s-t(p)+x
  end do
  stop
end program contest_with_drinks_easy