The Fool comes to a cross-road, filled with energy, confidence and purpose, knowing exactly where he wants to go and what he wants to do. But he comes to a dead stop. A flowering tree marks the path he wants to take, the one he’s been planning on taking. But standing before a fruit tree marking the other path is a woman. The Fool has met and had relationships with women before, some far more beautiful and alluring. But she is different. Seeing her, he feels as though he’s just been shot in the heart with cupid’s arrow.
There are $n$ empty strings:
$s_1$, $s_2$, . . . , $s_n$.
You are required to perform two kinds of operations:
wrap $l$ $r$ $d$: change $s_i$ to $dsid$ for all l ≤ i ≤ r, where d is a digit character.
query $l$ $r$: query $\sum\limits_{i=l}^{r}$ value($s_i$) (mod $10^9$ + 7), where $value(s)$ is the number that string $s$ represents.
Note that the value of an empty string is 0.