#include
#include<bits/stdc++.h>
using namespace std;
vector v;
void generate_brackets(char output[],int n,int i,int copen,int cclose)
{
if(i==2*n)
{
output[i]=’\0’;
v.push_back(output);
return;
}
if(copen<n)
{
output[i]='(';
generate_brackets(output,n,i+1,copen+1,cclose);
}
if(cclose<copen)
{
output[i]=')';
generate_brackets(output,n,i+1,copen,cclose+1);
}
}
int main()
{
int n;
cin>>n;
char output[100];
generate_brackets(output,n,0,0,0);
sort(v.begin(),v.end());
for(int i=n-1;i>=0;i--)
{
cout<<v[i]<<endl;
}
}