using System; using System.Linq; using System.Collections.Generic; using System.Text.RegularExpressions; class Program { static void Main() { /* * S1 : 短針の位置 * T : T時間後 */ var S1T = Console.ReadLine().Split(); var currentTimeRoman = S1T[0]; var elapsedTime = int.Parse(S1T[1]); var currentTimeNum= ConvertCurrentTime(currentTimeRoman); var _ans = (currentTimeNum + elapsedTime) % 24; var ans = ConvertRomanNum(_ans); Console.WriteLine(ans); } public static int ConvertCurrentTime(string str) { var converCurrentTime = str switch { "I" => 1, "II" => 2, "III" => 3, "IIII" => 4, "V" => 5, "VI" => 6, "VII" => 7, "VIII" => 8, "IX" => 9, "X" => 10, "XI" => 11, "XII" => 12 }; return converCurrentTime; } public static string ConvertRomanNum(int num) { var convertRomanNum = num switch { 1 => "I", 2 => "II", 3 => "III", 4 => "IIII", 5 => "V", 6 => "VI", 7 => "VII", 8 => "VIII", 9 => "IX", 10 => "X", 11 => "XI", 12 => "XII", 13 => "I", 14 => "II", 15 => "III", 16 => "IIII", 17 => "V", 18 => "VI", 19 => "VII", 20 => "VIII", 21 => "IX", 22 => "X", 23 => "XI", 24 => "XII" }; return convertRomanNum; } }