12142 - Ugandan Knuckles's adventure   

Description

After Knuckles escaped from the dungeon he faced on another difficulty. He meet an elder who claimed that he knew where to find the queen. As long as Knuckles solve the question.


The elder will give Knuckles n integers, and Knuckles can make a big integer by appending those integers after one another

 

For example:

If n = 3, Knuckles have three integers: "71", "87", "22". Following integers can be made:

"718722", "227187", "877122", "228771".......

In this example, 6 such integers can be made. Knuckles  need to find the biggest integer.  In this example, the answer will be "877122".

 

Help Knuckles find the biggest integer he can make.

 

Input

 

The input will end by EOF.

Each input contains several lines.

First line contains an integer n(1 <= n <= 100).

The following n lines, each line contains an interger ai(1 <= ai <=10999)

Each testcase contains at most 10 input.

 

Output

 

For each input, print the biggest integer you can make

remember to print \n after each output

Sample Input  Download

Sample Output  Download

Tags




Discuss