#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;

int main() {
	cin >> q;
	while (q--) {
		cin >> n >> k >> t;
		if (k == 0 && n & 1)cout << "Ne postoji";
		else if (k == 0) {
			for (i = 0; i < n / 2; ++i)putchar('(');
			for (i = n / 2; i < n; ++i)putchar(')');
		}
		else if (n <= 24) {
			l = 1 << n;
			for (i = 0; i < l; ++i) {
				bitset<24> b(i);
				s = b.to_string();
				s = &s[24 - 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' ? '(' : ')';
					}
					cout << s;
					return 0;
				}
			}
		}
		cout << "Ne postoji\n";
	}

}