Once Gustave is happy with the final string he gets, he contacts a company to have the string printed on a strip of fabric. Being meticulous, Gustave does not want the company to make a single mistake. He thus computes a checksum out of his string and has the company do the same computation as a verification.
The input consists of the following lines:
*Limits*
The output should consist of a single line, whose content is an integer, the sum of all ASCII codes of the characters of the final string $S (N -1)$ , modulo $1000000007$.
## Input
The input consists of the following lines: The first line contains an integer $N$. The next line contains a string $S (0)$ of lowercase alphabetic characters between 'a' and 'z'. The next $N -1$ lines contain instructions to build strings $S (1), \\dots, S (N -1)$ . The instruction to build string $S (i)$ is either: "SUB $x$ $l o$ $h i$" with $x$, $l o$, $h i$ integers such that $0 <= x < i$ and $0 <= l o <= h i <= l e n g t h (S (x)$), or "APP $x$ $y$" with $x$, $y$ integers such that $0 <= x, y < i$. Instruction "SUB $x$ $l o$ $h i$" means that $S (i)$ is formed using (a copy of) characters of $S (x)$ from index $l o$ (inclusive) to $h i$ (exclusive). Characters are numbered starting from 0. Instruction "APP $x$ $y$" means that $S (i)$ is formed by concatenating copies of strings $S (x)$ and $S (y)$ in that order, i.e., with $S (x)$ coming first then $S (y)$ . *Limits* $1 <= N <= 2500$; $1 <= l e n g t h (S (0)) <= 1000$; the length of any string $S (i)$ will never exceed $2^(63) -1$.
## Output
The output should consist of a single line, whose content is an integer, the sum of all ASCII codes of the characters of the final string $S (N -1)$ , modulo $1000000007$.
[samples]