System.in.eachLine{{e,v->S=v.size() s=['']*S S.times{i=0 s=s.collect{v[i++]+it}.sort()} println s[0.decode(e)]}it.split()}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page