#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 5;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
struct SAIS {
  int s[maxn << 1], t[maxn << 1], sa[maxn], rk[maxn], hi[maxn], p[maxn],
      tax[maxn], cur[maxn];
  void inducedSort(int n, int m, int n1, int *s, int *s1, int *t) {
    for (int i = 0; i < n; ++i) sa[i] = -1;
    for (int i = 0; i < m; ++i) tax[i] = 0;
    for (int i = 0; i < n; ++i) ++tax[s[i]];
    for (int i = 1; i < m; ++i) tax[i] += tax[i - 1];
    for (int i = 0; i < m; ++i) cur[i] = tax[i] - 1;
    for (int i = n1 - 1; ~i; --i) sa[cur[s[s1[i]]]--] = s1[i];
    for (int i = 1; i < m; ++i) cur[i] = tax[i - 1];
    for (int i = 0; i < n; ++i)
      if (sa[i] > 0 && t[sa[i] - 1]) sa[cur[s[sa[i] - 1]]++] = sa[i] - 1;
    for (int i = 0; i < m; ++i) cur[i] = tax[i] - 1;
    for (int i = n - 1; ~i; --i)
      if (sa[i] > 0 && !t[sa[i] - 1]) sa[cur[s[sa[i] - 1]]--] = sa[i] - 1;
  }
  void sais(int n, int m, int *s, int *t, int *p) {
    int n1 = t[n - 1] = 0, ch = rk[0] = -1, *s1 = s + n;
    for (int i = n - 2; ~i; --i)
      t[i] = s[i] == s[i + 1] ? t[i + 1] : s[i] > s[i + 1];
    for (int i = 1; i < n; ++i)
      rk[i] = t[i - 1] && !t[i] ? p[n1] = i, n1++ : -1;
    inducedSort(n, m, n1, s, p, t);
    for (int i = 0, x, y; i < n; ++i) {
      if ((x = rk[sa[i]]) == -1) continue;
      if (ch < 1 || p[x + 1] - p[x] != p[y + 1] - p[y])
        ++ch;
      else
        for (int j = p[x], k = p[y]; j <= p[x + 1]; ++j, ++k)
          if ((s[j] << 1 | t[j]) != (s[k] << 1 | t[k])) {
            ++ch;
            break;
          }
      s1[y = x] = ch;
    }
    if (ch + 1 < n1)
      sais(n1, ch + 1, s1, t + n, p + n1);
    else
      for (int i = 0; i < n1; ++i) sa[s1[i]] = i;
    for (int i = 0; i < n1; ++i) s1[i] = p[sa[i]];
    inducedSort(n, m, n1, s, s1, t);
  }
  void solve(char *str, int n, int m) {
    for (int i = 0; i < n; ++i) s[i] = str[i];
    s[n++] = 0;
    sais(n, m, s, t, p);
    for (int i = 0; i < n; ++i) rk[sa[i]] = i;
    --n;
    for (int i = 0, k = hi[0] = 0; i < n; ++i) {
      int j = sa[rk[i] - 1];
      while (s[i + k] == s[j + k]) ++k;
      if (hi[rk[i]] = k) --k;
    }
    for (int i = n; i >= 1; --i) ++sa[i], rk[i] = rk[i - 1];
  }
} sais;
char s[maxn];
int sum[maxn], mn[maxn], que[maxn];
int n, p1, p2;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; ++i) s[i + n] = s[i];
  int tn = n;
  n <<= 1;
  sais.solve(s + 1, n, 256);
  for (int i = 1; i <= n; ++i) {
    sum[i] = sum[i - 1] + (s[i] == '(' ? 1 : -1);
  }
  p1 = 1, p2 = 0;
  for (int i = 1; i <= n; ++i) {
    while (p1 <= p2 && sum[que[p2]] >= sum[i]) --p2;
    que[++p2] = i;
    while (i - que[p1] + 1 > tn) ++p1;
    if (i >= tn) mn[i - tn + 1] = sum[que[p1]] - sum[i - tn];
  }
  int x = inf, y;
  for (int i = 1; i <= tn; ++i) {
    mn[i] = mn[i] >= 0 ? 0 : -mn[i];
    x = min(x, mn[i]);
  }
  int p = 0;
  y = x + sum[tn];
  for (int i = 1; i <= n; ++i) {
    if (sais.sa[i] > tn) continue;
    if (mn[sais.sa[i]] == x) {
      p = sais.sa[i];
      break;
    }
  }
  while (x--) putchar('(');
  s[p + tn] = 0;
  printf("%s", s + p);
  while (y--) putchar(')');
  return 0;
}
