#include <bits/stdc++.h>
using namespace std;
int z, n;
char s[2000007], t[2000007];
int tab[2000007];
vector<int> suf;
void suf_array(const char* init, vector<int>& suf) {
  string s = init;
  vector<int> head, color, sub, tmp;
  head.assign(max((int)s.size(), 256), 0);
  suf.resize(s.size());
  color.resize(s.size());
  sub.resize(s.size());
  tmp.resize(s.size());
  for (int i = 0; i < s.size(); i++) ++head[s[i]];
  for (int i = 1; i < 256; i++) head[i] += head[i - 1];
  for (int i = 255; i >= 0; i--) head[i] = head[i - 1];
  head[0] = 0;
  for (int i = 0; i < s.size(); i++) {
    suf[head[s[i]]] = i;
    ++head[s[i]];
  }
  int classes = 1;
  head[0] = 0;
  for (int i = 1; i < s.size(); i++) {
    if (s[suf[i - 1]] != s[suf[i]]) {
      ++classes;
      head[classes - 1] = i;
    }
    color[suf[i]] = classes - 1;
  }
  for (int k = 1; k < s.size(); k *= 2) {
    for (int i = 0; i < s.size(); i++) {
      int first = suf[i] - k;
      if (first < 0) first += s.size();
      tmp[head[color[first]]] = first;
      ++head[color[first]];
    }
    suf = tmp;
    int second;
    pair<int, int> prv, cur;
    cur = make_pair(-1, 0);
    classes = 0;
    for (int i = 0; i < s.size(); i++) {
      prv = cur;
      second = suf[i] + k;
      if (second >= s.size()) second -= s.size();
      cur = make_pair(color[suf[i]], color[second]);
      if (cur != prv) {
        ++classes;
        head[classes - 1] = i;
      }
      sub[suf[i]] = classes - 1;
    }
    color = sub;
    if (classes == s.size()) break;
  }
}
int start, ending;
int tree[2000007 * 4];
int ans[2000007 * 4];
void build(int v, int l, int r) {
  if (l == r) {
    tree[v] = tab[l - 1];
    return;
  }
  int m = (l + r) / 2;
  build(2 * v, l, m);
  build(2 * v + 1, m + 1, r);
  tree[v] = min(tree[2 * v], tree[2 * v + 1]);
}
int query(int v, int l, int r, int p, int q) {
  if (p <= l && q >= r) return tree[v];
  int ret = 1000000001;
  int m = (l + r) / 2;
  if (p <= m) ret = min(ret, query(2 * v, l, m, p, q));
  if (m + 1 <= q) ret = min(ret, query(2 * v + 1, m + 1, r, p, q));
  return ret;
}
bool ok(int i) {
  return query(1, 1, n, 1 + suf[i], 1 + suf[i] + n / 2 - 1) +
             max(0, ending - start) - tab[suf[i]] >=
         0;
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  strcpy(t, s);
  strcpy(t + n, s);
  n *= 2;
  t[n] = 0;
  for (int i = 1; i < n; i++) tab[i] = tab[i - 1] + (t[i - 1] == '(' ? 1 : -1);
  build(1, 1, n);
  suf_array(s, suf);
  for (int i = 0; i < n / 2; i++) {
    start += (s[i] == '(');
    ending += (s[i] != '(');
  }
  int shiftid = 0;
  for (int i = 0; i < n / 2; i++)
    if (suf[i] < n / 2 && ok(i)) {
      shiftid = suf[i];
      break;
    }
  t[0] = 0;
  for (int i = 0; i < ending - start; i++) t[i] = '(';
  t[ending - start] = 0;
  printf("%s", t);
  printf("%s", s + shiftid);
  s[shiftid] = 0;
  printf("%s", s);
  t[0] = 0;
  for (int i = 0; i < start - ending; i++) t[i] = ')';
  t[start - ending] = 0;
  printf("%s\n", t);
  return 0;
}
