#include <bits/stdc++.h>

using namespace std;

#define int ll
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pi> vp;
typedef vector<pl> vpl;

string convert(int x){
	string sol = "";
	while(x){
		sol += (x % 2) + '0';
		x /= 2;
	}

	reverse(sol.begin(), sol.end());

	return sol;
}

//preuzeto sa https://cp-algorithms.com/combinatorics/bracket_sequences.html
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;
}

bool ok(string s){
	int sol = 0;

	for (auto& i : s){
		if (i == '(')
			++sol;
		else
			--sol;

		if (sol < 0)
			return 0;
	}

	if (sol == 0)
		return 1;
	return 0;
}

signed main()
{
	ios_base::sync_with_stdio(false); 
	cin.tie(nullptr); 
	cout.tie(nullptr); 
	cerr.tie(nullptr);	

	int q;
	cin >> q;

	vi N(q), K(q), T(q);
	bool nk = 1, kk = 1;
	for (int i = 0; i < q; ++i){
		cin >> N[i] >> K[i] >> T[i];
		--T[i];
		nk = (nk & (N[i] == K[i])); 
		kk = (kk & (K[i] == 0));
	}

	if (nk){
		for (int i = 0; i < q; ++i){
			string t = convert(T[i]);

			for (auto& j : t){
				if (j == '0')
					j = '(';
				else
					j = ')';
			}

			int len = t.length(), n = N[i];
			if (len < n){
				reverse(t.begin(), t.end());

				while(len < n){
					t += '(';
					++len;
				}

				reverse(t.begin(), t.end());
			}

			if (len > n)
				cout << "Ne postoji\n";
			else
				cout << t << '\n';			
		}
		return 0;
	}

	if (kk){
		for (int i = 0; i < q; ++i){
			int n = N[i], k = K[i], t = T[i];

			if (n % 2){
				cout << "Ne postoji\n";
				continue;
			}

			string tt = kth_balanced(n / 2, t + 1);

			if (!ok(tt)){
				cout << "Ne postoji\n";
				continue;
			}

			cout << tt << '\n';
		}
		return 0;
	}
}