import java.util.*;

public class UseComparable {
  public static void main(String[] args)
                     throws java.io.IOException {
    String[] names = { "Sue", "Bill", "Tom", "Dave", "Andy",
                       "Mary", "Beth", "Bill", "Mike" };
    TreeSet<String> ts1 = new TreeSet<>(Arrays.asList(names));
    
    for (String name : ts1) {
        System.out.println(name);
    }
  }
}