Though Rujia Liu usually sets hard problems for contests (for example, regional contests like Xi'an 2006, Beijing 2007, and Wuhan 2009, or UVa OJ contests like Rujia Liu's Presents 1 and 2), he occasionally sets easy problems (for example, 'the Coco-Cola Store' in UVa OJ), to encourage more people to solve his problems :D
Given an array, your task is to find the -th occurrence (from left to right) of an integer . To make the problem more difficult (and interesting!), you have to answer such queries.
There are several test cases. The first line of each test case contains two integers (1 \le n, m \le 100\,000), the number of elements in the array and the number of queries. The next line contains positive integers not larger than . Each of the following lines contains two integers and (1 \le k \le n, 1 \le v \le 1\,000\,000). The input is terminated by end-of-file (EOF). The size of the input file does not exceed MB.
For each query, print the -based position of the occurrence. If there is no such element, output instead.
Пример 1