import java.util.*;

public class Alpha {

  public static void main(String[] args) {
 
    Scanner stdin = new Scanner(System.in);
    System.out.println("Enter the first word.");
    String first = stdin.next(); 

    for (int i=0; i<9; i++) {

      System.out.println("Enter the next word.");
      String temp = stdin.next();

      if (temp.compareTo(first) < 0)
        first = temp;

    }
    System.out.println("The first word is "+first);
  }
}
