#d11407. 抽卡
抽卡
Gacha
Problem Source
Problem Description
There are cards, each with a string on it. Now you must select of these cards so that, among all selection schemes, concatenating the cards gives a string with the lexicographically smallest value (see samples for details).
Input Format
The first line contains two integers ().
The next lines each contain a string ().
Output Format
Output one string: the lexicographically smallest string among all schemes that select cards.
Sample Input 1
4 3
ode
zaaa
r
atc
Sample Output 1
atcoder
Sample Input 2
5 2
z
z
zzz
z
zzzzzz
Sample Output 2
zz