{"raw_statement":[{"iden":"statement","content":"**Note: The time limit for this problem is 6s, three times the default. The memory limit for this problem is 512MB, twice the default.** \n\nBessie 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_i$, Farmer John sends a delivery of $b_i$ haybales $(1 \\le d_i \\le 10^{14}, 0 \\le b_i \\le 10^9)$.\n\nProcess $U(1 \\le U \\le 10^5)$ updates as follows: Given a pair $(d,b)$, update the number of haybales arriving on day $d$ to $b$. After each update, output the sum of all days on which Bessie eats haybales modulo $10^9+7$. "},{"iden":"input","content":"$U$, followed by $U$ lines containing the updates. "},{"iden":"output","content":"The sum after each update modulo $10^9+7$. "},{"iden":"note","content":"### Explanation for Sample 1\n\nAnswers after each update:\n\n$4+5+6=15$  \n$1+2+3+4+5+6+7+8=36$  \n$1+2+4+5+6=18$\n\n### SCORING\n\n - Input $3$: $U \\le 5000$\n - Inputs $4-10$: Updates only increase the number of haybales arriving on day $d$.\n - Inputs 11-22: No additional constraints."}],"translated_statement":null,"sample_group":[["3\n4 3\n1 5\n1 2","15\n36\n18"],["9\n1 89\n30 7\n101 26\n1 24\n5 1\n60 4\n5 10\n101 0\n1 200","4005\n4656\n7607\n3482\n3507\n3753\n4058\n1107\n24531"]],"show_order":[],"formal_statement":null,"simple_statement":null,"has_page_source":false}