欢迎光临散文网 会员登陆 & 注册

CF 339A - Helpful Maths

2023-07-25 15:27 作者:您是打尖儿还是住店呢  | 我要投稿

Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation.


The teacher has written down the sum of multiple numbers. Pupils should calculate the sum. To make the calculation easier, the sum only contains numbers 1, 2 and 3. Still, that isn't enough for Xenia. She is only beginning to count, so she can calculate a sum only if the summands follow in non-decreasing order. For example, she can't calculate sum 1+3+2+1 but she can calculate sums 1+1+2 and 3+3.


You've got the sum that was written on the board. Rearrange the summans and print the sum in such a way that Xenia can calculate the sum.


Input

The first line contains a non-empty string s — the sum Xenia needs to count. String s contains no spaces. It only contains digits and characters "+". Besides, string s is a correct sum of numbers 1, 2 and 3. String s is at most 100 characters long.


Output

Print the new sum that Xenia can count.


Examples

--------------------------------------

初级数学家 Xenia 是小学三年级的学生。 她现在正在学习加法运算。


老师写下了多个数字的和。 学生应计算总和。 为了使计算更容易,总和只包含数字 1、2 和 3。但这对 Xenia 来说还不够。 她才刚刚开始数数,因此只有当被加数按非递减顺序排列时,她才能计算总和。 例如,她无法计算 1+3+2+1 之和,但可以计算 1+1+2 和 3+3 之和。


你已经得到了黑板上写的总数。 重新排列 summan 并以 Xenia 可以计算总和的方式打印总和。


输入

第一行包含一个非空字符串 s — Xenia 需要计算的总和。 字符串 s 不包含空格。 它仅包含数字和字符“+”。 此外,字符串s是数字1、2和3的正确和。字符串s的长度最多为100个字符。


输出

打印 Xenia 可以计算的新总和。

--------------------------

这次还是卡在split函数这里的。。。本次是需要转义字符;


CF 339A - Helpful Maths的评论 (共 条)

分享到微博请遵守国家法律