#include <iostream>
#include <algorithm>
using namespace std;
void displayZOJ(string s) {
int cz = 0,co = 0,cj = 0;
for(int i = 0;i < s.length(); i++) {
if(s[i] == 'Z') cz++;
else if(s[i] == 'O') co++;
else if(s[i] == 'J') cj++;
}
int maxn = max({cz, co, cj});
for(int i = 0;i < maxn; i++) {
if(cz > 0) {
cout<< 'Z';
cz--;
}
if(co > 0) {
cout<< 'O';
co--;
}
if(cj > 0) {
cout<< 'J';
cj--;
}
}
cout << endl;
return;
}
int main() {
string str;
while(cin >> str) {
displayZOJ(str);
}
return 0;
}

京公网安备 11010502036488号