3695 - 猪猪侠的字符串
Description

猪猪侠有 n 个字符串,它们长度都相同。现在猪猪侠想对这些字符串按字典序排序,请你帮他排序并输出排序后的结果。

Input

第一行一个整数 n。
接下来 n 行,每行一个字符串,保证每个字符串的长度都相同。

Output

n 行,每行一个字符串,为排序后的结果。

Examples

Input

3
apl
apt
app

Output

apl
app
apt
Hint

直接排序即可;当 n 与串长都很大时 std::sort 单次比较代价较高,标准做法是从末位到首位做基数排序(每一维计数排序),复杂度 O(n × 串长)。

Source
51nod 3084
Tags
题目参数
Time Limit 1 second
Memory Limit 128 MB
提交次数 0
通过次数 0