use std::io::*; use std::str::FromStr; #[allow(dead_code)] fn get_line() -> String { let stdin = stdin(); let mut line = String::new(); stdin.lock().read_line(&mut line).expect("io error."); line.trim().to_string() } #[allow(dead_code)] fn cast(s: &str) -> T { s.parse().ok().expect("parse error.") } #[allow(dead_code)] fn get_vec() -> Vec { (&get_line()).split(' ').map(cast::).collect() } fn main() { let time: [&str; 12] = ["I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"]; let v: Vec = get_vec(); for i in 0..12 { if &v[0] != time[i] {continue;} let now = (i as i64) + cast::(&v[1]); println!("{}", time[((now + 1200) % 12) as usize]); } }