Problem3006--n个一位数能够组成的最小数

3006: n个一位数能够组成的最小数

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

请问 lns="http://www.w3.org/1998/Math/MathML">n 个一位数能够组成的最小的 lns="http://www.w3.org/1998/Math/MathML">n 位整数是多少。

比如, lns="http://www.w3.org/1998/Math/MathML">n = lns="http://www.w3.org/1998/Math/MathML">3 , lns="http://www.w3.org/1998/Math/MathML">3 个整数为 lns="http://www.w3.org/1998/Math/MathML">3、1、9 ,那么组成的最小整数是 lns="http://www.w3.org/1998/Math/MathML">139 。 比如, lns="http://www.w3.org/1998/Math/MathML">n = lns="http://www.w3.org/1998/Math/MathML">4 , lns="http://www.w3.org/1998/Math/MathML">4 个整数为 lns="http://www.w3.org/1998/Math/MathML">2、8、0、6 ,那么组成的最小整数是 lns="http://www.w3.org/1998/Math/MathML">2068 。

Input

第一行为一个整数 lns="http://www.w3.org/1998/Math/MathML">n ( lns="http://www.w3.org/1998/Math/MathML">n \lt 10 );

第二行为 lns="http://www.w3.org/1998/Math/MathML">n 个一位数(测试数据保证 lns="http://www.w3.org/1998/Math/MathML">n 个一位数,不会出现全为 lns="http://www.w3.org/1998/Math/MathML">0 的情况)。

Output

一行,包含一个组成的最小整数。

Sample Input Copy

4
7 3 4 4

Sample Output Copy

3447

Source/Category