#include <bits/stdc++.h>
using namespace std;
inline long long pow(long long a, long long b, long long mo) {
  if (!a) return 0;
  long long tmp = 1;
  for (; b; b >>= 1) {
    if (b & 1) tmp = (long long)tmp * a % mo;
    a = (long long)a * a % mo;
  }
  return tmp;
}
template <class T>
inline void R(T &xx) {
  xx = 0;
  char ch = getchar();
  bool F = 0;
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') F = 1, ch = getchar();
  while (ch >= '0' && ch <= '9')
    xx = xx + xx + (xx << 3) + ch - 48, ch = getchar();
  if (F) xx = -xx;
}
char s[2000011];
int n;
int w[2000011], wa[2000011], wb[2000011], sa[2000011], r[2000011];
void da(char a[], int n, int m) {
  int p, *x = wa, *y = wb;
  n++;
  for (int i = (0); i <= (m); i++) w[i] = 0;
  for (int i = 0; i < (int)(n); i++) w[r[i] = a[i]]++;
  for (int i = (1); i <= (m); i++) w[i] += w[i - 1];
  for (int i = 0; i < (int)(n); i++) sa[--w[a[i]]] = i;
  for (int j = 1;; j <<= 1, m = p) {
    p = 0;
    for (int i = (n - j); i < (int)(n); i++) y[p++] = i;
    for (int i = 0; i < (int)(n); i++)
      if (sa[i] >= j) y[p++] = sa[i] - j;
    for (int i = (0); i <= (m); i++) w[i] = 0;
    for (int i = 0; i < (int)(n); i++) w[r[i]]++;
    for (int i = (1); i <= (m); i++) w[i] += w[i - 1];
    for (int i = (n)-1; ~i; i--) sa[--w[r[y[i]]]] = y[i];
    for (int i = 0; i < (int)(n); i++) x[i] = r[i];
    p = 1;
    r[sa[0]] = 0;
    for (int i = (1); i < (int)(n); i++)
      r[sa[i]] = (x[sa[i]] == x[sa[i - 1]] && x[sa[i] + j] == x[sa[i - 1] + j])
                     ? p - 1
                     : p++;
    if (p == n) break;
  }
}
pair<int, int> seg[2000011 << 2];
void build(int p, int l, int r) {
  if (l == r) {
    seg[p] = (s[l] == 1) ? make_pair(1, 0) : make_pair(-1, -1);
    return;
  }
  int mid = l + r >> 1;
  build((p << 1), l, mid);
  build((p << 1 | 1), mid + 1, r);
  seg[p] = make_pair(seg[(p << 1)].first + seg[(p << 1 | 1)].first,
                     min(seg[(p << 1)].second,
                         seg[(p << 1)].first + seg[(p << 1 | 1)].second));
}
pair<int, int> que(int p, int l, int r, int L, int R) {
  if (L <= l && R >= r) return seg[p];
  int mid = l + r >> 1;
  if (R <= mid) return que((p << 1), l, mid, L, R);
  if (L > mid) return que((p << 1 | 1), mid + 1, r, L, R);
  pair<int, int> le = que((p << 1), l, mid, L, R),
                 ri = que((p << 1 | 1), mid + 1, r, L, R);
  return make_pair(le.first + ri.first, min(le.second, le.first + ri.second));
}
int main() {
  gets(s);
  int l = n = strlen(s);
  for (int i = 0; i < (int)(n); i++) s[i + n] = (s[i] = (s[i] == '(' ? 1 : 2));
  n <<= 1;
  da(s, n, 3);
  int cnt = 0, addl = 0, addr = 0;
  for (int i = 0; i < (int)(l); i++)
    if (s[i] == 1)
      cnt++;
    else
      cnt--;
  if (cnt > 0)
    addr = cnt;
  else
    addl = -cnt;
  build(1, 0, n - 1);
  for (int i = (1); i <= (n); i++)
    if (sa[i] < l &&
        addl + que(1, 0, n - 1, sa[i], sa[i] + l - 1).second >= 0) {
      for (int j = 0; j < (int)(addl); j++) putchar('(');
      for (int j = (sa[i]); j <= (sa[i] + l - 1); j++)
        putchar((s[j] == 2) ? ')' : '(');
      for (int j = 0; j < (int)(addr); j++) putchar(')');
      puts("");
      return 0;
    }
  return 0;
}
