803. Unlock

0

Medium

Shekhar, a specialist in bomb defusal, is faced with a unique challenge. He must defuse a bomb by entering a secret code. Given a number N and a number K, as well as a permutation of the first N natural numbers, Shekhar must determine the largest possible permutation that can be achieved by performing at most K swaps between pairs of numbers in the given permutation. Help Shekhar find the final permutation.

Input Format

The input begins with a line containing two integers: N and K. The next line consists of N space-separated integers representing the given permutation.

Output Format

The output should be the final permutation of the 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
Loading...

View Submissions

Console