Germán is new to writing programming problems. To get started, he decided to create a simple one (this is the very first problem he has written).
You are given a list of numbers $$$B$$$ of length $$$N$$$, and $$$K$$$ operations that can be of any of the following three types:
Your task is to process all the given operations.
The first line of input contains two integers $$$N$$$ and $$$K$$$ $$$(1 \leq N, K \leq 10^{5})$$$, the size of $$$B$$$ and the number of operations respectively.
In the second line $$$N$$$ integer numbers $$$B_i$$$ $$$(1 \leq B_i \leq 10000)$$$ separated by a space.
Each of the next $$$K$$$ lines contains a single operation in the form: $$$C$$$ $$$l$$$ $$$r$$$, where $$$C$$$ is a character denoting the type of operation (Q, A, or R), and $$$l$$$ and $$$r$$$ $$$(1 \leq l \leq r \leq N)$$$ define the range on which the operation is to be performed.
For every operation of type Q, print a line with the result of the query.
10 101 2 3 4 5 6 7 8 9 10Q 1 10R 1 10A 1 10Q 1 10R 1 7Q 5 10R 7 10Q 6 10A 6 10Q 1 6
10 10 10 9 8