// #define _GLIBCXX_DEBUG #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { // Input string S1; int T; cin >> S1 >> T; // Make List map hour = { {"I", 1}, {"II", 2}, {"III", 3}, {"IIII", 4}, {"V", 5}, {"VI", 6}, {"VII", 7}, {"VIII", 8}, {"IX", 9}, {"X", 10},{"XI", 11}, {"XII", 12} }; map deHour; for (const auto& [t, h] : hour) deHour[h] = t; // Output int ans = ((hour[S1] + T) % 12 + 12) % 12; cout << deHour[ans] << endl; }