Problem3005--n个一位数能够组成的最大数

3005: 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">3 ,lns="http://www.w3.org/1998/Math/MathML">3 个整数为 lns="http://www.w3.org/1998/Math/MathML">1、3、9 ,那么组成的最大整数是 lns="http://www.w3.org/1998/Math/MathML">931 。

比如, 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">8620 。

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 个一位数。

Output

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

Sample Input Copy

4
7 3 4 4

Sample Output Copy

7443

Source/Category