package nowcoder;
import java.util.*;
/**
* 链接:https://ac.nowcoder.com/acm/contest/320/H
* 来源:牛客网
*
* 题目描述
* 对输入的字符串进行排序后输出
* 输入描述:
* 输入有两行,第一行n
*
* 第二行是n个空格隔开的字符串
* 输出描述:
* 输出一行排序后的字符串,空格隔开,无结尾空格
*/
public class Main_06 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
//存储需要排序的字符串
ArrayList<String> als = new ArrayList<>();
//需要排序的字符串数量
int numbers = sc.nextInt();
//将一定数量的字符串装进ArrayList
for (int i = 0; i < numbers; i++) {
als.add(sc.next());
}
//对字符串进行排序
Collections.sort(als);
//按格式遍历输出字符串(同一行)
for (int i = 0; i < als.size() - 1; i++) {
System.out.print(als.get(i)+" ");
}
System.out.print(als.get(als.size() - 1));
}
}