#include #include #include using namespace std; typedef long long int ll; string st[]={"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); string t; cin >> t; int n; cin >> n; int now=-1; for(int i=0;i<12;i++){ if(t==st[i])now=i; } now=(now+n+12*100000)%12; cout << st[now] << endl; }