A company has N employees numbered from 1 to N.
Employee 1 is the CEO.
For every employee i (2 ≤ i ≤ N), you are given their direct manager.
The hierarchy forms a rooted tree.
You have to answer Q independent queries.
Each query contains two integers:
X — an employee. K — number of levels to move upward.
Return the employee that is exactly K levels above X.
If such an employee does not exist, print -1.
Input
The first line contains
N Q
The second line contains N−1 integers
P2 P3 ... PN
where Pi is the direct manager of employee i.
Each of the next Q lines contains
X K Output
For every query print the answer on a new line.

1 ≤ N, Q ≤ 2 × 10^5 1 ≤ Pi < i 1 ≤ X ≤ N 1 ≤ K ≤ N