Given a sequence $A_1, A_2, \ldots, A_N$ of length $N$. Write a program to handle the following queries:
1 x y v: set $A_i = (A_i + v) \% MOD$ for $x \le i \le y$.2 x y v: set $A_i = (A_i \times v) \% MOD$ for $x \le i \le y$.3 x y v: set $A_i = v$ for $x \le i \le y$.4 x y: output $(\sum_{i=x}^{y} A_i) \% MOD$ for $x \le i \le y$.
Here $MOD$ is always $10^9+7$, and $\%$ denotes the modulo operation.
Input
The first line contains the length $N$ of the sequence. ($1 \le N \le 100{,}000$)
The second line contains $A_1, A_2, \ldots, A_N$. ($1 \le A_i \le 10^9$)
The third line contains the number of queries $M$. ($1 \le M \le 100{,}000$)
The next $M$ lines each contain a query. ($1 \le x \le y \le N$, $1 \le v \le 10^9$)
Output
For each query of type $4$, output the answer on a separate line in order.
Examples
Input 1
4 1 2 3 4 4 4 1 4 1 1 3 10 2 2 4 2 4 1 4
Output 1
10 69