#include #include #include #include #include #include #include #include #include #include #include #include #include #define repd(i,a,b) for (int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repd(i,0,n) #define all(x) (x).begin(),(x).end() #define mod 1000000007 #define inf 2000000007 #define mp make_pair #define pb push_back typedef long long ll; using namespace std; template inline void output(T a, int p) { if(p) cout << fixed << setprecision(p) << a << "\n"; else cout << a << "\n"; } // end of template string a[12] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; int main() { cin.tie(0); ios::sync_with_stdio(0); // source code string s; int t; cin >> s >> t; int ind = -1; rep(i, 12){ if(s == a[i]) ind = i; } ind += t; ((ind %= 12) += 12) %= 12; output(a[ind], 0); return 0; }