SP4487 GSS6 - Can you answer these queries VI

Description

Given a sequence A of N _(N

Input Format

The first line of the input contains an integer N. The following line contains N integers, representing the starting sequence A1..AN, _(|Ai|

Output Format

For each **"Q"** operation, print an integer(one per line) as described above.