#include <iostream>
#include<bits/stdc++.h>
using namespace std;
vector<char> v[1001];
bool postoji[1001],nti[1001];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int q,n,k,i,j,l;
    long long t,pk;
    cin >> q;
    for(i=0;i<q;i++)
    {
        postoji[i]=true;
        cin >> n >> k >> t;
        if(k==n)
            nti[i]=true;
        if((double)log2(t)>(double)n)
            postoji[i]=false;
        else
        {
            if(k==n && n>8)
            {
                t--;
                for(pk=1;pk<(long long)pow(2,min(n,60));pk=pk*2)
                {
                    if((t&pk))
                        v[i].push_back(')');
                    else
                        v[i].push_back('(');
                }
                if(n>59)
                {
                    for(j=0;j<(n-59);j++)
                        v[i].push_back('(');
                }
            }
            else
            {
                if(k==0 && n>8)
                {
                    if(n%2==0)
                        postoji[i]=false;
                }
                else
                {
                    if(n<=8)
                    {
                        if(pow(2,n)<t)
                            postoji[i]=false;
                        else
                        {
                            int bruk=0,brz,bris,bro;
                            string pom;
                            for(j=0;j<(1<<n);j++)
                            {
                                pom="";
                                bro=0;
                                brz=0;
                                bris=0;
                                for(l=0;l<n;l++)
                                {
                                    if(j&(1<<l))
                                        pom=')'+pom;
                                    else
                                        pom='('+pom;
                                }
                                for(l=0;l<n;l++)
                                {
                                    //cout << pom[l];
                                    if(pom[l]=='(')
                                        bro++;
                                    else
                                        brz++;
                                    if(brz>bro)
                                    {
                                        brz--;
                                        bris++;
                                    }
                                }
                                //cout << endl;
                                if(bro>brz)
                                    bris=bris+(bro-brz);
                                //cout << bris << endl;
                                if(bris<=k)
                                    bruk++;
                                //cout << bruk << endl;
                                if(bruk==t)
                                {
                                    for(l=n-1;l>=0;l--)
                                        v[i].push_back(pom[l]);
                                    break;
                                }
                            }
                            if(bruk<t)
                                postoji[i]=false;
                        }
                    }
                }
            }
        }
    }
    for(i=0;i<q;i++)
    {
        if(postoji[i]==true)
        {
            if(nti==false)
            {
                for(j=0;j<v[i].size();j++)
                    cout << v[i][j];
                cout << endl;
            }
            else
            {
                for(j=v[i].size()-1;j>=0;j--)
                    cout << v[i][j];
                cout << endl;
            }
        }
        else
            cout << "Ne postoji" << endl;
    }
    //cout << "Hello world!" << endl;
    return 0;
}