def roman(n,s): roman=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"] arabic=[1000,900,500,400,100,90,50,40,10,9,5,4,1] number=[0 for i in range(n)] for i in range(n): j=0 while j=4000: print("ERROR") else: while ans_arabic>0: if ans_arabic>=arabic[m]: ans_roman+=roman[m] ans_arabic-=arabic[m] else: m+=1 print(ans_roman) n=int(input()) s=input().split() roman(n,s)