#include <cstdio>
#include <vector>
using namespace std;
vector <char> output;
int N;
void dfs ( int left, int right, int level ) {
if ( level == 2 * N ) {
for ( int i = 0; i < 2 * N; i++ )
printf ( "%c", output[i] );
printf ( "\n" );
return;
}
if ( left < N ) {
output.push_back ( '(' );
dfs ( left + 1, right, level + 1 );
output.pop_back();
}
if ( left > right ) {
output.push_back ( ')' );
dfs ( left, right + 1, level + 1 );
output.pop_back();
}
}
int main ( void ) {
while ( ~scanf ( "%d", &N ) ) {
dfs ( 0, 0, 0 );
printf ( "\n" );
}
}