#include <iostream>
#include <vector>
using namespace std;

int main() {
    string str;
    cin>>str;
    vector<char> z,o,j;
    for(int i=0;i<str.size();i++){
        if(str[i]=='Z') z.push_back(str[i]);
        else if(str[i]=='O') o.push_back(str[i]);
        else if(str[i]=='J') j.push_back(str[i]);
    }
    for(int i=0;i<z.size()||i<o.size()||i<j.size();i++){
        if(i<z.size()) cout<<z[i];
        if(i<o.size()) cout<<o[i];
        if(i<j.size()) cout<<j[i];
    }
    return 0;
}