import java.util.*;
import javax.swing.JOptionPane;

public class Gezegensirasi {
  static class InsensitiveComp implements Comparator {
    public int compare (Object a1, Object a2) {
      String s1 = a1.toString().toLowerCase();
      String s2 = a2.toString().toLowerCase();
      return s1.compareTo (s2);
    }
  }
  public static void main (String args[]) {
    String names[] = {"Mercür", "Venüs", "Dünya",
      "Mars", "Jüpiter", "Satürn", "Uranüs",
      "Neptün", "Pluto",
      "mercür", "venüs", "dünya",
      "mars", "jüpiter", "satürn", "uranüs",
      "neptün", "pluto"
    };
    Arrays.sort(names);
    int namesLen = names.length;
    String ss="";
    for (int i=0; i<namesLen; i++) {
      ss+=names[i] + " ";
    }
    ss+="\n";
    Arrays.sort(names, new InsensitiveComp());
    for (int i=0; i<namesLen; i++) {
      ss+=names[i] + " ";
    }
    ss+="\n";
    JOptionPane.showMessageDialog(null,ss);
    System.exit(0);
  }
}
