Example

Input

1


Output

)(
#include <bits/stdc++.h>
using namespace std;

const int INF = 1e8 + 7;
const int N = 1e5 + 8;

long long a[N];
int n;
int calc(int x, int k)
{
	int l = 0, r = k, res = -1;
	while (l <= r)
	{
		int mid = l + r >> 1;
		if ((long long)((2 * k - mid + 1) * mid / 2) <= x)
		{
			res = mid;
			l = mid + 1;
		}
		else r = mid - 1;
	} 
	return res;
}
int main()
{
	cin.sync_with_stdio(0);
	for (int i = 1; i < N; ++i) a[i] = (long long)i * (i + 1) / 2;
	while (cin >> n)
	{
		int k = lower_bound(a + 1, a + N, n) - a;
		int num = a[k] - n;
		int l = calc(num, k);
		for (int i = 1; i <= l; ++i) cout << '(';
		num = num - ((2 * k - l + 1) * l / 2);
		for (int j = 1; j <= k - num; ++j) cout << ')';
		cout << '(';
		for (int j = 1; j <= num; ++j) cout << ')';
		for (int i = 1; i <= k - l - 1; ++i) cout << '(';
		cout << endl;
	}
}