{"raw_statement":[{"iden":"problem statement","content":"We have a sequence of $N$ numbers: $A = (a_1, a_2, \\dots, a_N)$.  \nProcess the $Q$ queries explained below.\n\n*   Query $i$: You are given a pair of integers $(x_i, k_i)$. Let us look at the elements of $A$ one by one from the beginning: $a_1, a_2, \\dots$ Which element will be the $k_i$\\-th occurrence of the number $x_i$?  \n    Print the index of that element, or $-1$ if there is no such element."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq Q \\leq 2 \\times 10^5$\n*   $0 \\leq a_i \\leq 10^9$ $(1 \\leq i \\leq N)$\n*   $0 \\leq x_i \\leq 10^9$ $(1 \\leq i \\leq Q)$\n*   $1 \\leq k_i \\leq N$ $(1 \\leq i \\leq Q)$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $Q$\n$a_1$ $a_2$ $\\dots$ $a_N$\n$x_1$ $k_1$\n$x_2$ $k_2$\n$\\vdots$\n$x_Q$ $k_Q$"},{"iden":"sample input 1","content":"6 8\n1 1 2 3 1 2\n1 1\n1 2\n1 3\n1 4\n2 1\n2 2\n2 3\n4 1"},{"iden":"sample output 1","content":"1\n2\n5\n-1\n3\n6\n-1\n-1\n\n$1$ occurs in $A$ at $a_1, a_2, a_5$. Thus, the answers to Query $1$ through $4$ are $1, 2, 5, -1$ in this order."},{"iden":"sample input 2","content":"3 2\n0 1000000000 999999999\n1000000000 1\n123456789 1"},{"iden":"sample output 2","content":"2\n-1"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}