main=interact$f.lines f l=do x<-l;[p x|p<-map take[1..],[x]==[y|y<-l,p x==p y]]!!0++"\n"
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page