t='' c=1 exec"o=''\nfor i in t+' ':C=i!=o;t=t[1:]+C*('IIIV'[18%c:c]+o);c+=1-C*c;o=i\nprint t;"*20