while 1:f=raw_input()+'\n';d=f[:6].count('d ');print f[d*2:]*-~d,