#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 1;
const long long INF = ~0ULL >> 1;
const int mn = 2100000;
char s[mn];
int N, Index, l1, l2, SA[mn], wv[mn], wa[mn * 2], wb[mn * 2], Rank[mn * 2],
    cnt[mn], Height[mn];
inline bool cmp(const int &a, const int &b) { return s[a] < s[b]; }
void Suffix_Array(int N, int M) {
  int *x = wa, *y = wb, *t;
  int p = 1;
  N++;
  for (int i = (0); i <= (N - 1); ++i) SA[i] = i;
  sort(SA, SA + N, cmp);
  for (int i = (1); i <= (N - 1); ++i)
    x[SA[i]] = (s[SA[i]] > s[SA[i - 1]]) ? (p++) : x[SA[i - 1]];
  for (int k = 1;; k <<= 1) {
    int n = 0;
    for (int i = (N - k); i < (N); ++i) y[n++] = i;
    for (int i = (0); i < (N); ++i)
      if (SA[i] >= k) y[n++] = SA[i] - k;
    for (int i = (0); i < (N); ++i) wv[i] = x[y[i]];
    for (int i = (0); i < (p); ++i) cnt[i] = 0;
    for (int i = (0); i < (N); ++i) cnt[wv[i]]++;
    for (int i = (1); i < (p); ++i) cnt[i] += cnt[i - 1];
    for (int i = (N - 1); i >= (0); --i) SA[--cnt[wv[i]]] = y[i];
    p = 1;
    swap(x, y);
    x[SA[0]] = 0;
    for (int i = (1); i <= (N - 1); ++i) {
      if (y[SA[i]] == y[SA[i - 1]] && y[SA[i] + k] == y[SA[i - 1] + k])
        x[SA[i]] = p - 1;
      else
        x[SA[i]] = p++;
    }
    if (p == N) break;
  }
  N--;
}
pair<int, int> t[2000000 * 4 + 100000];
void build(int p, int l, int r) {
  if (l == r) {
    t[p] = (s[l] == '(') ? make_pair(1, 0) : make_pair(-1, -1);
    return;
  }
  build(p << 1, l, l + r >> 1);
  build(p << 1 | 1, (l + r >> 1) + 1, r);
  t[p] =
      make_pair(t[p << 1].first + t[p << 1 | 1].first,
                min(t[p << 1].second, t[p << 1].first + t[p << 1 | 1].second));
}
pair<int, int> query(int p, int L, int R, int l, int r) {
  if (L == l && R == r) return t[p];
  int m = L + R >> 1;
  if (r <= m)
    return query(p << 1, L, m, l, r);
  else if (l > m)
    return query(p << 1 | 1, m + 1, R, l, r);
  else {
    pair<int, int> left = query(p << 1, L, m, l, m);
    pair<int, int> right = query(p << 1 | 1, m + 1, R, m + 1, r);
    return make_pair(left.first + right.first,
                     min(left.second, left.first + right.second));
  }
}
int L, cntl, cntr, addl, addr;
int main() {
  gets(s);
  N = strlen(s);
  for (int i = (N); i <= (2 * N - 1); ++i) s[i] = s[i - N];
  L = N;
  N <<= 1;
  for (int i = (0); i < (L); ++i)
    if (s[i] == '(')
      cntl++;
    else
      cntr++;
  if (cntl > cntr)
    addr = cntl - cntr;
  else
    addl = cntr - cntl;
  build(1, 0, N - 1);
  for (int i = (0); i < (N); ++i)
    if (s[i] == '(')
      s[i] = 1;
    else
      s[i] = 2;
  Suffix_Array(N, 3);
  for (int i = (1); i <= (N); ++i)
    if (SA[i] < L &&
        addl + query(1, 0, N - 1, SA[i], SA[i] + L - 1).second >= 0) {
      for (int k = (1); k <= (addl); ++k) putchar('(');
      for (int k = (SA[i]); k <= (SA[i] + L - 1); ++k)
        putchar((s[k] == 2) ? ')' : '(');
      for (int k = (1); k <= (addr); ++k) putchar(')');
      puts("");
      return 0;
    }
  return 0;
}
