#include using longlong=long long; int main(){ std::cin.tie(nullptr);std::cin.sync_with_stdio(false); std::vectora{"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; std::string s;std::cin>>s; int x=std::find(a.begin(),a.end(),s)-a.begin(); int y;std::cin>>y; std::cout<<(a.at((x+y+12*y)%12))<