logo AlgoBeat OnlineJudge
登录 注册

#212521. [INOI Team Selection 2021] String

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Mikaeel has got strings named each consists of lower-case English letters. He wants to pick a non-empty substring of each one and concatenate them together to make a final string of size . Help Mikaeel create the smallest lexicographical string possible.

输入格式

In the first line, you are given two integers and , the number of strings and the size of the final string, respectively.

The following lines contain the sequence , the strings of Mikaeel.

输出格式

In a single line, print the smallest lexicographical string achievable.

样例

样例输入 1

3 5
abc
xxx
aaa

样例输出 1

abcxa

样例输入 2

5 6
ab
bz
zb
aa
cb

样例输出 2

abbaab

数据范围与提示

Constraints

Subtasks

subtask score limits
1 23 ,
2 19 ,
3 58 No extra limits