{"raw_statement":[{"iden":"problem statement","content":"We have a sequence $A$ of length $N$ consisting of integers between $1$ and $M$. Here, every integer from $1$ to $M$ appears at least once in $A$.\nAmong the length-$M$ subsequences of $A$ where each of $1, \\ldots, M$ appears once, find the lexicographically smallest one."},{"iden":"constraints","content":"*   $1 \\leq M \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq A_i \\leq M$\n*   Every integer between $1$ and $M$, inclusive, appears at least once in $A$.\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$\n$A_1$ $A_2$ $\\ldots$ $A_N$"},{"iden":"sample input 1","content":"4 3\n2 3 1 3"},{"iden":"sample output 1","content":"2 1 3\n\nThe length-$3$ subsequences of $A$ where each of $1, 2, 3$ appears once are $(2, 3, 1)$ and $(2, 1, 3)$. The lexicographically smaller among them is $(2, 1, 3)$."},{"iden":"sample input 2","content":"4 4\n2 3 1 4"},{"iden":"sample output 2","content":"2 3 1 4"},{"iden":"sample input 3","content":"20 10\n6 3 8 5 8 10 9 3 6 1 8 3 3 7 4 7 2 7 8 5"},{"iden":"sample output 3","content":"3 5 8 10 9 6 1 4 2 7"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}