using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Yuki { class Program { static void Main(string[] args) { //入力・宣言 string[] s = Console.ReadLine().Split(); string r = s[0]; int a = 0; int t = int.Parse(s[1]); string[] rome = { "XII", "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI" }; //ローマ数字をアラビア数字に変換 for (int i = 0; i < rome.Length; i++) { if (rome[i].Equals(r)) a = i; } //計算 a = a + t; if ((a >= 12) || (a <= -12)) a = a % 12; if (a < 0) a = 12 + a; //アラビア数字をローマ数字に変換 r = rome[a]; //出力 Console.WriteLine(r); } } }