#arc114f. [arc114_f]Permutation Division

[arc114_f]Permutation Division

Problem Statement

You are given a permutation PP of 1,2,cdots,N1, 2, \\cdots, N.

You can divide PP into exactly KK non-empty contiguous subsequences as you like.

Maroon will rearrange those subsequences you make and concatenate them to make a new permutation QQ. Here, he will lexicographically maximize QQ.

You want to divide PP in a way that lexicographically minimizes QQ. Find QQ in that case.

Constraints

  • 1leqNleq2times1051 \\leq N \\leq 2 \\times 10^5
  • 1leqKleqN1 \\leq K \\leq N
  • 1leqPileqN1 \\leq P_i \\leq N
  • PineqPj(ineqj)P_i \\neq P_j (i \\neq j)
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN KK P1P_1 P2P_2 cdots\\cdots PNP_N

Output

Print QQ when you optimally divide PP.


Sample Input 1

3 2
1 2 3

Sample Output 1

2 3 1

You have two ways to divide PP: (1,2),(3)(1, 2),(3) and (1),(2,3)(1), (2, 3).

In the former case, Maroon will rearrange them in the order (3),(1,2)(3), (1, 2) to get Q=(3,1,2)Q = (3, 1, 2).

In the latter case, Maroon will rearrange them in the order (2,3),(1)(2, 3), (1) to get Q=(2,3,1)Q = (2, 3, 1).

Thus, you should choose the latter.


Sample Input 2

4 3
4 3 1 2

Sample Output 2

4 3 1 2

Sample Input 3

20 7
10 5 8 2 1 9 12 20 15 3 7 6 19 4 11 17 13 14 16 18

Sample Output 3

10 5 8 2 7 6 19 4 11 17 13 14 16 18 3 1 9 12 20 15