enum M{M;int i;{for(;i++<1e4;){byte[]a=(""+i).getBytes();java.util.Arrays.sort(a);String s=new String(a),t=s.replaceAll("^((00|.?)(.)|([^0]?))(\\3(.?)\\6|\\4.)$","$5$1\n");if(s!=t)System.out.print(t);}}}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).