#include <bits/stdc++.h>

using namespace std;
string k0(long long n, long long k) {
    vector<vector<long long>> d(2*n+1, vector<long long>(n+1, 0));
    d[0][0] = 1;
    for (long long i = 1; i <= 2*n; i++) {
        d[i][0] = d[i-1][1];
        for (long long 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;
    long long depth = 0;
    for (long long 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;
}
void kn(long long n,long long t)
{
    if(n==0)
    {
        cout<<'('<<"\n";
        return;
    }
    long long binaryNum[32];
    long long i = 0;
    while (n > 0) {
        binaryNum[i] = n % 2;
        n = n / 2;
        i++;
    }
    if(i>t)
    {
        cout<<"Ne postoji"<<"\n";
        return;
    }
    for (long long j = i - 1; j >= 0; j--)
        if(binaryNum[j]==0)
            cout<<'(';
        else cout<<')';
    cout<<"\n";
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    long long q;
    cin>>q;
    for(long long qq=0;qq<q;qq++)
    {
        long long n,k,t;
        cin>>n>>k>>t;
        if(k==0)
        {
            if(n%2==1)
            {
                cout<<"Ne postoji"<<"\n";
                continue;
            }
            else cout<<k0(n/2,t)<<"\n";
        }
        else if(k==n)
        {
            kn(t-1,n);
        }
        else
        {
            long long d=n-k;
            long long pro=0;
            if(d%2==1)
                d++;
            while(d<=n)
            {
                string s=k0(d/2,t);
                if(s[0]==')')
                    d+=2;
                else
                {
                    for(long long i=0;i<n-d;i++)
                        cout<<'(';
                    cout<<s<<"\n";
                    pro=1;
                    break;
                }
            }
            if(pro==0)
                cout<<"Ne postoji"<<"\n";
        }
    }
}