import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S,T = read().decode().split() roman_nums = ['XII', 'I', 'II', 'III', 'IIII', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI'] convert = {x:i for i,x in enumerate(roman_nums)} answer = roman_nums[(convert[S] + int(T)) % 12] print(answer)