#K81392. Smallest Integer with N Swaps

    ID: 35743 Type: Default 1000ms 256MiB

Smallest Integer with N Swaps

Smallest Integer with N Swaps

Given a positive integer \(n\), your task is to compute the smallest positive integer which requires exactly \(n\) swaps to sort its digits in ascending order.

For \(n \ge 2\), the answer is formed by concatenating \(1\), followed by \(n-1\) zeros, and ending with \(2\). That is, the answer can be represented in LaTeX as \(1\,0^{n-1}\,2\). For \(n = 1\), the answer is \(21\). You need to output the computed integer.

Note: The swap operation here is defined on the digits such that it takes exactly \(n\) swaps to arrange the digits in non-decreasing (ascending) order.

inputFormat

The input consists of a single integer \(n\) (\(n \geq 1\)) given via standard input.

outputFormat

Output a single line containing the smallest positive integer that requires exactly \(n\) swaps to be sorted in ascending order. The output should be printed to standard output.

## sample
1
21

</p>