#include<iostream>
#include<bitset>
#include<string>
#include<math.h>
using namespace std;

int n, k, q, i, l, g, pg, p, j, z;
long long t, a,b,c;
string s, res;

int main() {
	cin >> q;
	while (q--) {
		res = "Ne postoji";
		cin >> n >> k >> t;
		if (k == 0 && n & 1);
		else if (t == 1) {
			res = string(n,')');
			for (i = 0; i < n / 2; ++i)res[i]= '(';
		}
		else if (n <= 25) {
			z = 0;
			l = 1 << n;
			for (i = 0; i < l; ++i) {
				bitset<25> b(i);
				s = b.to_string();
				s = &s[25 - n];

				g = pg = 0;
				for (char c : s) {
					if (c == '0')++pg;
					else if (pg)--pg;
					else ++g;
				}
				if (g + pg > k)continue;
				++z;
				if (z == t) {
					for (size_t i = 0; i < s.size(); i++) {
						s[i] = s[i] == '0' ? '(' : ')';
					}
					res = s;
				}
			}
		}
		cout << res << '\n';
	}
}