1390 -- Binary System
Time Limit :1000 MS Memory Limit :65536 KB
Accepts : 87 Submits : 171
User Accepts : 68 User Submits : 71
<Submit>   <Statistics>   <Discuss>

Description

Usually we use number in the decimal system, for it is so convenient for us to remember and calculate.
But it is not the same in the computer world where numbers are always stored in the binary system. For example, the number 21 in decimal can be presented as (21)10 = (10101)2 = 24+22+20. It is the sum of the power of 2. Note that in the first item, the power is 4, then the number 4 can be presented as (4)10 = (100)2=22, so , and it is much more convenient for computer to display as 21=2(2(2))+2(2)+2(0). Every positive integer can be written in this form following these principles: 
  1. Number 1 is presented as 2(0), while number 2 is presented as 2. Then other numbers must be combined by these two basic numbers;
  2. The powers of 2 are always sorted in descending order .

 

Input

Each line of the Input is the number n (0 < n < 1000000) in the binary system. Input file is ended with -1.

Output

For each case, you should only export the equation as the sample output. Be careful of the space before and after the equal sign. And there mustn’t be any more space in your output.

Sample Input

8
21
1315
-1

Sample Output

8 = 2(2+2(0))
21 = 2(2(2))+2(2)+2(0)
1315 = 2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2(0))+2+2(0)

 

Source

Alpc NUDT campus contest 2009
<Submit>   <Statistics>   <Discuss>
 


Powered by Zhang Zhaoning PDL College of Computer
Since 2006.03.09 | 2007.11.22 | 2010.03.02 Copyright (r) 2006 - 2010 All Rights Reserved