#include <bits/stdc++.h> using namespace std; int main() { string s; vector<int> ans(3, 0); while (cin >> s) { // 注意 while 处理多个 case for (int i = 0; i < s.size(); i++) { if (s[i] == 'Z') { ans[0]++; } else if (s[i] == 'O') { ans[1]++; } else { ans[2]++; } } for (int i = 0;; i = (i + 1) % 3) { if (ans[i] != 0) { if (i == 0) { cout << "Z"; } else if (i == 1) { cout << "O"; } else { cout << "J"; } ans[i]--; } if (ans[0] == 0 && ans[1] == 0 && ans[2] == 0) { break; } } } } // 64 位输出请用 printf("%lld")