def zoj(s): z=[] o=[] j=[] for i in s: if i == 'Z': z.append('Z') if i == 'O': o.append('O') if i == 'J': j.append('J') for i in range(len(s)): if i < len(z) and len(z) > 0: print("%c"%z[i],end='') if i < len(o) and len(o) > 0: print("%c"%o[i],end='') if i < len(j) and len(j) > 0: print("%c"%j[i],end='') while True: try: s = input() zoj(s) except: break