import java.util.*;enum o{o;System s;int n;{for(Scanner i=new Scanner(s.in);i==i;s.out.println(n+(n%100>9&n%100<20?"th":n%10==1?"st":n%10==2?"nd":n%10==3?"rd":"th")))n=i.nextInt();}}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).