# # import sys # def compare(a): # return a.lower() # while True: # try: # s = input() # other_s = [] # alpha_list = [] # #保存字母和非字母列表 # for i in range(len(s)): # if not s[i].isalpha(): # other_s.append(s[i] + "|" + str(i)) # else: # alpha_list.append(s[i]) # #字母按照不区分大小写排序 # alpha_list.sort(key = compare) # #把其他字符按位置插入字符列表 # for item in other_s: # c, index = item.split('|') # alpha_list.insert(int(index), c) # result_s = '' # for c in alpha_list: # result_s += c # print(result_s) # except: # # print(sys.exc_info()) # break #解法2 while True: try: s = input() a = '' #保存字母字符串,按照不区分大小写排序 for c in s: if c.isalpha(): a += c b = sorted(a, key = str.upper) result = '' index = 0 #如果是字母的,就用排序好的字母列表填充.非字母的保持不变 for i in range(len(s)): if s[i].isalpha(): result += b[index] index += 1 else: result += s[i] print(result) except: break