#include using namespace std; typedef long long ll; int main() { string a[12] = {"XII", "I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; map m; for (int i = 0; i < 12; ++i) { m[a[i]] = i; } string cur; int t; cin >> cur >> t; int n = (m[cur] + t) % 12; cout << (n >= 0? a[n]: a[12 + n]) << '\n'; return 0; }