import java.util.*;
/**
* 【字符串排序】
*
* 描述:给定 n 个字符串,请对 n 个字符串按照字典序排列。
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int nextInt = sc.nextInt();
ArrayList<String> arrayList = new ArrayList<>();
for (int i = 0; i < nextInt; i++) {
String next = sc.next();
arrayList.add(next);
}
Collections.sort(arrayList);
//arrayList.sort(String::compareTo);
for (String s : arrayList) {
System.out.println(s);
}
}
}