#进行了深拷贝 import sys import copy lines=sys.stdin.readlines() l=list(lines[0]) fz=[] for i in range(len(l)): if l[i].isalpha(): fz.append(l[i]) l[i]="pending" old=copy.deepcopy(fz) # print(old) for i in range(len(fz)): for j in range(i+1,len(fz)): if fz[i].upper()>fz[j].upper() : fz[i],fz[j]=fz[j],fz[i] for item in fz: for i in range(len(l)): if l[i]=='pending': l[i]=item break for i in range(len(l)): for j in range(len(old)): if l[i].upper()==old[j].upper(): l[i]=old[j] old.remove(old[j]) break result="" for item in l: result=result+item print(result)