#00007F

najmanji

A row of numbers has been given: a[1] , a[2] , ..., a[n] . By concatenating, we assume that the number xy is derived by adding figures of the number y after number x (e.g. concatenating the numbers 123 and 45 gives the number 12345). We get the big number by adding the numbers one after the other in some order. Give the smallest number that is derived by concatenating all the numbers a[1] , a[2] , ...,a[n] .


InputThe first line of the standard input contains an integer n (2<n<5000). In the next n lines are the numbers a[1] , a[2] , ..., a[n] (1<a[i] <2000000000). The numbers are given without starting zeros.

OutputIn the first line of the standart output write the smallest number that is derived by concatenating the given numbers.

Input:
2
91919
919191

Output:
91919191919


Input:
5
32
11
987
12
3

Output:
1112323987
Explanation:
The smallest number is derived by concatenating the numbers 11, 12, 32, 3, 987.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.