beecrowd | 1644
# Decode the Strings

**Timelimit: 1**

Local Contest, University of Ulm Germany

Bruce Force has had an interesting idea how to encode strings. The following is the description of how the encoding is done:

Let x_{1},x_{2},...,x_{n} be the sequence of characters of the string to be encoded.

- Choose an integer M and N pairwise distinct numbers p
_{1},p_{2},...,p_{n}from the set {1, 2, ..., N} (a permutation of the numbers 1 to N). - Repeat the following step m times.
- For 1 ≤ i ≤ N set y
_{i}to x_{pi}, and then for 1 ≤ i ≤ N replace x_{i}by y_{i}.

For example, when we want to encode the string "hello", and we choose the value M = 3 and the permutation 2, 3, 1, 5, 4, the data would be encoded in 3 steps: "hello" -> "elhol" -> "lhelo" -> "helol".

Bruce gives you the encoded strings, and the numbers M and p_{1}, ..., p_{n} used to encode these strings. He claims that because he used huge numbers m for encoding, you will need a lot of time to decode the strings. Can you disprove this claim by quickly decoding the strings?

The input contains several test cases. Each test case starts with a line containing two numbers **N** and **M** (1 ≤ **N** ≤ 80, 1 ≤ **M** ≤ 10^{9}). The following line consists of **N** pairwise different numbers p_{1},...,p_{n} (1 ≤ **p _{i}** ≤

For each test case, print one line with the decoded string.

Sample Input | Sample Output |

5 3 |
hello |