You are given a string S.S contains alphanumeric characters only.
Your task is to sort the string S in the following manner: