#include using namespace std; const int maxn=105; int n,ans; string s; string to(int num) { vector> ys={ {1000,"M"},{900,"CM"},{500,"D"},{400,"CD"}, {100, "C"},{90, "XC"},{50, "L"},{40,"XL"}, {10, "X"},{9, "IX"},{5, "V"},{4, "IV"}, {1, "I"} }; string ret=""; for(const pair p:ys){ while(num>=p.first) num-=p.first,ret+=p.second; } return ret; } int main(){ // freopen("roman.in","r",stdin); // freopen("roman.out","w",stdout); cin>>n; for(int u=1;u<=n;u++){ cin>>s; int num=0; for(int i=0;i=4000){ puts("ERROR"); return 0; } cout<