fn main() { let table = [ "XII", "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI", ]; let (s1, t) = read_line(); let cur = get_hour(s1, &table); let ans = calc(cur, t); println!("{}", table[ans as usize]); } fn calc(cur: i32, t: i32) -> i32 { ((cur + t) % 12 + 12) % 12 } fn get_hour(s1: String, table: &[&str; 12]) -> i32 { for (time, roma) in table.iter().enumerate() { if *roma == s1 { return time as i32; } } unreachable!() } fn read_line() -> (String, i32) { let mut line = String::new(); std::io::stdin().read_line(&mut line).unwrap(); let mut iter = line.split_whitespace(); ( iter.next().unwrap().to_string(), iter.next().unwrap().parse::().unwrap(), ) }