/* I feel that my practice is very troublesome. One can only store +-symbol arrays, one can store all operators in the queue, and the other one.
Queue storage operations (such as 1011, 10.11 )). And then brute force search... */
/* My code: 297 Ms */
# Include <iostream>
# Include <cstdio>
# Include <cstring>
Using namespace STD;
Const int n = 50;
Char opr2 [N];
Char OPR [N];
Int OPN [N];
Int CNT, N;
Void DFS (int p, int P2, int M, int sum, int t ){
Int I, j, tsum;
If (sum = 0 & t = N ){
If (CNT <20 ){
For (I = 0; I <p; I ++ ){
Printf ("% d % C", I + 1, opr [I]);
}
Printf ("% d \ n", t );
}
CNT ++;
Return;
}
If (T> = N) return;
T ++;
OPR [p] = opr2 [P2] = '+ ';
OPN [m] = T;
Tsum = sum + T;
DFS (p + 1, p2 + 1, m + 1, tsum, t );
OPR [p] = opr2 [P2] = '-';
OPN [m] = T;
Tsum = sum-T;
DFS (p + 1, p2 + 1, m + 1, tsum, t );
OPR [p] = '.';
If (T> = 10) fig [M-1] = fig [M-1] * 100 + T;
Else OPN [M-1] = OPN [M-1] * 10 + T;
J = 0; tsum = fig [0];
For (I = 1; I <= m-1; I ++ ){
If (opr2 [J] = '+ ')
Tsum + = fig [I];
Else
Tsum-= fig [I];
J ++;
}
DFS (p + 1, P2, M, tsum, t );
}
Int main (){
// Freopen ("data. In", "r", stdin );
While (~ Scanf ("% d", & N )){
Memset (OPR, 0, sizeof (OPR ));
Memset (opr2, 0, sizeof (opr2 ));
Memset (FIG, 0, sizeof (FIG ));
CNT = 0; fig [0] = 1;
DFS (0, 0, 1, 1, 1 );
Printf ("% d \ n", CNT );
}
Return 0;
}