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,"VIIIIXII"+(s-8?s>8?5:s<4:4),s-8?s+1-s/4*4-s/8:2);}