#include <bits/stdc++.h>
using namespace std;
char s[1000100];
int a[2000100], add[8000100], min_[8000100], ans[2000100];
int rk[2000100], rkk[2000100], cnt[2000100], tp[2000100], tpp[2000100];
void pushdown(int rt) {
  add[rt << 1] += add[rt];
  min_[rt << 1] += add[rt];
  add[rt << 1 | 1] += add[rt];
  min_[rt << 1 | 1] += add[rt];
  add[rt] = 0;
}
int query(int L, int R, int l, int r, int rt) {
  if (L <= l && r <= R) return min_[rt];
  int m = l + r >> 1, ans = 998244353;
  pushdown(rt);
  if (m >= L) ans = min(ans, query(L, R, l, m, rt << 1));
  if (m < R) ans = min(ans, query(L, R, m + 1, r, rt << 1 | 1));
  return ans;
}
void pushup(int rt) { min_[rt] = min(min_[rt << 1], min_[rt << 1 | 1]); }
void build(int l, int r, int rt) {
  if (l == r) {
    min_[rt] = a[l];
    return;
  }
  int m = l + r >> 1;
  build(l, m, rt << 1);
  build(m + 1, r, rt << 1 | 1);
  pushup(rt);
}
void update(int L, int R, int c, int l, int r, int rt) {
  if (L <= l && r <= R) {
    min_[rt] += c;
    add[rt] += c;
    return;
  }
  pushdown(rt);
  int m = l + r >> 1;
  if (m >= L) update(L, R, c, l, m, rt << 1);
  if (m < R) update(L, R, c, m + 1, r, rt << 1 | 1);
  pushup(rt);
}
int main() {
  scanf("%s", s);
  int n = strlen(s);
  int i, t, sum = 0, cntl = 0, cntr = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '(')
      t = 1, cntl++;
    else
      t = -1, cntr++;
    sum += t;
    a[n + i] = sum;
  }
  build(1, n << 1, 1);
  int del, temp;
  if (cntl < cntr)
    del = cntr - cntl;
  else
    del = 0;
  for (i = 0; i < n; i++) {
    if (query(n - i, (n << 1) - i - 1, 1, n << 1, 1) + del < 0)
      ans[(n - i) % n] = 0;
    else
      ans[(n - i) % n] = 1;
    if (s[n - i - 1] == '(')
      temp = 1;
    else
      temp = -1;
    if (i + 1 != n) update(n - i - 1, (n << 1) - i - 2, temp, 1, n << 1, 1);
  }
  for (i = 0; i < n; i++) {
    cnt[s[i] - 39]++;
  }
  for (i = 1; i <= 2; i++) {
    cnt[i] += cnt[i - 1];
  }
  for (i = n - 1; i >= 0; i--) {
    tpp[--cnt[s[i] - 39]] = i;
  }
  rk[tpp[0]] = 1;
  for (i = 1; i < n; i++) {
    if (s[tpp[i]] == s[tpp[i - 1]])
      rk[tpp[i]] = rk[tpp[i - 1]];
    else
      rk[tpp[i]] = rk[tpp[i - 1]] + 1;
  }
  int j;
  for (i = 1; i < n; i <<= 1) {
    if (rk[tpp[n - 1]] == n) break;
    for (j = 0; j < n; j++) {
      tp[j] = (tpp[j] + n - i) % n;
    }
    memset(cnt, 0, sizeof(cnt));
    for (j = 0; j < n; j++) {
      cnt[rk[j]]++;
    }
    for (j = 1; j <= n; j++) {
      cnt[j] += cnt[j - 1];
    }
    for (j = n - 1; j >= 0; j--) {
      tpp[--cnt[rk[tp[j]]]] = tp[j];
    }
    rkk[tpp[0]] = 1;
    for (j = 1; j < n; j++) {
      if (rk[tpp[j]] == rk[tpp[j - 1]] &&
          rk[(tpp[j] + i) % n] == rk[(tpp[j - 1] + i) % n])
        rkk[tpp[j]] = rkk[tpp[j - 1]];
      else
        rkk[tpp[j]] = rkk[tpp[j - 1]] + 1;
    }
    memcpy(rk, rkk, sizeof(rk));
  }
  int fin;
  for (i = 0; i < n; i++) {
    if (ans[tpp[i]]) {
      fin = tpp[i];
      break;
    }
  }
  if (cntl < cntr) {
    while (cntl < cntr) putchar('('), cntl++;
    for (i = 0; i < n; i++) putchar(s[(i + fin) % n]);
  } else {
    for (i = 0; i < n; i++) putchar(s[(i + fin) % n]);
    while (cntr < cntl) putchar(')'), cntr++;
  }
  return 0;
}
