#include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(T a, T b) {
  ;
}
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
namespace std {
template <class S, class T>
ostream& operator<<(ostream& out, const pair<S, T>& a) {
  out << '(' << a.first << ',' << a.second << ')';
  return out;
}
}  // namespace std
long long int readL() {
  long long int res;
  scanf("%I64d", &res);
  return res;
}
void printL(long long int res) { printf("%I64d", res); }
namespace lib {
static const int MAX_K = 2000005;
static const int MAX_N = 2000005;
static int bkt[MAX_K + 1];
static void setBuckets(int* s, int n, int K, bool end) {
  for (int i = 0; i <= K; ++i) bkt[i] = 0;
  for (int i = 0; i < n; ++i) bkt[s[i]]++;
  int sum = 0;
  for (int i = 0; i <= K; ++i) {
    sum += bkt[i];
    bkt[i] = (end ? sum : sum - bkt[i]);
  }
}
static void induceSAL(const vector<bool>& t, int* SA, int* s, int n, int K,
                      bool end) {
  setBuckets(s, n, K, end);
  int j;
  for (int i = 0; i < n; ++i) {
    j = SA[i] - 1;
    if (j >= 0 && !t[j]) SA[bkt[s[j]]++] = j;
  }
}
static void induceSAS(const vector<bool>& t, int* SA, int* s, int n, int K,
                      bool end) {
  setBuckets(s, n, K, end);
  int j;
  for (int i = n - 1; i >= 0; --i) {
    j = SA[i] - 1;
    if (j >= 0 && t[j]) SA[--bkt[s[j]]] = j;
  }
}
static void SA_IS(int* s, int* SA, int n, int K) {
  vector<bool> t(n);
  t[n - 1] = 1;
  t[n - 2] = 0;
  for (int i = n - 3; i >= 0; --i) {
    if (s[i] < s[i + 1] || (s[i] == s[i + 1] && t[i + 1] == 1))
      t[i] = 1;
    else
      t[i] = 0;
  }
  setBuckets(s, n, K, true);
  for (int i = 0; i < n; ++i) SA[i] = -1;
  for (int i = 1; i < n; ++i)
    if ((i > 0 && t[i] && !t[i - 1])) SA[--bkt[s[i]]] = i;
  induceSAL(t, SA, s, n, K, false);
  induceSAS(t, SA, s, n, K, true);
  int n1 = 0;
  for (int i = 0; i < n; ++i)
    if ((SA[i] > 0 && t[SA[i]] && !t[SA[i] - 1])) SA[n1++] = SA[i];
  for (int i = n1; i < n; ++i) SA[i] = -1;
  int rank = 0, prev = -1;
  for (int i = 0; i < n1; ++i) {
    int pos = SA[i];
    bool dif = false;
    for (int d = 0; d < n; ++d) {
      if (prev == -1 || s[pos + d] != s[prev + d] ||
          t[pos + d] != t[prev + d]) {
        dif = true;
        break;
      } else if (d > 0 && ((pos + d > 0 && t[pos + d] && !t[pos + d - 1]) ||
                           (prev + d > 0 && t[prev + d] && !t[prev + d - 1])))
        break;
    }
    if (dif) {
      ++rank;
      prev = pos;
    }
    pos >>= 1;
    SA[n1 + pos] = rank - 1;
  }
  for (int i = n - 1, j = n - 1; i >= n1; --i)
    if (SA[i] >= 0) SA[j--] = SA[i];
  int *SA1 = SA, *s1 = SA + n - n1;
  if (rank < n1)
    SA_IS(s1, SA1, n1, rank - 1);
  else
    for (int i = 0; i < n1; ++i) SA1[s1[i]] = i;
  setBuckets(s, n, K, true);
  for (int i = 1, j = 0; i < n; ++i)
    if ((i > 0 && t[i] && !t[i - 1])) s1[j++] = i;
  for (int i = 0; i < n1; ++i) SA1[i] = s1[SA1[i]];
  for (int i = n1; i < n; ++i) SA[i] = -1;
  for (int i = n1 - 1, j; i >= 0; --i) {
    j = SA[i];
    SA[i] = -1;
    SA[--bkt[s[j]]] = j;
  }
  induceSAL(t, SA, s, n, K, false);
  induceSAS(t, SA, s, n, K, true);
}
static int tmp[MAX_N];
static void SA_IS(char* s, int* SA, int n) {
  for (int i = 0; i < (n); ++i) tmp[i] = s[i];
  SA_IS(tmp, SA, n, 260);
}
};  // namespace lib
static const int MAX_N = 2000005;
int sa[MAX_N];
char s[2000005];
int n;
int hei[2000005], nxt[2000005];
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i < (n); ++i) s[i + n] = s[i];
  int n2 = n * 2;
  hei[0] = 0;
  for (int i = 0; i < (n2); ++i) {
    hei[i + 1] = hei[i] + (s[i] == '(' ? 1 : -1);
  }
  priority_queue<pair<int, int> > pq;
  for (int i = 0; i < (n2); ++i) nxt[i] = n2;
  int d = hei[n];
  int dif;
  if (d >= 0)
    dif = 0;
  else
    dif = -d;
  for (int i = 0; i < (n2); ++i) {
    while (!pq.empty() && pq.top().first > hei[i] + dif) {
      nxt[pq.top().second] = i;
      pq.pop();
    }
    pq.push(make_pair(hei[i], i));
  }
  lib::SA_IS(s, sa, n * 2 + 1);
  string res;
  int p = -1;
  for (int i = 0; i < (n2 + 1); ++i) {
    if (sa[i] < n && nxt[sa[i]] >= sa[i] + n) {
      p = sa[i];
      break;
    }
  }
  if (d < 0)
    for (int i = 0; i < (-d); ++i) res += '(';
  for (int i = 0; i < (n); ++i) res += s[p + i];
  if (d > 0)
    for (int i = 0; i < (d); ++i) res += ')';
  printf("%s\n", res.c_str());
  return 0;
}
