#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void bracket(int n)
{
if (n == 0)
return;
int left_len = rand() % n;
int right_len = n - 1 - left_len;
cout << '(';
bracket(left_len);
cout << ')';
bracket(right_len);
}
int main()
{
srand(time(NULL));
int n;
cin >> n;
bracket(n);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGxpYj4KI2luY2x1ZGUgPGN0aW1lPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBicmFja2V0KGludCBuKQp7CglpZiAobiA9PSAwKQoJCXJldHVybjsKCQkKCWludCBsZWZ0X2xlbiA9IHJhbmQoKSAlIG47CglpbnQgcmlnaHRfbGVuID0gbiAtIDEgLSBsZWZ0X2xlbjsKCQoJY291dCA8PCAnKCc7CglicmFja2V0KGxlZnRfbGVuKTsKCWNvdXQgPDwgJyknOwoJYnJhY2tldChyaWdodF9sZW4pOwp9CQoKaW50IG1haW4oKQp7CglzcmFuZCh0aW1lKE5VTEwpKTsKCQoJaW50IG47CgljaW4gPj4gbjsKCQoJYnJhY2tldChuKTsKCQoJcmV0dXJuIDA7Cn0=