#include<bits/stdc++.h>
using namespace std;

map<char,int> mp;
char solve[3]={'Z', 'O', 'J'};

int main()
{
    string str;
    while( cin>>str )
    {
        mp.clear();
        for(char c: str )
        {
            mp[c]++;
        }

        while( 1 )
        {
            for(int i=0; i<3; ++i)
            {
                if( mp[ solve[i] ]>0 )
                {
                    cout<<solve[i];
                    mp[ solve[i] ]--;
                }
            }

            if( ( 0== mp[solve[0]] ) && 0== mp[solve[1]] && 0== mp[solve[2]])
            {
                cout<<endl;
                break;
            }

        }
    }


    return 0;
}