406620: GYM102461 A Expression Formatting

Memory Limit:512 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Expression Formattingtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard output

Masha is learning programming, but her teacher always says that she is doing wrong, and her code is not pretty enough. For instance, Masha doesn't like spaces, and she never uses spaces inside expression, for example: (a+b)*c.

The teacher tries to make Masha put the spaces around binary operators, for the expression to look like: (a + b) * c. Masha doesn't want to waste time on such stupid things, so she asks you to write a program that is putting spaces for her.

Input

The first line contains the expression that needs to be fixed. The expression consists of variable names, binary operators: '+', '-', '*', '/', and parentheses: '(', ')'. The expression doesn't contain any space, and is correct. All variables consist of a single lowercase English letter. The length of the expression string doesn't exceed 200.

Output

Print the same expression, adding a single space before and after each binary operator.

Scoring

Testing data for this problem consists of 20 test cases. For solving each test case you are awarded 5 points. Total score is the total sum of points for all test cases. The testing result for each test case is shown.

ExamplesInput
a+b
Output
a + b
Input
((a))-b+(c*(d))
Output
((a)) - b + (c * (d))
Input
(a)/(b-b)+((d)+((c)))
Output
(a) / (b - b) + ((d) + ((c)))

加入题单

上一题 下一题 算法标签: