def mystery(s):
    return "".join(sorted(set(s), reverse=True))

print(mystery("programming"))