s = input()
n = []
tmp = ''
for i in range(len(s)):
if s[i].isdigit():
tmp += s[i]
if (i+1 < len(s)):
if not(s[i+1].isdigit()):
n.append(tmp)
tmp = ''
else:
n.append(tmp)
sort_n = sorted(n, reverse=True)
new_s = ''
for i in range(len(s)):
if s[i].isdigit():
tmp += s[i]
if (i+1 < len(s)):
if not(s[i+1].isdigit()):
new_s += sort_n.pop()
else:
new_s += s[i]
print(new_s)
Comments
Leave a comment