Given an array of integers, initially filled with zeroes. There are two types of operations:
! i x: Assign value to cell .
? l r: Find the sum of numbers on the segment [l, r].
The first line contains the size of the array and the number of queries (1 \le n \le 10^9 + 7, 1 \le m \le 2 \times 10^5). Then queries are given, one per line.
During program execution, maintain two numbers and . Initially, P = 91, Q = 47.
A query of the form ! A B means that you must assign the value (B + Q) \bmod (10^9 + 7) to the cell (A + P) \bmod n.
A query of the form ? A B means you must find the sum of elements from (A + P) \bmod n to (B + Q) \bmod n inclusive. Let the answer be . Then, update the values and as follows:
Elements are numbered starting from zero.
All input numbers do not exceed 10^9 + 7.
For each sum query, print the answer on a separate line.
1-nji mysal
2-nji mysal