Multiplication Improvement

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

zxyl has improved significantly in computer science. On the other hand, he hasn't improved as much in math. Especially multiplication.

He cannot understand an expression if the numbers are not in increasing order. For example, he can understand 1x4x7x9 but he cannot understand 9x4x7x1.

Given an expression, help zxyl understand the expression and calculate it.

Input Specification

The one and only line of input will contain a string S, whose length L is (1 \le L \le 39), containing a sequence of one digit numbers and the character x.

Output Specification

The first line of output should be the expression in a way that zxyl can understand.

The last line of output will be the solution to the expression.

The output will always be under 2^{64}-1.

Sample Input 1

5x4x9

Sample Output 1

4x5x9
180

Comments

There are no comments at the moment.