import std.cstream,std.string;void main(){auto s=split(tr(tolower(din.toString)," a-z","","cd")~" ~");int n;foreach(t;s.sort)*s<t?dout.writefln(n," ",*s),*s=t,n=1:n++;}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).