open System type Sol() = member this.Solve() = let f s = match s with | "I" -> 1 | "II" -> 2 | "III" -> 3 | "IIII" -> 4 | "V" -> 5 | "VI" -> 6 | "VII" -> 7 | "VIII" -> 8 | "IX" -> 9 | "X" -> 10 | "XI" -> 11 | "XII" -> 12 | _ -> 0 let invf = [| "XII";"I";"II";"III";"IIII";"V";"VI";"VII";"VIII";"IX";"X";"XI" |] let ans = stdin.ReadLine().Split(' ') |> (fun ss -> ( (f ss.[0]) + (int ss.[1]) + 12*10000 ) % 12) Console.WriteLine(invf.[ans]) let mySol = new Sol() mySol.Solve()