import java.util.*;

/**
 * HJ14 字符串排序
 */
public class HJ014 {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.valueOf(sc.nextLine());
        String[] array = new String[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextLine();
        }
        Arrays.sort(array);
        for (String str : array) {
            System.out.println(str);
        }
        sc.close();
    }
}