Tin#2961

Tin

4 seconds
256 megabytes
Medium

Given an array of numbers, you are required to process types of queries:

Input

The input begins with the number (1 \le N \le 10^5), followed by an array of numbers. Next, you will receive the number of queries (1 \le M \le 10^5), followed by queries. The format of the queries can be inferred from the example provided. For all segments, it is guaranteed that 1 \le L \le R \le N. The initial numbers in the array and the numbers in the queries are integers ranging from to 10^9.

Output

For each query of type get, output the result.

Examples

Example 1

Loading
Loading