s=System.in.text while(m=s=~/.+(?=: *\n)/){println m=m[0] s=s.replaceAll(/\b$m\b/,'')}