100 atcoder#ABC042B. [ABC042B] 文字列大好きいろはちゃんイージー
[ABC042B] 文字列大好きいろはちゃんイージー
Score : points
Problem Statement
Iroha has a sequence of strings . The length of each string is .
She will concatenate all of the strings in some order, to produce a long string.
Among all strings that she can produce in this way, find the lexicographically smallest one.
Here, a string ... is lexicographically smaller than another string ... if and only if one of the following holds:
- There exists an index , such that for all indices s_i.
- for all integers , and $n.
Constraints
- For each , the length of equals .
- For each , consists of lowercase letters.
Input
The input is given from Standard Input in the following format:
:
Output
Print the lexicographically smallest string that Iroha can produce.
3 3
dxx
axx
cxx
axxcxxdxx
The following order should be used: axx
, cxx
, dxx
.