for(s in readLines('stdin'))write(gsub('\\G(d )(?=\\1*(.*))','\\2 ',s,,,T),'')