1 #include<stdio.h>
2 #include<string.h>
3 int mi[15]={1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384};
4 int zs[15]={1,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
5 void f(int n)
6 {
7 if(n==1){printf("2(0)");return ;}
8 if(n==2) {printf("2");return ;}
9 int i=14,j=n;
10 while(i>=1){
11 if(j-mi[i]>=0){
12 printf("2");
13 if(zs[i]>1){
14 printf("(");
15 f(zs[i]);
16 printf(")");
17 }
18 j-=mi[i];
19 if(j) printf("+");
20 f(j);return ;
21 }
22 i--;
23 }
24 }
25 int main()
26 {
27 int n;scanf("%d",&n);
28 f(n); printf("
");
29 return 0;
30 }