#include <bits/stdc++.h>
using namespace std;
string str;
int deq[2000666];
int sp[2000666];
long long v1[2000666], v2[2000666];
long long p1[2000666], p2[2000666];
int a[2000666];
vector<int> P;
bool comp(int i1, int i2, int mval) {
  if (a[i1] != a[i2]) return a[i1] < a[i2];
  int pos, step;
  if (i1 > i2) swap(i1, i2);
  long long m1 = p1[i2 - i1];
  long long m2 = p2[i2 - i1];
  for (step = 1; step <= mval; step <<= 1)
    ;
  for (pos = 0; step; step >>= 1)
    if (i2 + pos + step <= mval + mval) {
      long long val1_first =
          (v1[i1] - v1[i1 + pos + step] + ((long long)666013)) %
          ((long long)666013);
      long long val2_first =
          (v2[i1] - v2[i1 + pos + step] + ((long long)111111)) %
          ((long long)111111);
      long long val1_second =
          ((v1[i2] - v1[i2 + pos + step] + ((long long)666013)) * m1) %
          ((long long)666013);
      long long val2_second =
          ((v2[i2] - v2[i2 + pos + step] + ((long long)111111)) * m2) %
          ((long long)111111);
      if (val1_first == val1_second && val2_first == val2_second) pos += step;
    }
  return a[i1 + pos] < a[i2 + pos];
}
int main() {
  cin >> str;
  int N = str.size(), suma = 0;
  int i;
  for (i = 0; i < N; ++i) {
    a[i + 1] = (str[i] == '(' ? 1 : 0);
    suma += (a[i + 1] == 1 ? 1 : -1);
    a[i + N + 1] = a[i + 1];
  }
  int val_need = min(suma, 0);
  for (i = 1; i <= N + N; ++i) sp[i] = sp[i - 1] + (a[i] == 1 ? 1 : -1);
  int j = 0, st = 1, dr = 0;
  for (i = 1; i <= N; ++i) {
    while (j < i + N - 1) {
      ++j;
      while (dr >= st && sp[deq[dr]] >= sp[j]) --dr;
      deq[++dr] = j;
    }
    while (st <= dr && deq[st] < i) ++st;
    if (sp[deq[st]] - sp[i - 1] >= val_need) P.push_back(i);
  }
  p1[0] = 1;
  p2[0] = 1;
  for (i = 1; i <= N + N; ++i) {
    p1[i] = (p1[i - 1] * 2) % ((long long)666013);
    p2[i] = (p2[i - 1] * (long long)2) % ((long long)111111);
  }
  for (i = N + N; i > 0; --i) {
    v1[i] = (v1[i + 1] + a[i] * p1[N + N - i]) % ((long long)666013);
    v2[i] = (v2[i + 1] + a[i] * p2[N + N - i]) % ((long long)111111);
  }
  int NP = P.size();
  int last_cand = P[0];
  for (i = 1; i < NP; ++i) {
    bool X = comp(last_cand, P[i], N);
    if (X == true) last_cand = P[i];
  }
  for (; suma < 0; ++suma) cout << "(";
  for (i = last_cand; i <= last_cand + N - 1; ++i)
    if (a[i])
      cout << '(';
    else
      cout << ')';
  for (; suma > 0; --suma) cout << ")";
  return 0;
}
