Problems
Beautiful Permutation
Beautiful Permutation
Consider a permutation of integer numbers from \textbf{1} to \textbf{n}. Let us call length of the longest monotonic subsequence of the permutation its \textit{ugliness}.
For example, the ugliness of the permutation <\textbf{1}, \textbf{2}, \textbf{5}, \textbf{3}, \textbf{4}> is \textbf{4} because it has a monotonic subsequence (\textbf{1}, \textbf{2}, \textbf{3},\textbf{4}) of length \textbf{4}, but has none of length \textbf{5}. The ugliness of the permutation <\textbf{5}, \textbf{6}, \textbf{3}, \textbf{4}, \textbf{1}, \textbf{2}> is \textbf{3} because it has a monotonic subsequence (\textbf{5}, \textbf{3}, \textbf{1}) of length \textbf{3}.
Let us call \textit{beautiful} those permutations that have a smallest possible ugliness for given \textbf{n}. Given \textbf{n}, you must find the first in lexicographic order beautiful permutation of size \textbf{n}.
\InputFile
Input file contains \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{10000}).
\OutputFile
Output the first in lexicographic order beautiful permutation of size \textbf{n}.
Input example #1
1
Output example #1
1