410. Unlock

0

Medium

Shekhar, a specialist in bomb defusal, is faced with a unique challenge. He must defuse a bomb that can only be disarmed by entering a secret code. Shekhar is given two numbers, N and K, along with a permutation of the first N natural numbers. The secret code is determined by performing a maximum of K swaps between pairs of numbers in the given permutation. Help Shekhar find the final permutation that will disarm the bomb.

Input Format

The first line of input consists of two integers, N and K, separated by a space. The second line contains N space-separated integers representing the given permutation.

Output Format

Output the final permutation of numbers, with each number separated by a space.

Example

Input

5 2
3 4 1 2 5

Output

5 4 3 2 1

Constraints

1 <= n <= 10^5

1<= K <= 10^9

1<= K <= 10^9

Loading...

View Submissions

Console