#include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; cout << "(\n"; for (int i = 1; i < n; i++) { for (int j = 0; j < i; j++) cout << ")"; if (i < n - 1) { for (int j = 0; j < i + 1; j++) cout << "("; } cout << '\n'; } return 0; }