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
#include<bits/stdc++.h>
#define FOR(i,s,e) for(int i=(s);i<=(e);i++)
#define FORD(i,s,e) for(int i=(s);i>=(e);i--)
#define FOREACH(i,c) for( __typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define ALL(k) (k).begin(),(k).end()
#define e1 first 
#define e2 second
#define mp make_pair
#define pb push_back
#define eb emplace_back 
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
const bool print=false;

string cig(int n){
	if(n==1) return "1";
	if(n==2) return "(1+1)";
	
	if(n%2==0) return '('+cig(n/2) + "*(1+1))";
	return "(("+cig(n/2)+"*(1+1))+1)";
}



main(){
	int test;scanf("%d",&test);
	while(test--){
		int n;scanf("%d",&n);
		string ans=cig(n);
		cout<<ans<<'\n';
	}
}