Example

Input

1


Output

)(
#include <iostream>
#include <string>
using namespace std;
using ll = long long int;

string solve(ll N, ll L) {
  string ans = string(L, ')') + string(L, '(');
  ll M = L * (L + 1) / 2;

  int pos = L;
  for(; M > N; M--) {
    swap(ans[pos], ans[pos-1]);
    pos--;
  }
  return ans;
}

int main() {
  ll N; cin >> N;
  ll sum = 0;
  for(ll i=1; ; i++) {
    sum += i;
    if(sum >= N) {
      cout << solve(N, i) << endl;
      return 0;
    }
  }
  return 1;
}

