//Failure will never overtake me if my determination to succeed is strong enough
#include <bits/stdc++.h>

using namespace std;


string kth_balanced(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;
}


int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int q;
    cin >> q;
    while(q--)
    {
        int n, k, t;
        cin >> n >> k >> t;

        if(t > pow(2, n))
        {
            cout << "Ne postoji\n";
            continue;
        }

        if(k >= n)
        {
            for(int i = 0; i < n; i++)
            {
                if(t & (1<<i))
                    cout << ")";
                else
                    cout << "(";
            }
        }

        else if(k == 0)
        {
            if(n % 2 == 0)
                cout << kth_balanced(n/2, t);
            else
                cout << "Ne postoji";
        }

        else
        {
            int poredu = 0;
            for(int mask = 0; mask < (1<<n); mask++)
            {
                int kredit = 0;
                int suma = 0;
                for(int i = n-1; i >= 0; i--)
                {
                    if(mask & (1<<i))
                    {
                        suma--;
                    }

                    else
                        suma++;

                    if(suma < 0)
                    {
                        kredit++;
                        suma = 0;
                    }
                }

                if(kredit+suma <= k)
                {
                    poredu++;
                    if(poredu == t)
                    {
                        for(int i = n-1; i >= 0; i--)
                        {
                            if(mask & (1<<i))
                                cout << ")";
                            else
                                cout << "(";
                        }

                        break;
                    }
                }
            }
        }

        cout << "\n";
    }
}