import java.util.Arrays; import java.util.Scanner; public class BookShelf2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.nextLine(); String[] a = new String[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextLine(); } Arrays.sort(a); for (String s : a) { System.out.println(s); } sc.close(); } }