#C7611. Largest Formed Number

    ID: 51502 Type: Default 1000ms 256MiB

Largest Formed Number

Largest Formed Number

You are given a list of non-negative integers. Your task is to rearrange these integers such that they form the largest possible number when concatenated together. For example, given the numbers [3, 30, 34, 5, 9], the largest formed number is 9534330.

Hint: When comparing two numbers a and b, consider the two possible concatenations, i.e., \(a\,b\) and \(b\,a\). If \(a\,b > b\,a\), then a should come before b in the final arrangement.

inputFormat

The input consists of two lines. The first line contains a single integer n denoting the number of elements. The second line contains n space-separated non-negative integers.

\(1 \le n \le 10^5\), and each number is non-negative.

outputFormat

Output a single line containing the largest number that can be formed by concatenating the given integers. The output should not contain any extra leading zeros.

## sample
2
10 2
210

</p>