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

namespace kval35
{
    class Program
    {
        static void Main(string[] args)
        {
            long q = Convert.ToInt64(Console.ReadLine());
            string[] a = new string[q];
            for (int i = 0; i < q; i++)
            {
                var line = Console.ReadLine();
                var data = line.Split(' ');
                long n = Convert.ToInt64(data[0]);
                long k = Convert.ToInt64(data[1]);
                long t = Convert.ToInt64(data[2]);

                if (n % 2 == 1 && k == 0 || t > Math.Pow(2, n) || k > n)
                    a[i] = "Ne postoji";
                else
                {
                    if (n == k)
                    {
                        long t2 = t - 1;
                        string s = "";
                        while (t2 != 0)
                        {
                            if (t2 % 2 == 1)
                                s = ")" + s;
                            else
                                s = "(" + s;
                            t2 /= 2;
                        }
                        while (s.Length < n)
                            s = "(" + s;
                        a[i] = s;
                    }
                    else
                    {
                        if ((n - k) % 2 == 1)
                            k--;
                        string s = "";
                        double x = Math.Ceiling(1.0 * n / 2) - Math.Ceiling(2.0 * t / n);
                        while (x != 0)
                        {
                            s += "(";
                            x--;
                        }
                        x = t % (n / 2 + 1) - 1;
                        while (x != 0)
                        {
                            s += ")";
                            x--;
                        }
                        s += "(";
                        x = n / 2 - t % (n / 2 + 1) + 1;
                        while (x != 0)
                        {
                            s += ")";
                            x--;
                        }
                        x = t / (n / 2 + 1);
                        while (x != 0)
                        {
                            s += "(";
                            x--;
                        }
                        a[i] = s;
                    }
                }
            }
            for (int i = 0; i < q; i++)
                Console.WriteLine(a[i]);
        }
    }
}