#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 3;
const int M = 4e6 + 3;
const int oo = 1e9;
const int OS = 317;
const int MOD = 1e9 + 7;
char s[N];
int n, stp[M], p1[N], p2[N], s1[N], s2[N], ho[N], hz[N], h[N];
vector<int> st;
int get(int i, int ln) {
  int op, zp, zs, os, il, ir, ans, l1, l, r, ym;
  op = p2[i];
  zp = i - p1[i] - op;
  zs = s2[i + 1];
  os = n - i - s1[i + 1] - zs;
  il = zs;
  ir = op;
  if (os > zp)
    ir += os - zp;
  else
    il += zp - os;
  l1 = min(il, ln);
  ym = 2 * n;
  ans = (stp[ym] * 1LL * ho[l1]) % MOD;
  if (ln - l1 > 0) {
    l = i + 1;
    r = l + min(n - i, ln - l1) - 1;
    ans = (ans + (((h[r] - h[l - 1]) % MOD + MOD) % MOD) * 1LL *
                     stp[ym + l1 - (l - 1)] % MOD) %
          MOD;
    l1 += r - l + 1;
    if (ln - l1 > 0) {
      r = min(i, ln - l1);
      ans = (ans + h[r] * 1LL * stp[ym + l1] % MOD) % MOD;
      l1 += r;
      if (ln - l1 > 0) {
        r = ln - l1;
        ans = (ans + hz[r] * 1LL * stp[ym + l1] % MOD) % MOD;
      }
    }
  }
  return ans;
}
int get_ch(int i, int ln) {
  int op, zp, zs, os, il, ir;
  op = p2[i];
  zp = i - p1[i] - op;
  zs = s2[i + 1];
  os = n - i - s1[i + 1] - zs;
  il = zs;
  ir = op;
  if (os > zp)
    ir += os - zp;
  else
    il += zp - os;
  if (ln <= il) return '(';
  ln -= il;
  if (ln <= n - i) return s[i + ln];
  ln -= n - i;
  if (ln <= i)
    return s[ln];
  else
    return ')';
}
int ans;
bool cmp(int i, int j) {
  int l, r, x;
  l = 1, r = ans;
  while (l <= r) {
    x = (l + r) >> 1;
    if (get(i, x) == get(j, x))
      l = x + 1;
    else
      r = x - 1;
  }
  if (r + 1 > ans) return true;
  return get_ch(i, r + 1) <= get_ch(j, r + 1);
}
int main() {
  if (0) {
    freopen("input.txt", "w", stdout);
    int n = 1e6;
    for (int i = 0; i < n; ++i) printf("(");
    printf("\n");
    return 0;
  }
  int i, j, op, zp, zs, os, len, mn;
  gets(s + 1);
  n = strlen(s + 1);
  for (i = 1; i <= n; ++i)
    if (s[i] == '(')
      p1[i] = p1[i - 1], p2[i] = p2[i - 1] + 1;
    else if (p2[i - 1])
      p1[i] = p1[i - 1] + 2, p2[i] = p2[i - 1] - 1;
    else
      p1[i] = p1[i - 1], p2[i] = p2[i - 1];
  for (i = n; i; --i)
    if (s[i] == ')')
      s1[i] = s1[i + 1], s2[i] = s2[i + 1] + 1;
    else if (s2[i + 1])
      s1[i] = s1[i + 1] + 2, s2[i] = s2[i + 1] - 1;
    else
      s1[i] = s1[i + 1], s2[i] = s2[i + 1];
  ans = oo;
  for (i = 0; i < n; ++i) {
    op = p2[i];
    zp = i - p1[i] - op;
    zs = s2[i + 1];
    os = n - i - s1[i + 1] - zs;
    len = n + zs + op + max(os, zp) - min(os, zp);
    if (ans > len) st.clear();
    if (ans >= len) ans = len, st.push_back(i);
  }
  stp[0] = 1;
  for (i = 1; i < M; ++i) stp[i] = (stp[i - 1] * 1LL * OS) % MOD;
  ho[0] = hz[0] = 0;
  for (i = 1; i < N; ++i)
    ho[i] = (ho[i - 1] + '(' * 1LL * stp[i - 1] % MOD) % MOD;
  for (i = 1; i < N; ++i)
    hz[i] = (hz[i - 1] + ')' * 1LL * stp[i - 1] % MOD) % MOD;
  h[0] = 0;
  for (i = 1; i <= n; ++i)
    h[i] = (h[i - 1] + s[i] * 1LL * stp[i - 1] % MOD) % MOD;
  mn = st[0];
  for (i = 1; i < (int)st.size(); ++i)
    if (cmp(st[i], mn)) mn = st[i];
  i = mn;
  int il, ir;
  op = p2[i];
  zp = i - p1[i] - op;
  zs = s2[i + 1];
  os = n - i - s1[i + 1] - zs;
  il = zs;
  ir = op;
  if (os > zp)
    ir += os - zp;
  else
    il += zp - os;
  for (j = 0; j < il; ++j) putchar('(');
  for (j = i + 1; j <= n; ++j) putchar(s[j]);
  for (j = 1; j <= i; ++j) putchar(s[j]);
  for (j = 0; j < ir; ++j) putchar(')');
  return 0;
}
