#include <bits/stdc++.h>
#pragma GCC target("pclmul")
using ul = std::uint32_t;
using ull = std::uint64_t;
using li = std::int32_t;
using ll = std::int64_t;
using llf = long double;
using uss = std::uint8_t;
ul n;
const ul maxn = 1e6;
char str[maxn + maxn];
std::pair<ul, li> queue[maxn + maxn + 1];
ul l, r;
ul ans[maxn + 1];
const ul maxlen = maxn + maxn - 1;
ul sa[maxlen + 1];
ul rk[maxlen + 1];
void getsa(ul n, ul sa[], ul rk[], char s[]) {
  static ul oldrk[maxlen + maxlen];
  static ul id[maxlen + 1];
  static ul cnt[maxlen + 1];
  static ul px[maxlen + 1];
  auto cmp = [&](ul x, ul y, ul w) {
    return oldrk[x] == oldrk[y] && oldrk[x + w] == oldrk[y + w];
  };
  ul i, m, p, w;
  m = ')';
  std::memset(cnt, 0, sizeof(ul) * (m + 1));
  std::memset(oldrk + n + 1, 0, sizeof(ul) * (n - 1));
  for (i = 1; i <= n; ++i) {
    ++cnt[rk[i] = s[i]];
  }
  for (ul i = 1; i <= m; ++i) {
    cnt[i] += cnt[i - 1];
  }
  for (ul i = n; i >= 1; --i) {
    sa[cnt[rk[i]]--] = i;
  }
  for (w = 1;; w <<= 1, m = p) {
    for (p = 0, i = n; i > n - w; --i) {
      id[++p] = i;
    }
    for (i = 1; i <= n; ++i) {
      if (sa[i] > w) {
        id[++p] = sa[i] - w;
      }
    }
    std::memset(cnt, 0, sizeof(ul) * (m + 1));
    for (i = 1; i <= n; ++i) {
      ++cnt[px[i] = rk[id[i]]];
    }
    for (i = 1; i <= m; ++i) {
      cnt[i] += cnt[i - 1];
    }
    for (i = n; i >= 1; --i) {
      sa[cnt[px[i]]--] = id[i];
    }
    std::memcpy(oldrk + 1, rk + 1, sizeof(ul) * n);
    for (p = 0, i = 1; i <= n; ++i) {
      rk[sa[i]] = cmp(sa[i], sa[i - 1], w) ? p : ++p;
    }
    if (p == n) {
      for (ul i = 1; i <= n; ++i) {
        sa[rk[i]] = i;
      }
      break;
    }
  }
}
int main() {
  std::scanf("%s", str + 1);
  n = std::strlen(str + 1);
  std::memcpy(str + n + 1, str + 1, n - 1);
  li sum = 0;
  for (ul i = 1; i <= n; ++i) {
    if (str[i] == '(') {
      ++sum;
    } else {
      --sum;
    }
  }
  l = 1;
  r = 0;
  ++r;
  queue[r] = std::pair<ul, li>(0, 0);
  li s2 = 0;
  li s3 = 0;
  ul mn = 1e9;
  for (ul i = 1; i <= n + n - 1; ++i) {
    if (str[i] == '(') {
      ++s2;
    } else {
      --s2;
    }
    if (i > n) {
      if (str[i - n] == '(') {
        ++s3;
      } else {
        --s3;
      }
    }
    while (r >= l && queue[r].second >= s2) {
      --r;
    }
    ++r;
    queue[r] = std::pair<ul, li>(i, s2);
    if (i >= n) {
      while (queue[l].first < i - n) {
        ++l;
      }
      ans[i - n + 1] = std::max(0, -(queue[l].second - s3 + std::max(0, -sum)));
      mn = std::min(ans[i - n + 1], mn);
    }
  }
  getsa(n + n - 1, sa, rk, str);
  ul t = 0;
  for (ul i = 1; i <= n; ++i) {
    if (ans[i] == mn) {
      if (!t) {
        t = i;
        continue;
      }
      if (rk[t] > rk[i]) {
        t = i;
      }
    }
  }
  if (sum < 0) {
    for (ul i = 1; i <= -sum; ++i) {
      std::putchar('(');
    }
  }
  for (ul i = 1; i <= mn; ++i) {
    std::putchar('(');
  }
  for (ul i = t; i <= t + n - 1; ++i) {
    std::putchar(str[i]);
  }
  for (ul i = 1; i <= mn; ++i) {
    std::putchar(')');
  }
  if (sum > 0) {
    for (ul i = 1; i <= sum; ++i) {
      std::putchar(')');
    }
  }
  std::putchar('\n');
  return 0;
}
