#include #include #include typedef long long ll; int main(void) { std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(3); std::vector< std::string > rom = {"", "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"}; std::string s1; int t; std::cin >> s1 >> t; int n; for (int i = 1; i <= 12; ++i) { if (s1 == rom[i]) n = i; } while (t < 0) t+=12; n += t; n %= 12; if (n==0) n = 12; std::cout << rom[n] << std::endl; return 0; }