#include using namespace std; string T[12] = {"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; int main(void) { cin.tie(0); ios::sync_with_stdio(false); string s; int t; cin >> s >> t; for (int i = 0; i < 12; i++) { if (T[i] == s) { int idx = i + t; idx %= 12; if (idx < 0) { idx += 12; } cout << T[idx] << '\n'; return 0; } } return 0; }