#include <bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define mid(l, r) ((l)+(r))/2
#define len(a) (a).length()
#define sz(a) (a).size()
#define xx first
#define yy second
#define inf int(2e9)
#define ff(i, a, b) for(int (i) = (a); (i) <= (b); ++(i))
#define fb(i, a, b) for(int (i) = (a); (i) >= (b); --(i))


using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

template<class T>
void print(const T niz[], const int siz)
{
    for(int i=0;i<siz;i++)
        cout << niz[i] << " ";
    cout << endl;
}

struct upit{
    int n,k,t;
};
int q;
upit niz[1005];
int breq;
int brnul;
int n,k,t;
void solveeq(int x){
    n = niz[x].n;
    k = niz[x].k;
    t = niz[x].t;
    ll sta = 1;
    ff(i,0,n - 1)sta *= 2;
    if(t > sta){
        cout << "Ne postoji\n";
        return;
    }
    vector<char>sol;
    t--;
    while(t > 0){
        if(t%2 == 0){
            sol.pb(')');
        }
        else sol.pb('(');
        t /= 2;
    }
    while(sol.size() < n)sol.pb(')');
    reverse(sol.begin(), sol.end());
    for(auto c:sol)cout << c;
    cout << "\n";
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin >> q;
    ff(i,0,q - 1){
        cin >> niz[i].n >> niz[i].k >> niz[i].t;
        if(niz[i].n == niz[i].k)breq++;
        if(niz[i].k == 0)brnul++;
    }
    if(breq == q){
        ff(i,0,q-1)solveeq(i);
    }
    else if(brnul == q){

    }
    return 0;
}