main=interact f f(a:x)=unlines[a:": "++show i|(i,c)<-zip[1..]x,a==c]++f x f x=x