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