Shil likes to perform Crazy Operation on an array A1,A2,...AN.
Given an array A1,A2,...AN and permutation P1,P2, ..,PN, a Crazy Operation consists of two parts:
Perform Operation Bi = Ai for every i in 1..N
Perform Operation Ai = BPi for every i in 1..N. Here P is a permutation from 1 to N.
Shil asks you to print the resulting array A1, A2,...AN after doing Crazy Operation on it , T times.
Input format:
The first line of input consists of two integers N and T. The next line consists of N integers A1, A2,...AN. The next line consists of permutation P1,P2,...PN.
Output format:
Print the resulting A1,A2,...AN after doing Crazy operations on it T times.
Constraints:
1≤N≤105
1≤T≤1018
1≤Ai≤109
On doing Crazy Operation 1st time resulting array will be (3,4,5,2,1).
On doing second time , resulting array will be (5,2,1,4,3).
On doing third time, resulting array will be (1,4,3,2,5).