#include using namespace std; int check_and_get() { string str; getline(cin, str); assert(str.length() == 1); int n = stoi(str); assert(2 <= n && n <= 8); return n; } int main() { int n = check_and_get(); for (int i = 0; i < n; i++) { if (i == 0) { for (int j = 0; j < n - 1; j++) cout << '('; } else { for (int j = 0; j < n - i; j++) cout << ')'; for (int j = 0; j < n - i - 1; j++) cout << '('; } cout << endl; } }