array = input("Input the marbles:")
output = ''
count = len(array)
while count != 0:
    mx = "0"
    for char in array:
        if array.count(char) > array.count(mx) and char not in output:
            mx = char
    output += (mx * array.count(mx))
    count -= array.count(mx)
print(output)
            

9792ade45001a6801e1612503775ea2d4d7d0ce9
<mask token>

<mask token>
while count != 0:
    mx = '0'
    for char in array:
        if array.count(char) > array.count(mx) and char not in output:
            mx = char
    output += mx * array.count(mx)
    count -= array.count(mx)
print(output)

array = input('Input the marbles:')
output = ''
count = len(array)
while count != 0:
    mx = '0'
    for char in array:
        if array.count(char) > array.count(mx) and char not in output:
            mx = char
    output += mx * array.count(mx)
    count -= array.count(mx)
print(output)

array = input("Input the marbles:")
output = ''
count = len(array)
while count != 0:
    mx = "0"
    for char in array:
        if array.count(char) > array.count(mx) and char not in output:
            mx = char
    output += (mx * array.count(mx))
    count -= array.count(mx)
print(output)
            
