s;main(x){for(;!scanf("%d",&x);s+=x&1?:x&2?5:s?8:10)x=getchar();s=(s+x+1199)%12;write(1,"IIIIVIIIXII"+(s-8?s&-4:7),s+1-s/4*4-s/8?:2);}