G. No story, No ACs, Many WAs, just an unsolvable problem
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

I've run out of stories, so here is the problem directly. You are given an integer $$$n$$$ and $$$n$$$ strings $$$$$$s_1, s_2, \ldots, s_n.$$$$$$ You may reorder the strings in any way and concatenate them into a single string. Your task is to determine an order of the strings such that the resulting concatenated string is lexicographically smallest.

A string $$$x$$$ is lexicographically smaller than a string $$$y$$$ if, at the first position where they differ, the character in $$$x$$$ comes earlier in the alphabet than the character in $$$y$$$. If one string is a prefix of the other, the shorter string is considered smaller.

Input

The first line contains an integer $$$n$$$ $$$(1 \le n \le 5 \times 10^4)$$$. Each of the next $$$n$$$ lines contains one string $$$s_i$$$ consisting of lowercase English letters, where $$$(1 \le |s_i| \le 50)$$$. The total length of all strings does not exceed $$$5 \times 10^4$$$.

Output

Output the lexicographically smallest possible concatenation of all strings.

Examples
Input
3
fcds
alex
icpc
Output
alexfcdsicpc
Input
6
a
ab
aba
b
ba
bb
Output
aabaabbabbb