#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll MOD = 1e9+7;
ll d[105];

string f(int n, int k) {
    vector<vector<int>> d(2*n+1, vector<int>(n+1, 0));
    d[0][0]=1;
    for (int i=1;i<=2*n;i++) {
        d[i][0]=d[i-1][1];
        for(int j = 1; j < n; j++)d[i][j]=d[i-1][j-1]+d[i-1][j+1];
        d[i][n] = d[i-1][n-1];
    }
    string ans;
    int depth=0;
    for (int i=0;i<2*n;i++) {
        if (depth+1<=n&&d[2*n-i-1][depth+1]>=k) {
            ans+='(';
            depth++;
        } else {
            ans+=')';
            if(depth+1<= n)
                k-=d[2*n-i-1][depth+1];
            depth--;
        }
    }
    return ans;
}

ll c(ll a,ll b){
    ll res;
    if(b>a-b)b=a-b;
    for(ll i=0LL;i<b;i++){
        res*=(a-i);
        res/=(i+1);
    }

    return res;
}

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int q;
    cin>>q;

    vector<int>v;

    d[0]=1LL;
    for(int i=1;i<=50;i++){
        for(int j=0;j<i;j++){
            d[i]+=d[j]*d[i-1-j];
        }
    }


    /*for(ll i=2LL;i<=100LL;i+=2LL){
        d[i]=c(i,i/2)/(i/2+1);
    }*/


    while(q--){
        int n,k,t;
        cin>>n>>k>>t;

        if(k>=n){
            v.clear();
            t--;
            while(t>0){
                if(t%2==1){
                    v.push_back(1);
                    t-=1;
                    t/=2;
                }else{
                    v.push_back(0);
                    t/=2;
                }
            }
            reverse(v.begin(),v.end());
            if((int)v.size()>n){
                cout<<"Ne postoji\n";
                continue;
            }
            for(int i=1;i<=n-(int)v.size();i++)cout<<"(";
            for(auto e:v){
                if(e==0)cout<<"(";
                else cout<<")";
            }
            cout<<"\n";
        }else if(k==0){
            if(n%2==1){
                cout<<"Ne postoji\n";
                continue;
            }else{
                cout<<d[n/2]<<"\n";
                if(t>d[n/2])cout<<"Ne postoji\n";
                else cout<<f(n/2,t);
            }
        }else if(n<=8){

        }
    }

    return 0;
}