• + 0 comments

    if name == 'main':

    S = input()
    
    def custom_key(Char):
    
        if Char.islower():
            return(0 , Char)
        elif Char.isupper():
            return(1 , Char)
        elif Char.isdigit():
            return (2 if int(Char) % 2 else 3, Char)
    
    
    
    
    
    
    
    sorted_string  = ''.join(sorted(S , key =custom_key))
    
    print(sorted_string)