{"raw_statement":[{"iden":"problem statement","content":"You are given a permutation $P$ of $1, 2, \\cdots, N$.\nYou can divide $P$ into exactly $K$ non-empty contiguous subsequences as you like.\nMaroon will rearrange those subsequences you make and concatenate them to make a new permutation $Q$. Here, he will lexicographically maximize $Q$.\nYou want to divide $P$ in a way that lexicographically minimizes $Q$. Find $Q$ in that case."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq K \\leq N$\n*   $1 \\leq P_i \\leq N$\n*   $P_i \\neq P_j (i \\neq j)$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$\n$P_1$ $P_2$ $\\cdots$ $P_N$"},{"iden":"sample input 1","content":"3 2\n1 2 3"},{"iden":"sample output 1","content":"2 3 1\n\nYou have two ways to divide $P$: $(1, 2),(3)$ and $(1), (2, 3)$.\nIn the former case, Maroon will rearrange them in the order $(3), (1, 2)$ to get $Q = (3, 1, 2)$.\nIn the latter case, Maroon will rearrange them in the order $(2, 3), (1)$ to get $Q = (2, 3, 1)$.\nThus, you should choose the latter."},{"iden":"sample input 2","content":"4 3\n4 3 1 2"},{"iden":"sample output 2","content":"4 3 1 2"},{"iden":"sample input 3","content":"20 7\n10 5 8 2 1 9 12 20 15 3 7 6 19 4 11 17 13 14 16 18"},{"iden":"sample output 3","content":"10 5 8 2 7 6 19 4 11 17 13 14 16 18 3 1 9 12 20 15"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}