1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <bits/stdc++.h>

#define double long double
#define LL long long
#define MP make_pair
#define ST first
#define ND second
#define PII pair<LL,LL >
#define PPIII pair<PII,int>
#define PPIIPII pair<PII,PII>
#define PIB pair<int,bool>
#define PIS pair<int,string>
#define PB push_back
#define VI vector<LL>
#define VVI vector<VI>
#define VLL vector<long long>
#define VVLL vector<VLL>
#define VB vector<bool>
#define VPII vector<PII>
#define VPPIII vector<PPIII>
#define VPPIIPII vector<PPIIPII>
#define VPIB vector<PIB>
#define VPIS vector<PIS>
#define SI set<int>
#define SPII set<PPIII>
#define VS vector<string>
#define PB push_back
#define INF (LL) 1000000000000
#define MOD 2000007
#define ALL(c) c.begin(),c.end()
#define NWD __gcd
#define SIZE 1000000

using namespace std;

void rek(int k)
{

	if(k%2 == 1)
		cout<<"1+";

	if(k/2==1)
	{
		cout<<"1+1";
		return;
	}

	cout<<"(1+1)*(";
	rek(k/2);
	cout<<")";
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);

    int t;
    cin>>t;
    while(t--)
	{
		int n;
		cin>>n;
		rek(n);
		cout<<endl;
	}
	return 0;

}