Problem: A sequence of brackets is called balanced if one can turn it into a valid math expression by adding characters '+' and '1'. For example, sequences '(())()', '()', and '(()(()))' are balanced, while ')(', '(()', and '(()))(' are not.

You are given a binary string s of length n. Construct two balanced bracket sequences a and b of length n such that for all 1≤ i≤ n: 

  * if s_i=1, then a_i=b_i 
  * if s_i=0, then a_i≠ b_i 



If it is impossible, you should report about it.

Input

The first line contains a single integer t (1≤ t≤ 10^4) — the number of test cases.

The first line of each test case contains a single integer n (2≤ n≤ 2⋅ 10^5, n is even).

The next line contains a string s of length n, consisting of characters 0 and 1.

The sum of n across all test cases does not exceed 2⋅ 10^5.

Output

If such two balanced bracked sequences exist, output "YES" on the first line, otherwise output "NO". You can print each letter in any case (upper or lower).

If the answer is "YES", output the balanced bracket sequences a and b satisfying the conditions on the next two lines.

If there are multiple solutions, you may print any.

Example

Input


3
6
101101
10
1001101101
4
1100


Output


YES
()()()
((()))
YES
()()((()))
(())()()()
NO

Note

In the first test case, a="()()()" and b="((()))". The characters are equal in positions 1, 3, 4, and 6, which are the exact same positions where s_i=1.

In the second test case, a="()()((()))" and b="(())()()()". The characters are equal in positions 1, 4, 5, 7, 8, 10, which are the exact same positions where s_i=1.

In the third test case, there is no solution.

Solution (in CPP):

Solution:
// Author: Moulik
// Date Created: 15 April 2021
// Filename: CF1503A.cpp
#include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#define what_is(x) cerr << "Variable name:\t" << #x << "\ndata:\t" << x << "\n";
#else
#define what_is(x) ;
#endif

#define rprint(data) std::cout << data;return  
#define rprintln(data) std::cout << data << endl;return  


// OSTREAMS

template<typename T1, typename T2>
ostream & operator<<(ostream &os, const pair<T1,T2> p){
    os << '(' << p.first << ',' << p.second << ')';
    return os;
}

template<typename T>
ostream & operator<<(ostream &os, const vector<T> p){
    os << "{ ";
    for(auto i:p){
        os << i << ",";
    }
    os << "\b}";
    return os;
}

template<typename T1, typename T2>
ostream & operator<<(ostream & os, const map<T1, T2> p){
    os << "{";
    bool f = false;
    for(auto i:p){
        os << i.first << ":" << i.second << ", ";
        f=true;
    }
    if(f){
        os << "\b\b";
    }
    os << "}";
    return os;
}

// ISTREAMS

template<typename T1, typename T2>
istream & operator >> (istream &in, pair<T1,T2> & p){
    in >> p.first >> p.second;
    return in;
}



namespace mlk{
    class Performance{
        private:
        static map<string, chrono::time_point<chrono::high_resolution_clock>> mapping;
        public:
        static void time(string fnName){
            mapping[fnName] = chrono::high_resolution_clock::now();
        }
        static void timeEnd(string fnName){
            assert(mapping.find(fnName)!=mapping.end());
            auto end = chrono::high_resolution_clock::now();
            cerr << fnName << ": " << chrono::duration_cast<chrono::milliseconds>(end-mapping[fnName]).count() << " miliseconds - timer ended\n";
            mapping.erase(fnName);
        }
        static void timeLog(string fnName){
            assert(mapping.find(fnName) != mapping.end());
            auto end = chrono::high_resolution_clock::now();
            cerr << fnName << ": " << chrono::duration_cast<chrono::milliseconds>(end - mapping[fnName]).count() << " miliseconds\n";
        }
    };
    map<string, chrono::time_point<chrono::high_resolution_clock>>  Performance::mapping;

    template<typename T>
    bool selfMin(T & x, T && y, bool equality = false){
        if(x>y){
            x = y;
            return true;
        }
        else if(x==y && equality){
            return true;
        }
        return false;
    }

    template<typename T>
    bool selfMin(T & x, T & y, bool equality = false){
        if(x>y){
            x = y;
            return true;
        }
        else if(x==y && equality){
            return true;
        }
        return false;
    }


    template<typename T>
    bool selfMax(T & x, T && y, bool equality = false){
        if(x<y){
            x = y;
            return true;
        }
        else if(x==y && equality){
            return true;
        }
        return false;
    }

    template<typename T>
    bool selfMax(T & x, T & y, bool equality = false){
        if(x<y){
            x = y;
            return true;
        }
        else if(x==y && equality){
            return true;
        }
        return false;
    }
    
