The first line contains two integers n and m, the number of cards and the number of changes (1≤n,m≤50000).
The second line contains n integers ai, the numbers written on the cards at the start (−109≤ai≤109, ai=0).
Each of the next m lines contains two integers pi and vi, meaning that the number on the card at position pi becomes vi (1≤pi≤n, −109≤vi≤109, vi=0).
At every moment the row contains at least one card with a positive number and at least one card with a negative number. The sum of the positive numbers never exceeds 109, and the sum of the absolute values of the negative numbers never exceeds 109.