#include <bits/stdc++.h>
//#include <conio.h>
#define ll long long
#define ld double
#define oo 2000000000
#define ull unsigned long long
#define ui unsigned int
#define uc unsigned char
#define zero 1E-6
#define vi vector<int>
#define vii vector<ii>
#define ii pair<int,int>
#define ft(i,x,y) for(int i=(x), __dst=(y);i<=__dst;++i)
#define fdt(i,x,y) for(int i=(x), __dst=(y);i>=__dst;--i)
#define cto(it,x) for(auto it:x)
#define rep(n) for(int __n = (n);__n--

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eb emplace_back
#define sz(x) (int) size(x)
#define all(x) x.begin(), x.end()
#define cppio cin.sync_with_stdio (0); cin.tie (0); cout.tie (0)
#define bug(x) cout<<#x<<':'<<x<<' '
#define abug(a,x,y) {ft(i,x,y){cout<<a
<<' ';} cout<<'\n';}
using namespace std;
int N;
int a[22];
void outp () {
ft (i, 1, 2*N) {
if (a > 0)
cout << '(';
else
cout << ')';
}
cout << endl;
}
void attempt (int i, int open, int open_left) {
if (i > 2*N)
outp ();
else {
if (open_left == 0) {
a = -1;
attempt (i+1, open, 0);
} else {
if (i == 1) {
a = 1;
attempt (i+1, open + 1, open_left-1);
} else {
if (open > 0) {
a = -1;
attempt (i+1, open-1, open_left);
}
a = 1;
attempt (i+1, open+1, open_left-1);
}
}
}
}
int main () {
cin >> N;
attempt (1, 0, N);
}