#include <bits/stdc++.h>

using namespace std;

char chars[100];

bool IsValid(int n, int k)
{
    if(n-k > 0)
    {
        char temp[n-k];
        for(int i = 0; i < n; ++i)
        {
            for(int j = 0; j < n-k; ++j)
            {
                if(i+j < n)
                    temp[j] = chars[i+j];
            }
            bool valid = true;
            for(int j = 0; j < n-k; ++j)
            {
                if(temp[j] != '(' && temp[n-k-1-j] != ')')
                    valid = false;
            }
            return valid;
        }
        return false;
    }
    return true;
}
int ct = 0;
void Generate(char permutation[], int N, int K, int Index, int T)
{
    if(Index == N)
    {
        if(IsValid(N, K))
        {
            ++ct;
            if(ct == T)
            {
                for(int i = 0; i < N; ++i)
                {
                    cout << permutation[i];
                }
                cout << endl;
            }
        }
    }
    else
    {
        permutation[Index] = '(';
        Generate(permutation, N, K, Index+1, T);

        permutation[Index]=')';
        Generate(permutation, N, K, Index+1, T);
    }
}

int main()
{
    int q;
    int n, k, t;
    cin >> q;
    for(int i = 0; i < q; ++i)
    {
        cin >> n >> k >> t;
        Generate(chars, n, k, 0, t);
        if(ct < t)
            cout << "Ne postoji" << endl;
        ct = 0;
    }
    return 0;
}