#include<iostream>
#include<cstdio>
#include<ctime>
#include<cmath>

using namespace std;
char r[10];
int main(){
    cin >> r;
    for(int i=0; i<9; i++){
            if (r[i]=='V') if(r[i+1]=='I' && r[i+2]!='I') {
                           swap(r[i], r[i+1]);
                           i=-1;
                           }
            if (r[i]=='L') if(r[i+1]=='X' && r[i+2]!='X') {
                           swap(r[i], r[i+1]);
                           i=-1;
                           }
            if (r[i]=='X') if(r[i+1]=='I' && (r[i+2]!='I' && r[i+2]!='V' && r[i+2]!='X')){
                           swap(r[i], r[i+1]);
                           i=-1;
                           }
            }
            
    
             
             
             
    cout << r << endl;
                              

    

//system("pause");
return 0;
}
