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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            
            Int64 Q = Int64.Parse(Console.ReadLine());
            Int64[] N = new Int64[Q];
            Int64[] K = new Int64[Q];
            Int64[] T = new Int64[Q];
            string[] x = new string[Q];
            for (int i = 0; i < Q;i++ )
                x[i] = Console.ReadLine();

            for (int i = 0; i < Q; i++)
            {
                N[i] = Convert.ToInt64(x[i].Split(' ')[0]);
                K[i] = Convert.ToInt64(x[i].Split(' ')[1]);
                T[i] = Convert.ToInt64(x[i].Split(' ')[2]);
            }

            string[] o = new string[Q];

            for (int i = 0; i < Q; i++)
            {
                string dodatnez = "";
                while(T[i]!=0)
                {
                if(T[i]%2 == 1)
                    dodatnez += ')';
                else
                    dodatnez += '(';
                T[i] = T[i] / 2;
                }
                string stv = "";
                for (int k = dodatnez.Length - 1; k > -1; k--)
                {
                    stv += dodatnez[k];
                }

                for (int j = 0; j < (N[i] - K[i]) / 2; j++)
                    o[i] += '(';
                for (int j = 0; j < (N[i] - K[i]) / 2; j++)
                    o[i] += ')';
                o[i] += stv;
               
               if (o[i].Length > N[i])
                    Console.WriteLine("Ne postoji")
               else
                    Console.WriteLine(o[i]);               

            }
            Console.Read();
            




        }
    }
}