#include <bits/stdc++.h>
const int LEN = 2000100 * 3;
int r[LEN], sa[LEN];
int wa[LEN], wb[LEN], wv[LEN], ss[LEN];
int c0(int *r, int a, int b) {
  return r[a] == r[b] && r[a + 1] == r[b + 1] && r[a + 2] == r[b + 2];
}
int c12(int k, int *r, int a, int b) {
  if (k == 2) return r[a] < r[b] || r[a] == r[b] && c12(1, r, a + 1, b + 1);
  return r[a] < r[b] || r[a] == r[b] && wv[a + 1] < wv[b + 1];
}
void sort(int *r, int *a, int *b, int n, int m) {
  for (int i = 0; i < n; i++) wv[i] = r[a[i]];
  for (int i = 0; i < m; i++) ss[i] = 0;
  for (int i = 0; i < n; i++) ss[wv[i]]++;
  for (int i = 1; i < m; i++) ss[i] += ss[i - 1];
  for (int i = n - 1; i >= 0; i--) b[--ss[wv[i]]] = a[i];
}
void DC3(int *r, int *sa, int n, int m) {
  int i, j, p;
  int *san = sa + n, *rn = r + n;
  int ta = 0, tb = (n + 1) / 3, tbc = 0;
  r[n] = r[n + 1] = 0;
  for (i = 0; i < n; i++)
    if (i % 3 != 0) wa[tbc++] = i;
  sort(r + 2, wa, wb, tbc, m);
  sort(r + 1, wb, wa, tbc, m);
  sort(r, wa, wb, tbc, m);
  for (p = 1, rn[((wb[0]) / 3 + ((wb[0]) % 3 == 1 ? 0 : tb))] = 0, i = 1;
       i < tbc; i++)
    rn[((wb[i]) / 3 + ((wb[i]) % 3 == 1 ? 0 : tb))] =
        c0(r, wb[i - 1], wb[i]) ? p - 1 : p++;
  if (p < tbc)
    DC3(rn, san, tbc, p);
  else
    for (i = 0; i < tbc; i++) san[rn[i]] = i;
  for (i = 0; i < tbc; i++)
    if (san[i] < tb) wb[ta++] = san[i] * 3;
  if (n % 3 == 1) wb[ta++] = n - 1;
  sort(r, wb, wa, ta, m);
  for (i = 0; i < tbc; i++)
    wv[wb[i] = ((san[i]) < tb ? (san[i]) * 3 + 1 : ((san[i]) - tb) * 3 + 2)] =
        i;
  for (i = 0, j = 0, p = 0; i < ta && j < tbc; p++)
    sa[p] = c12(wb[j] % 3, r, wa[i], wb[j]) ? wa[i++] : wb[j++];
  for (; i < ta; p++) sa[p] = wa[i++];
  for (; j < tbc; p++) sa[p] = wb[j++];
}
char s[2000100];
int val[2000100];
int rmq[20][1000100];
int query(int l, int r) {
  int cnt = r - l + 1, i;
  for (i = 0; (1 << i) <= cnt; i++)
    ;
  i--;
  return ((rmq[i][l]) < (rmq[i][r - (1 << i) + 1])
              ? (rmq[i][l])
              : (rmq[i][r - (1 << i) + 1]));
}
int main() {
  scanf("%s", s);
  int len = strlen(s);
  for (int i = 0; i < len; i++) r[i] = r[i + len] = s[i];
  r[len << 1] = 0;
  DC3(r, sa, len << 1 | 1, 256);
  int cur = 0;
  int ca = 0, cb = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == '(')
      cur++;
    else
      cur--;
    val[i] = cur;
  }
  if (cur > 0)
    ca = 0, cb = cur;
  else
    ca = -cur, cb = 0;
  for (int i = 0; i < len; i++) rmq[0][i] = val[i];
  for (int j = 1; (1 << j) <= len; j++) {
    int k = 1 << (j - 1);
    for (int i = 0; i + (1 << j) <= len; i++) {
      rmq[j][i] = ((rmq[j - 1][i]) < (rmq[j - 1][i + k]) ? (rmq[j - 1][i])
                                                         : (rmq[j - 1][i + k]));
    }
  }
  int pos;
  for (int j = 0; j <= len + len; j++)
    if (sa[j] < len) {
      int i = sa[j];
      int init = val[i] - ((s[i] == '(') ? 1 : -1);
      int Min = query(i, len - 1) - init;
      if (Min + ca < 0) continue;
      if (i >= 1) {
        init = val[len - 1] - init;
        Min = query(0, i - 1) + init + ca;
        if (Min < 0) continue;
      }
      pos = i;
      break;
    }
  for (int i = 0; i < ca; i++) putchar('(');
  for (int i = pos; i < len; i++) putchar(s[i]);
  for (int i = 0; i < pos; i++) putchar(s[i]);
  for (int i = 0; i < cb; i++) putchar(')');
}
