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

bool isok(int a,int n, int k) {
    int res=0;
    for (int i=n-1; i>=0; i--) {
        if (a/(int)pow(2,(float)i)%2==0) res+=1;
        else res-=1;
        if (res<0) {
            k-=1;
            res+=1;
        }
        if (k<0) return false;
    }
    k-=res;
    if (k<0) return false;
    return true;
}
int main() {
    int q;
    int n,k;
    long long int t;
    scanf("%d",&q);
    long long int t1=0;
    int res=0;
    for (int i=0; i<q; i++) {
        t1=0;
        res=0;
        scanf("%d %d %lld",&n,&k,&t);
        if (n==k) {
            if (t>(int)pow(2,(float)n)) {
                cout<<"Ne postoji";
            }
            else {
                t-=1;
                for (int y=n-1;y>=0; y--) {
                    if (t/(int)pow(2,(float)y)%2==0) cout<<"(";
                    else cout<<")";
                }
            }
            cout<<endl;
            continue;
        }
        while (t1<t&&res<(int)pow(2,(float)n)) {
            if (isok(res,n,k)) t1+=1;
            res+=1;
        }
        res-=1;
        if (t1<t) {
            cout<<"Ne postoji";
        }
        else {
            for (int y=n-1;y>=0; y--) {
                if (res/(int)pow(2,(float)y)%2==0) cout<<"(";
                else cout<<")";
            }
        }
        cout<<endl;
    }
}