#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 maksn;
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";
}
void solvebrut(int x){
    //cout << x << endl;
    n = niz[x].n;
    k = niz[x].k;
    t = niz[x].t;
    vector<int>svi;
    ff(i,0, (1<<n) - 1){
        stack<int> stek;
        fb(j,n-1,0){
            if((1<<j) & i){
                if(stek.empty())stek.push(1);
                else{
                    if(stek.top() == 0)stek.pop();
                    else stek.push(1);
                }
            }
            else{
                stek.push(0);
            }
        }
        if(stek.size() <= k)svi.pb(i);
    }
    sort(svi.begin(), svi.end());
    t--;
    //cout << endl << endl;
    //cout << t << endl << endl;
    int m = svi.size();
    if(t >= m){
        cout << "Ne postoji\n";
    }
    else{
        int koji = svi[t];
        fb(j,n-1,0){
            if((1<<j) & koji){
                cout << ')';
            }
            else cout << '(';
        }
        cout << endl;
    }

}
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++;
        maksn = max(maksn, niz[i].n);
    }
    if(maksn <= 8){
        ff(i,0,q - 1)solvebrut(i);
    }
    else if(breq == q){
        ff(i,0,q-1)solveeq(i);
    }
    else if(brnul == q){

    }
    return 0;
}