#include #include using namespace std; string tick[12] = {"XII", "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI"}; int main() { string s; int t; cin >> s >> t; t += 12 * 1000; t %= 12; for (int i = 0; i < 12; i++) { if (s == tick[i]) { cout << tick[(i + t) % 12] << endl; break; } } return 0; }