A machine prints a serial number by concatenating n fragments, each a positive integer, in some order. Choose the order that makes the resulting concatenated decimal number as small as possible, and output that number. Because every fragment is at least 1, the smallest arrangement never begins with a zero.
Compare two candidate serials as numbers; since all arrangements of the same fragments have the same total number of digits, the smaller number is also the lexicographically smaller string.
Input format
Line 1: an integer n.
Line 2: n space-separated positive integers, the fragments.
Output format
A single line: the smallest serial number formed by concatenating all fragments.
Constraints
- 1 ≤ n ≤ 8
- 1 ≤ each fragment ≤ 1000000