using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
	class Program
	{
		static void Main(string[] args)
		{
			int q = int.Parse(Console.ReadLine()), q1 = q;
			string[] s;
			int[,] niz = new int[q,2];
			while (q > 0)
			{
				int n, k;
				ulong t;
				s = Console.ReadLine().Split();
				n = int.Parse(s[0]); k = int.Parse(s[1]); t = ulong.Parse(s[2]);
				niz[q1 - q, 1] = n;
				int m = 0;
				bool da = true;
				if (t > (ulong)(Math.Pow(2,n)))
				{
					da = false;
				}
				else
				{
					while (t > 0)
					{
						while (true)
						{
							for (int i = 0; i <= k && i >= 0; i++)
							{
								if (binarno(m, i, n))
								{
									t--;
									break;
								}
							}
							if (t == 0)
							{
								da = true;
								break;
							}
							if (m == Math.Pow(2, n) && t > 0)
							{
								da = false;
								break;
							}
							m++;
						}
						if (da || !da)
							break;
					}
				}
				if (!da)
				{
					niz[q1 - q, 0] = -1;
				}
				if (da)
				{
					niz[q1 - q, 0] = m;
				}
				q--;
			}
			for (int i = 0; i < q1; i++)
			{
				if (niz[i, 0] == -1)
				{
					Console.WriteLine("Ne postoji");
				}
				else
				{
					int n = niz[i, 1];
					int[] niz2 = new int[n];
					for (int j = 0; j < n; j++)
					{
						if (niz[i, 0] % 2 == 0)
							niz2[n - j - 1] = 1;
						else
							niz2[n - j - 1] = 0;
						niz[i, 0] /= 2;
					}
					for (int j = 0; j < n; j++)
					{
						if (niz2[j] == 0)
							Console.Write(")");
						else
							Console.Write("(");
					}
					Console.WriteLine();
				}
			}
		}
		static bool binarno(int r, int j,int br)
		{
			int br0 = 0, br1 = 0;
			for (int i = 0; i < br; i++)
			{
				if (r % 2 == 0)
					br1++;
				else
					br0++;
				r /= 2;
			}
			if (br0 == br1 || Math.Abs(br0 - br1) == j)
				return true;
			else
				return false;
		}
	}
}