#include <bits/stdc++.h>
using namespace std;
const int N = 4000010;
inline int read() {
  int x = 0;
  int f = 0, c = getchar();
  for (; c > '9' || c < '0'; f = c == '-', c = getchar())
    ;
  for (; c >= '0' && c <= '9'; c = getchar()) x = (x << 3) + (x << 1) + c - '0';
  return f ? -x : x;
}
struct cqz {
  int i, x, y;
  cqz(int a = 0, int b = 0, int c = 0) {
    i = a;
    x = b;
    y = c;
  }
} a[N];
inline bool operator<(const cqz& i, const cqz& j) {
  return i.x < j.x || (i.x == j.x && i.y < j.y);
}
inline bool operator!=(const cqz& i, const cqz& j) {
  return i.x != j.x || i.y != j.y;
}
char s[N];
int sta[N], top, p[N];
int n, m, rk[N], sm, sl, sr, ans, flag;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  m = n;
  register int i, j, k;
  for (i = 1; i <= n; i++) s[i + n] = s[i];
  n = n + n;
  for (i = 1; i <= n; i++) rk[i] = s[i];
  for (k = 1; k < n; k <<= 1) {
    for (i = 1; i <= n; i++) a[i] = cqz(i, rk[i], rk[i + k]);
    sort(a + 1, a + n + 1);
    for (i = j = 1; i <= n; i++) rk[a[i].i] = j, j += a[i + 1] != a[i];
    if (j >= n) break;
  }
  for (i = n - 1; i > m; i--)
    if (s[i] == '(') {
      if (sl)
        sm++, sl--;
      else
        sr++;
    } else
      sl++;
  k = n + n;
  for (i = 1; i <= n; i++)
    if (s[i] == '(')
      sta[++top] = i;
    else {
      p[i] = sta[top];
      if (top) top--;
    }
  for (i = m; i; i--) {
    if (s[i] == '(') {
      if (sl)
        sm++, sl--;
      else
        sr++;
    } else
      sl++;
    if (!sl || !sr) {
      flag = sl - sr;
      if (rk[i] < k) ans = i, k = rk[i];
    }
    if (s[i + m - 1] == '(')
      sr--;
    else {
      if (p[i + m - 1] > i)
        sm--, sr++;
      else
        sl--;
    }
  }
  if (flag > 0)
    while (flag) putchar('('), flag--;
  for (i = 0; i < m; i++) putchar(s[ans + i]);
  if (flag < 0)
    while (flag++) putchar(')');
  puts("");
  return 0;
}
