7420: ABC277 —— A - ^{-1}
[Creator : ]
Description
You are given a sequence P that is a permutation of (1,2,…,N), and an integer X. The i-th term of P has a value of $P_i$.
Print k such that $P_k = X$.
Print k such that $P_k = X$.
Input
The input is given from Standard Input in the following format:
$N\ X$
$P_1\ P_2\ \ldots\ P_N$
$N\ X$
$P_1\ P_2\ \ldots\ P_N$
Output
Print the answer.
Constraints
1≤N≤100
$1 \leq X \leq N$
P is a permutation of (1,2,…,N).
All values in the input are integers.
$1 \leq X \leq N$
P is a permutation of (1,2,…,N).
All values in the input are integers.
Sample 1 Input
4 3
2 3 1 4
Sample 1 Output
2
We have P = (2,3,1,4), so $P_2 = 3$. Thus, you should print 2.
Sample 2 Input
5 2
3 5 1 4 2
Sample 2 Output
5
Sample 3 Input
6 6
1 2 3 4 5 6
Sample 3 Output
6