#include <bits/stdc++.h>
using namespace std;
vector<int> suffix_array(string s) {
  int n = s.size();
  vector<int> p(n), c(n), pn(n), cn(n), f(200);
  for (char i : s) f[i]++;
  for (int i = 1; i < f.size(); i++) f[i] += f[i - 1];
  for (int i = 0; i < n; i++) p[--f[s[i]]] = i;
  int classes = 1;
  c[p[0]] = 0;
  for (int i = 1; i < n; i++) {
    if (s[p[i]] != s[p[i - 1]]) classes++;
    c[p[i]] = classes - 1;
  }
  for (int h = 0; (1 << h) < n; h++) {
    f.assign(classes, 0);
    for (int i = 0; i < n; i++) pn[i] = (n + p[i] - (1 << h)) % n;
    for (int i = 0; i < n; i++) f[c[pn[i]]]++;
    for (int i = 1; i < classes; i++) f[i] += f[i - 1];
    for (int i = n - 1; i >= 0; i--) p[--f[c[pn[i]]]] = pn[i];
    classes = 1;
    cn[p[0]] = 0;
    for (int i = 1; i < n; i++) {
      pair<int, int> cur = {c[p[i]], c[(p[i] + (1 << h)) % n]},
                     now = {c[p[i - 1]], c[(p[i - 1] + (1 << h)) % n]};
      if (cur != now) classes++;
      cn[p[i]] = classes - 1;
    }
    c = cn;
  }
  return p;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  vector<int> sf = suffix_array(s);
  int op = count(s.begin(), s.end(), '('), cl = count(s.begin(), s.end(), ')');
  vector<int> pf(n + 1, 0), pfmin(n + 1, 0), sfmin(n + 1, op - cl);
  for (int i = 0; i < n; i++) {
    pf[i + 1] = (pf[i] + (s[i] == '(' ? 1 : -1));
    pfmin[i + 1] = min(pf[i + 1], pfmin[i]);
  }
  sfmin[n] = pf[n];
  for (int i = n; i > 0; i--) sfmin[i - 1] = min(sfmin[i], pf[i]);
  for (int i = 0; i < sf.size(); i++) {
    int down = min(sfmin[sf[i] + 1], pf.back() + pfmin[sf[i]]) - pf[sf[i]];
    if (down >= min(0, op - cl)) {
      for (int j = 0; j < cl - op; j++) cout << '(';
      for (int j = 0; j < n; j++) cout << s[(j + sf[i]) % n];
      for (int j = 0; j < op - cl; j++) cout << ')';
      cout << "\n";
      break;
    }
  }
  return 0;
}
