import sys t=u"II III IV V VI VII VIII IX I".split(" ")*6 t+=u"D_L_CX_M"*4 for n in range(1001): r=u"" for d in"%d\n"%n:r=r.translate(t)+d print r,