#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)2e6 + 10;
const int inf = (int)1e9;
const int P[] = {(int)1e9 + 7, (int)1e9 + 9};
const int Q[] = {17, 239};
int stp[2][maxn];
int h[2][maxn];
int h1[2][maxn];
int h2[2][maxn];
const int sh = 1 << 21;
int rm[2 * sh + 10];
void upd(int first, int val) {
  first += sh;
  rm[first] = val;
  while (first > 1) {
    first /= 2;
    rm[first] = min(rm[first * 2], rm[first * 2 + 1]);
  }
}
int get_min(int l, int r) {
  l += sh;
  r += sh;
  int ans = inf;
  while (l <= r) {
    ans = min(rm[l], ans);
    ans = min(rm[r], ans);
    l = (l + 1) / 2;
    r = (r - 1) / 2;
  }
  return ans;
}
char s[maxn];
int n;
int sum[maxn];
void print(pair<int, pair<int, int> > ans) {
  for (int j = 0; j < ans.first; j++) {
    printf("(");
  }
  for (int j = 0; j < n; j++) {
    printf("%c", s[ans.second.first + j]);
  }
  for (int j = 0; j < ans.second.second; j++) {
    printf(")");
  }
  printf("\n");
}
int get_c(const pair<int, pair<int, int> >& a, int l) {
  if (l < a.first) return -1;
  if (l < a.first + n) {
    return s[a.second.first + l - a.first] == '(' ? -1 : 1;
  }
  return 1;
}
pair<int, int> get_hash(const pair<int, pair<int, int> >& a, int l) {
  if (l <= a.first) {
    return make_pair(h1[0][l], h1[1][l]);
  }
  if (l <= a.first + n) {
    int l2 = l - a.first;
    pair<int, int> H1 = make_pair(h1[0][a.first], h1[1][a.first]);
    pair<int, int> H2 =
        make_pair(((h[0][a.second.first] -
                    (long long)h[0][a.second.first + l2] * stp[0][l2]) %
                       P[0] +
                   P[0]) %
                      P[0],
                  ((h[1][a.second.first] -
                    (long long)h[1][a.second.first + l2] * stp[1][l2]) %
                       P[1] +
                   P[1]) %
                      P[1]);
    return make_pair(
        (H1.first + (long long)H2.first * stp[0][a.first]) % P[0],
        (H1.second + (long long)H2.second * stp[1][a.first]) % P[1]);
  }
  {
    int l2 = l - a.first - n;
    pair<int, int> H1 = get_hash(a, a.first + n);
    pair<int, int> H2 = make_pair(h2[0][l2], h2[1][l2]);
    ;
    return make_pair(
        (H1.first + (long long)H2.first * stp[0][a.first + n]) % P[0],
        (H1.second + (long long)H2.second * stp[1][a.first + n]) % P[1]);
  }
}
bool super_less(const pair<int, pair<int, int> >& a,
                const pair<int, pair<int, int> >& b) {
  if (a.first + a.second.second != b.first + b.second.second) {
    return a.first + a.second.second < b.first + b.second.second;
  }
  int l = 0;
  int r = a.first + a.second.second + n;
  while (l < r) {
    int m = (l + r + 1) / 2;
    if (get_hash(a, m) == get_hash(b, m)) {
      l = m;
    } else {
      r = m - 1;
    }
  }
  if (r == a.first + a.second.second + n) {
    return false;
  }
  return get_c(a, l) < get_c(b, l);
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i < n; i++) {
    s[i + n] = s[i];
  }
  stp[0][0] = 1;
  stp[1][0] = 1;
  for (int j = 0; j < 2; j++) {
    for (int i = 1; i <= 2 * n; i++) {
      stp[j][i] = ((long long)stp[j][i - 1] * Q[j]) % P[j];
    }
  }
  for (int j = 0; j < 2; j++) {
    h[j][2 * n] = 0;
    for (int i = 2 * n - 1; i >= 0; i--) {
      h[j][i] = ((long long)h[j][i + 1] * Q[j] + (s[i] == '(' ? 1 : 2)) % P[j];
    }
  }
  for (int j = 0; j < 2; j++) {
    h1[j][0] = 0;
    h2[j][0] = 0;
    for (int i = 1; i <= 2 * n; i++) {
      h1[j][i] = ((long long)h1[j][i - 1] * Q[j] + 1) % P[j];
      h2[j][i] = ((long long)h2[j][i - 1] * Q[j] + 2) % P[j];
    }
  }
  sum[0] = 0;
  for (int i = 0; i < 2 * n; i++) {
    if (s[i] == '(') {
      sum[i + 1] = sum[i] + 1;
    } else {
      sum[i + 1] = sum[i] - 1;
    }
  }
  for (int i = 0; i <= 2 * n; i++) {
    upd(i, sum[i]);
  }
  pair<int, pair<int, int> > ans = make_pair(inf, make_pair(0, inf));
  for (int i = 0; i < n; i++) {
    int mn = min(0, get_min(i, i + n) - sum[i]);
    int add_beg = abs(mn);
    int add_end = sum[i + n] + add_beg - sum[i];
    pair<int, pair<int, int> > res = make_pair(add_beg, make_pair(i, add_end));
    if (super_less(res, ans)) {
      ans = res;
    }
  }
  print(ans);
  return 0;
}
