#include using namespace std; const vector N = {"I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"}; int main() { ios::sync_with_stdio(false); cin.tie(0); string S; int T; cin >> S >> T; for (int i = 0; i < (int)N.size(); i++) { T++; if (N[i] == S) break; } cout << N[(T - 1 + 24 * 100) % 12] << '\n'; return 0; }