L = ["I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"] s1, t = input().split() print(L[(L.index(s1) + int(t)) % 12])