#include <bits/stdc++.h>
using namespace std;
const int nmax = 2000005;
const int lmax = 21;
int n, i, N, val, add, A, B, mlc, sol;
int can[nmax], sum[nmax];
int sa[lmax][nmax], ord[nmax];
char s[nmax];
deque<int> q;
struct piece {
  int x, y, i;
  bool operator<(const piece &a) const {
    if (x == a.x) return y < a.y;
    return x < a.x;
  }
};
piece L[nmax];
void find_candidates() {
  for (i = 1; i < N; i++) {
    while (!q.empty() && sum[i] < sum[q.back()]) q.pop_back();
    q.push_back(i);
    if (q.front() == i - n) q.pop_front();
    if (i > n) {
      if (s[i - n] == '(')
        add--;
      else
        add++;
    }
    if (i >= n && sum[q.front()] + add + mlc >= 0) can[i - n + 1] = 1;
  }
}
void suffix_arrays() {
  for (i = 1; i <= N; i++) sa[0][i] = s[i] - '(';
  int step, cnt;
  for (step = 1, cnt = 1; (1 << step) <= N; step++, cnt *= 2) {
    for (i = 1; i <= N; i++) {
      L[i].x = sa[step - 1][i];
      if (i + cnt <= N)
        L[i].y = sa[step - 1][i + cnt];
      else
        L[i].y = -1;
      L[i].i = i;
    }
    sort(L + 1, L + N + 1);
    for (i = 1; i <= N; i++) {
      if (i > 1 && L[i].x == L[i - 1].x && L[i].y == L[i - 1].y)
        sa[step][L[i].i] = sa[step][L[i - 1].i];
      else
        sa[step][L[i].i] = i;
    }
  }
  for (i = 1; i <= N; i++) ord[sa[step - 1][i]] = i;
}
int main() {
  cin.sync_with_stdio(false);
  cin >> s + 1;
  n = strlen(s + 1);
  for (i = 1; i <= n; i++) s[i + n] = s[i];
  N = 2 * n;
  for (i = 1; i <= N; i++) {
    if (s[i] == '(')
      val = 1;
    else
      val = -1;
    sum[i] = sum[i - 1] + val;
  }
  for (i = 1; i <= n; i++) {
    if (s[i] == '(')
      A++;
    else
      B++;
  }
  if (B > A) mlc = B - A;
  find_candidates();
  suffix_arrays();
  for (i = 1; i <= N; i++)
    if (can[ord[i]]) {
      sol = ord[i];
      break;
    }
  s[n + 1] = '\0';
  if (A >= B) {
    cout << s + sol;
    s[sol] = '\0';
    cout << s + 1;
    for (i = 1; i <= A - B; i++) cout << ')';
  } else {
    for (i = 1; i <= B - A; i++) cout << '(';
    cout << s + sol;
    s[sol] = '\0';
    cout << s + 1;
  }
  return 0;
}
