#SGM0000026. Truy vấn lương (Salary Queries)

Truy vấn lương (Salary Queries)

Salary Queries

Source: CSES

Version: Phuoc Hung OJ Extended

Problem Statement

A company has nn employees, and employee ii currently has salary pip_i. Process qq queries:

  • ! k x: change employee kk's salary to xx.
  • ? a b: count employees whose salary is in [a,b][a,b].

Input

The first line contains n,qn,q.

The second line contains p1,p2,…,pnp_1,p_2,\ldots,p_n.

The next qq lines contain the queries.

Output

For every ? query, print the required count.

Subtasks

  • Subtask 1 — 20%: 1≤n,q≤501\le n,q\le50.
  • Subtask 2 — 30%: 1≤n,q≤50001\le n,q\le5000.
  • Subtask 3 — 50%: 1≤n,q≤2⋅1051\le n,q\le2\cdot10^5, and all salary values/query bounds are in [1,109][1,10^9].

Examples

Input

5 3
3 7 2 2 5
? 2 3
! 3 6
? 2 3

Output

3
2

Explanation

The sample is processed in order; every printed item/line corresponds to an operation that requires output.