-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU roman = ["I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"] main = putStrLn . solve . words =<< getLine solve [t, a] = ans where h = length $ takeWhile (/= t) roman x = (`mod` 12) $ h + 2400 + read a ans = roman !! x