Code Submission Evaluation System Login

CSES Problem Set

Salaries


Task | Statistics


CSES - Salaries

Time limit:1.00 s Memory limit:512 MB

A company has $n$ employees with certain salaries. Your task is to keep track of the salaries and process queries.

Input

The first input line contains two integers $n$ and $q$: the number of employees and queries. The employees are numbered $1,2,\ldots,n$.

The next line has $n$ integers $p_1,p_2,\ldots,p_n$: each employee's salary.

After this, there are $q$ lines that describe the queries. Each line has one of the following forms: Output

Print the answer to each ? query.

Constraints
Example

Input:
5 3
3 7 2 2 5
? 2 3
! 3 6
? 2 3


Output:
3
2