=====Problem Statement=====
You are given a string S. S contains alphanumeric characters only. Your task is to sort the string S in the following manner:
All sorted lowercase letters are ahead of uppercase letters.
All sorted uppercase letters are ahead of digits.
All sorted odd digits are ahead of sorted even digits.

=====Input Format=====
A single line of input contains the string S.

=====Constraints=====
0<len(S)<1000

=====Output Format=====
Output the sorted string S.

Difficulty: introductory

Starter code:

# Enter your code here. Read input from STDIN. Print output to STDOUT

Solutions:
s = input()
s = sorted(s,key = lambda x:(x.isdigit() and int(x)%2==0, x.isdigit(),x.isupper(),x.islower(),x))
print(*(s),sep = '')


#!/usr/bin/env python3

def __starting_point():
    string = input().strip()
    
    print(*sorted(string, key = lambda x: (-x.islower(), x.isdigit() - x.isupper(), x in '02468', x)), sep='')
__starting_point()