import java.util.*;
import java.io.*;
public class SortStrings {
  
  
  public static void main(String[] args) throws Exception { 
    final int MAX_SIZE = 20;
    
    Scanner input = new Scanner(new File("input.txt"));
    
    String[] words = new String[MAX_SIZE];
    
    int numElements = readData(input, words, MAX_SIZE);
    
    sort(words, numElements);
    
    PrintWriter output = new PrintWriter(new File("output.txt"));
    
    printToOutput(output, words, numElements);
    output.close();
  }
  
  public static int readData(Scanner input, String[] words, int max) {
    
   int count=0;
   
   while(count<max && input.hasNextLine()) {
     words[count] = input.nextLine();
     count++;
   }
   
   return count;
  }
  
  public static void sort(String[] words, int n) {
    
    for(int i=0; i<n-1; i++) {
      int minIndex = findMinIndex(words, i, n);
      swap(words, i, minIndex);
    }
  }
  
  public static int findMinIndex(String[] words, int start, int n) {
    int index = start;
    
    for(int i=start+1; i<n; i++) {
      if(words[i].compareTo(words[index]) < 0) {
        index = i;
      }
    }
    
    return index;
  }
  
  public static void swap(String[] words, int i, int j) {
    String temp = words[i];
    words[i] = words[j];
    words[j] = temp;
  }
  
  public static void printToOutput(PrintWriter writer, String[] words, int n) {
    for(int i=0; i<n; i++) {
      writer.println(words[i]);
    }
  }
}
