• + 0 comments

    Code:

    import re
    S=input()
    small=re.findall("[a-z]",S)
    big=re.findall("[A-Z]",S)
    num=re.findall("[0-9]",S)
    oddnum=[int(n) for n in num if int(n)%2!=0]
    evennum=[int(n) for n in num if int(n)%2==0]    
    print(*(sorted(small)+sorted(big)+sorted(oddnum)+sorted(evennum)),sep='')