a=$<.map &:hex;print (i=1+a.sort.reverse.index(a[0])),"stndrd#{'th'*7}"[(2*~-i)%20,2]