Ohto Ai holds $$$n$$$ wonder eggs. Each of them has a priority value initially. Let's say $$$p_i$$$ is the $$$i$$$-th egg's priority value. The priority values will change since they are wonder eggs that have miraculous power. Ai has found the changing pattern.
Ai is going to observe the wonder eggs in the next $$$q$$$ moments. At each moment, one of the following events will happen:
Ai wants to check if she gets the correct sum values. So for each event of the second type, she wants you to output the sum modulo $$$M$$$.
The first line contains three integers $$$n, q, M~(1\le n, q, M \le 10^5)$$$, denoting the number of wonder eggs, the number of moments, and the modulus respectively.
The second line contains $$$n_{}$$$ integers $$$p_1, p_2, \cdots, p_n~(1\le p_i \le 10^5)$$$, denoting the initial priority value.
Following $$$q$$$ lines will be in one of the following format:
For each event of the second type, print one integer in one line, denoting the answer.
5 7 5 1 2 3 4 5 2 2 5 1 1 3 1 2 1 4 1 2 4 2 2 1 5 1 3 5 2 2 1 5
4 2 1 0