import java.util.*; class No405{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int t = 0; String[] S1List = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; int[] TList = {1,2,3,4,5,6,7,8,9,10,11,12}; String S1 = sc.next(); int T = sc.nextInt(); for(int i=0; i=0){ if(add<=12){ System.out.println(S1List[add-1]); }else{ while(add>12){ add -= 12; } System.out.println(S1List[add-1]); } }else{ while(add<0){ add += 12; } System.out.println(S1List[add-1]); } } }