#include <bits/stdc++.h>

#define ll long long

using namespace std;

char b[100];
ll br;
bool z;

bool check(int n, int k) {

    int cnt = 0, x = 0;
    for(int i = 0; i < n; i++) {
        if(b[i] == '(')
            cnt++;
        else if(cnt == 0)
            x++;
        else
            cnt--;
    }
    x += cnt;
    
    return (x <= k);
}

void f(int n, int k, ll t, int d) {

    if(d == n) {
        if(check(n, k))
            br++;
        if(br == t) {
            z = true;
            for(int i = 0; i < n; i++)
                cout << b[i];
            cout << endl;
        }
        return;
    }

    if(z)
        return;
    
    b[d] = '(';
    f(n, k, t, d + 1);

    b[d] = ')';
    f(n, k, t, d + 1);
}

void solve() {

    int n, k;
    ll t;
    cin >> n >> k >> t;

    br = 0;
    z = false;
    f(n, k, t, 0);
    if(!z)
        cout << "Ne postoji" << endl;
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int q;
    cin >> q;

    while(q--)
        solve();
    return 0;
}