Problem: Problem Statement
As they say, small is cute and beautiful.

Given N distinct positive integers, find the smallest number that can be formed by concatenating all of them.
Input Format
The first line of the input file contains a positive integer N. Then N lines follow.
Each line contains a single positive integer K.

Output Format
Output the smallest possible number that can be formed by concatenating all the numbers.

Constraints
1 ≤ N ≤ 5000
1 ≤ K ≤ 10^15

SAMPLE INPUT
5
14
66
907
1234567890
9876543210

SAMPLE OUTPUT
123456789014669079876543210

Solution (in PYTHON):

Solution:
def cmp2(x,y):
	if len(x)==len(y):
		return cmp(x,y)
	m=min(len(x),len(y))
	if cmp(x[:m],y[:m]):
		return cmp(x,y)
	
	if len(x)>len(y):
		return cmp(x[len(y):],y)
	return 	cmp(x,y[len(x):])
x=sorted([raw_input().strip() for x in range(input())],cmp2)

print "".join(x)