#include <iostream>
#include <sstream>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	long long q, n, k, t;
	cin >> q;
	stringstream ss;
	string s;
	while(q--)
	{
		cin >> n >> k >> t;
		t--;
		for(long long i = 0; i < n; i++)
		{
			if(t % 2) ss << ")";
			else ss << "(";
			t /= 2;
		}
		ss >> s;
		for(long long i = s.length() - 1; i >= 0; i--) cout << s[i];
		cout << "\n";
		ss.clear();
	}
}