#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
char s[2001111];
int rk[2001111];
int r[2001111 * 3], sa[2001111 * 3], wa[2001111 * 3], wb[2001111 * 3],
    wv[2001111 * 3], ss[2001111 * 3];
struct DC_3 {
  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];
    return;
  }
  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++];
    for (int i = 0; i < n; i++) rk[sa[i]] = i;
    return;
  }
} DC;
multiset<int> S;
int val[2001111], mn[2001111];
char ans[2001111];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  copy(s, s + n, s + n);
  for (int i = 0; i < n << 1; i++) r[i] = s[i];
  DC.DC3(r, sa, (n << 1) + 1, 50);
  int tmp = 0, need = 0;
  for (int i = 0; i < n << 1; i++) {
    if (i == n) need = tmp;
    if (s[i] == '(')
      val[i] = ++tmp;
    else
      val[i] = --tmp;
    if (i < n) S.insert(val[i]);
  }
  mn[0] = *S.begin();
  int add = 0;
  for (int i = n; i < n << 1; i++) {
    S.insert(val[i]);
    S.erase(S.find(val[i - n]));
    if (s[i - n] == '(')
      add--;
    else
      add++;
    mn[i - n + 1] = *S.begin() + add;
  }
  int pos = 0;
  if (need < 0)
    tmp = need;
  else
    tmp = 0;
  for (int i = 0; i < n * 2; i++)
    if (sa[i] < n) {
      if (mn[sa[i]] - tmp >= 0) {
        pos = sa[i];
        break;
      }
    }
  int nn = 0;
  for (int i = 0; i < -need; i++) ans[nn++] = '(';
  for (int i = pos; i < pos + n; i++) ans[nn++] = (s[i]);
  for (int i = 0; i < need; i++) ans[nn++] = ')';
  ans[nn] = 0;
  add = 0;
  for (int i = 0; i < nn; i++) {
    if (ans[i] == '(')
      add++;
    else
      add--;
    if (add < 0)
      while (1)
        ;
  }
  puts(ans);
  return 0;
}
