x,s;main(c){for(;!scanf("%d",&x);s+=c&1?:c&2?5:s?8:10)c=getchar();for(s=(s+x+1199)%12+1;s;s-9?putchar(s>9?s-=10,88:s-->4?s-=4,86:73):puts("IX"));}