    class Primes{
    private:
        static vector<int> m_primes;
        static int m_n;

    public:
        static void compute(int n){
            m_primes.resize(n+1);
            m_n = n+1;
            m_primes[0] = 1;
            for(int i = 1; i < m_n; i++){
                m_primes[i] = i;
            }
            for(int i = 2; i < m_n; i++){
                if(m_primes[i]==i){
                    for(int j = 2*i; j < m_n; j+=i){
                        m_primes[j] = i;
                    }
                }
            }
        }

        static bool isPrime(int n){
            if(m_primes[n]==n){return true;}
            return false;
        }

        static int lpf(int n){
            return m_primes[n];
        }
        
    };
    vector<int> Primes::m_primes;
    int Primes::m_n;

    // Power using binary exponentation
    template<typename T>
    T power(T base, T exponent){ 
        T ans = 1;
        while(exponent > 0){ 
            if (exponent&1) 
                ans = (ans*base); 
            exponent >>= 1;
            base = base*base;
        }
        return ans; 
    } 

    // Power modulo p using binary exponentation
    template<typename T>
    T power(T base, T exponent, T p = -1){ 
        T ans = 1;
        if(p!=-1){
            base = base%p;
            while(exponent > 0){ 
                if (exponent&1) 
                    ans = (ans*base)%p; 
                exponent >>= 1;
                base = (base * base) % p; 
            } 
        }
        else{
            while(exponent > 0){ 
                if (exponent&1) 
                    ans = (ans*base); 
                exponent >>= 1;
                base = base*base;
            }
        }
        return ans; 
    }

    // Return n^-1%p, given p is prime
    int modInverse(long long n, long long p){
        return power(n,p-2,p);
    }

    class Factorials{
        private:
        static vector<int> m_factorials;
        static int m_n;
        
        public:

        static void compute(int n, int modulo = -1){
            m_n = n+1;
            m_factorials.resize(m_n);
            m_factorials[0] = 1;
            m_factorials[1] = 1;
            if(modulo == -1){
                for(int i = 2; i < m_n; i++){
                        m_factorials[i] = i*m_factorials[i-1];
                }
            }
            else{
                for(int i = 2; i < m_n; i++){
                    m_factorials[i] = (i*m_factorials[i-1])%modulo;
                }
            }
        }

        static int factorial(int idx){
            return m_factorials[idx];
        }

        static long long ncr(long long n, long long r, long long p=1e9+7){
            if(r==0){
                return 1;
            }
            return (1ll*m_factorials[n] * modInverse(m_factorials[r], p) % p * modInverse(m_factorials[n - r], p) % p) % p; 
        }

    };

    vector<int> Factorials::m_factorials;
    int Factorials::m_n;

    // Sorts array in the given order {key is 0 indexed}
    template <typename T>
    void keySort(vector<T> &arr, vector<int> &key){
        int n = arr.size();
        if(key.size()!=n){
            throw runtime_error("Size of data array not equals to size of key array");
        }
        vector<T> ans(n);
        int ar[n];
        for(int i = 0; i < n; i++){
            ar[key[i]]=i;
        }
        for(int i = 0; i < n; i++){
            ans[i] = arr[ar[i]];
        }
        arr = ans;

    }

}   // mlk

using namespace mlk;

void solve();

int main(){
    // #define Interactor
    #ifndef Interactor
        ios::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        #define endl '\n'
    #endif   

    int t;
    cin >> t;
    while(t--)
        solve();
        
    return 0;

}

void solve(){
    int n;
    string s;
    cin >> n >> s;
    if(s.front()!='1' || s.back()!='1'){
        rprintln("NO");
    }
    int cnt = 0;
    for(auto i:s){
        if(i=='0'){
            cnt++;
        }
    }
    if(cnt%2){
        rprintln("NO");
    }
    string s1="", s2="";
    int c1 = 0;
    int c2 = 0;
    int idx = s.find_last_of('0');
    if(idx==s.npos){
        idx=-1;
    }
    for(int i = 0; i < n; i++){
        if(c1<0 || c2<0){
            rprintln("NO");
        }
        if(s[i]=='1'){
            if(min(c1, c2) > 0 && max(c1, c2) > bool(i<idx)){
                c1--;
                c2--;
                s1.push_back(')');
                s2.push_back(')');
            }
            else{
                c1++;c2++;
                s1.push_back('(');
                s2.push_back('(');
            }
        }
        else{
            if(c1>c2){
                c1--;c2++;
                s1.push_back(')');
                s2.push_back('(');
            }
            else{
                c1++;c2--;
                s1.push_back('(');
                s2.push_back(')');
            }
        }
    }
    cout << "YES" << endl;
    cout << s1 << endl << s2 << endl;
}