#include <bits/stdc++.h>

using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int Rand(int l, int h){
    return uniform_int_distribution<int>(l, h)(rng);
}
int main(){
    int n = Rand(1, 100); // length of the regular bracket is 2 * n
    stack<char> st;
    int pref = 0;
    for (int i = 1; i <= n; ++i){
        int x = Rand(0, 1);
        if (x == 1){
            pref ++;
            st.push('(');
            cout << '(';
        }
        else{
            if (pref > 0) {
                pref--; st.push(')');
                cout << ')';
            }
            else{
                pref++; st.push('(');
                cout << '(';
            }
        }
    }
    while(st.size()){
        char c = st.top(); st.pop();
        cout << (c == '(' ? ')' : '(');
    }
}