CF632C The Smallest String Concatenation

Description

You're given a list of $ n $ strings $ a_{1},a_{2},\cdots,a_{n} $. You'd like to concatenate them together in some order such that the resulting string would be lexicographically smallest. Given the list of strings, output the lexicographically smallest concatenation.

Input Format

The first line contains integer $ n $ — the number of strings ( $ 1\leq n\leq 5\cdot 10^{4} $ ). Each of the next $ n $ lines contains one string $ a_{i} $ ( $ 1\leq|a_{i}|\leq50 $ ) consisting of only lowercase English letters. The sum of string lengths will not exceed $ 5\cdot 10^{4} $.

Output Format

Print the only string $ a $ — the lexicographically smallest string concatenation.