#include <bits/stdc++.h>
using namespace std;

void bin(unsigned n) {
    if (n > 1)
    bin(n>>1);
    cout << (n & 1 ? ")" : "(");
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long long t;
    short i, j, q, n, k;
    cin >> q;
    for(i = 0; i < q; i++){
        cin >> n >> k >> t;
        if(n % 2 != k % 2 || k > n || pow(2, n) < t){
            cout << "Ne postoji" << endl;
            continue;
        }
        bool a[n];
        for(j = 0; j < k + (n - k) / 2; j++){
            a[j] = 0;
        }
        for(j = k + (n - k) / 2; j < n; j++){
            a[j] = 1;
        }
        if(k == n){
            bin(t - 1);
            cout << endl;
            continue;
        }
        else{
            j = k + (n - k) / 2 - 1;
            if(t > 1){
                a[j] = 1;
                if(j < n - 1){
                    a[j + 1] = 0;
                }
                t--;
            }
            for(j--; j > -1 && t > 1; j-=2, t--){
                a[j] = 1;
                a[j + 1] = 0;
            }
        }
        for(j = 0; j < n; j++){
            cout << (a[j] == 1 ? ")" : "(");
        }
        cout << endl;
    }

    return 0;
}