main@m=getLine>>=print.h>>m h l=f[n|c<-l,(d,n)<-zip"IVXLCDM"a,c==d];a=1:5:map(*10)a f(x:y:z)|x