The input contains multiple sets of test data. Each set of data first acts as two integers n and m (1<=n, m<=100000), and the second line contains n positive integers not exceeding 10^6 as the array to be queried. The following m lines each contain two integers K and V (1 <= K <= n, 1 <= V <= 10^6).
For each query, the query results are output. If it does not exist, output 0.
5 3
1 2 1 2 1
3 1
1 2
3 2
5
2
0
STL—map