S, T = input().split() T = int(T) % 12 cand = ["XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"] print(cand[T])