#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e6 + 1000;
int t1, t2;
int lr[MAXN];
int ll[MAXN];
int rl[MAXN];
int rr[MAXN];
bool check(int i) {
  if (i == 0) {
    return rr[i] == t1 && rl[i] == t2;
  }
  int tl, tr;
  tr = rr[i];
  tl = ll[i - 1];
  int tmin = min(rl[i], lr[i - 1]);
  tl += rl[i] - tmin;
  tr += lr[i - 1] - tmin;
  if (tr == t1 && tl == t2) return true;
  return false;
}
struct SA {
  int rank[MAXN], height[MAXN];
  int len;
  inline int ge(char a) {
    if (a == '(')
      return 1;
    else if (a == ')')
      return 2;
    else
      return 0;
  }
  int sa[MAXN];
  int wa[MAXN], wb[MAXN], wv[MAXN], ws[MAXN];
  int cmp(int *r, int a, int b, int l) {
    return r[a] == r[b] && r[a + l] == r[b + l];
  }
  void da(char *r, int *sa, int n, int m) {
    int i, j, p, *x = wa, *y = wb, *t;
    for (i = 0; i < m; i++) ws[i] = 0;
    for (i = 0; i < n; i++) ws[x[i] = ge(r[i])]++;
    for (i = 1; i < m; i++) ws[i] += ws[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--ws[x[i]]] = i;
    for (j = 1, p = 1; p < n; j *= 2, m = p) {
      for (p = 0, i = n - j; i < n; i++) y[p++] = i;
      for (i = 0; i < n; i++)
        if (sa[i] >= j) y[p++] = sa[i] - j;
      for (i = 0; i < n; i++) wv[i] = x[y[i]];
      for (i = 0; i < m; i++) ws[i] = 0;
      for (i = 0; i < n; i++) ws[wv[i]]++;
      for (i = 1; i < m; i++) ws[i] += ws[i - 1];
      for (i = n - 1; i >= 0; i--) sa[--ws[wv[i]]] = y[i];
      for (t = x, x = y, y = t, p = 1, x[sa[0]] = 0, i = 1; i < n; i++)
        x[sa[i]] = cmp(y, sa[i - 1], sa[i], j) ? p - 1 : p++;
    }
    return;
  }
  int solve(char *s) {
    len = strlen(s);
    s[len] = 0;
    da(s, sa, len + 1, 3);
    for (int i = 0; i < len + 1; ++i) {
      if (sa[i] < len / 2 && check(sa[i])) {
        return sa[i];
      }
    }
    return -1;
  }
} tq;
char s[MAXN];
int main() {
  while (scanf("%s", s) != EOF) {
    memset(lr, 0, sizeof lr);
    memset(ll, 0, sizeof ll);
    memset(rr, 0, sizeof rr);
    memset(rl, 0, sizeof rl);
    int len = strlen(s);
    t1 = 0, t2 = 0;
    for (int i = 0; i < len; ++i) {
      s[i + len] = s[i];
      if (s[i] == '(') {
        ++t1;
      } else {
        ++t2;
      }
    }
    int tn = min(t1, t2);
    t1 -= tn, t2 -= tn;
    swap(t1, t2);
    s[len * 2] = '\0';
    int tl = 0, tr = 0;
    for (int i = 0; i < len; ++i) {
      if (s[i] == '(') {
        ++tl;
      } else {
        if (tl == 0)
          ++tr;
        else
          --tl;
      }
      lr[i] = tr;
      ll[i] = tl;
    }
    tl = tr = 0;
    for (int i = len - 1; i >= 0; --i) {
      if (s[i] == ')') {
        ++tr;
      } else {
        if (tr == 0)
          ++tl;
        else
          --tr;
      }
      rr[i] = tr;
      rl[i] = tl;
    }
    for (int i = 0; i < t1; ++i) putchar('(');
    int tmp = tq.solve(s);
    for (int i = 0; i < len; ++i) {
      putchar(s[i + tmp]);
    }
    for (int i = 0; i < t2; ++i) putchar(')');
    puts("");
  }
  return 0;
}
