Hungry Cow

아직 제출이 없습니다시간 제한6초메모리 제한1024 MB

문제

Bessie is a hungry cow. Each day, for dinner, if there is a haybale in the barn, she will eat one haybale. Farmer John does not want Bessie to starve, so some days he sends a delivery of haybales, which arrive in the morning (before dinner). In particular, on day d_id\_i, Farmer John sends a delivery of b_ib\_i haybales (1d_i10141\leq d\_i \leq 10^{14}, 0b_i1090\leq b\_i \leq 10^9).

Process UU (1U1051\le U\le 10^5) updates as follows: Given a pair (d,b)(d, b), update the number of haybales arriving on day dd to bb. After each update, output the sum of all days on which Bessie eats haybales modulo 109+710^9+7.

입력

UU, followed by UU lines containing the updates.

출력

The sum after each update modulo 109+710^9+7.