# Read input s1, t = input().split() t = int(t) # List of Roman numerals in order from 1 to 12 o'clock romans = ['I', 'II', 'III', 'IIII', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII'] # Find current index of S1 current_index = romans.index(s1) # Calculate new index with modulo 12 to handle cyclicity new_index = (current_index + t) % 12 # Output the corresponding Roman numeral print(romans[new_index])