#include <bits/stdc++.h>

using namespace std;

set<string> sol;

void solve(long long n, long long k, long long brojOtvorenih, string s)
{
    if(s.length()==n)
    {
        if(abs(brojOtvorenih) <= k)
        {
            //cout << s << endl;
            sol.emplace(s);
        }
    }
    else
    {
        solve(n,k,brojOtvorenih+1,s+'(');
        solve(n,k,brojOtvorenih-1,s+')');
    }
}

int main()
{
    long long q;
    cin >> q;
    for(long long i=0;i<q;i++)
    {
        sol.clear();
        long long n,k,t;
        cin >> n >> k >> t;
        if(t>pow(2,n))
        {
            cout << "Ne postoji" << endl;
            continue;
        }
        solve(n,k,0,"");
        if(t>sol.size())
        {
            cout << "Ne postoji" << endl;
            continue;
        }
        if(sol.empty())
        {
            cout << "Ne postoji" << endl;
            continue;
        }
        else
        {
            set<string>::iterator iter = sol.begin();
            advance(iter, t-1);
            cout << *iter << endl;
        }
    }
    return 0;
}