#K76087. Largest Number

    ID: 34564 Type: Default 1000ms 256MiB

Largest Number

Largest Number

Given a list of non-negative integers, arrange them in such a way that they form the largest possible number.

For two numbers a and b (represented as strings), we say that a should come before b if and only if:

\(a+b > b+a\)

where the operator '+' denotes string concatenation. In other words, if concatenating a before b yields a larger number compared to concatenating b before a, then a should precede b in the final arrangement.

Note that if all numbers turn out to be zero, the answer should be "0" rather than something like "000...".

inputFormat

The first line of input contains a single integer n (1 ≤ n ≤ 105), representing the number of integers. The second line contains n non-negative integers separated by spaces.

outputFormat

Output a single string which is the largest number that can be formed by concatenating the given integers.

## sample
4
54 546 548 60
6054854654