#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200000000")
using namespace std;
template <typename T>
inline T Abs(T x) {
  return (x >= 0) ? x : -x;
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
inline string toStr(T x) {
  stringstream st;
  st << x;
  string s;
  st >> s;
  return s;
}
template <typename T>
inline int bit(T mask, int b) {
  return (b >= 0 && (mask & (T(1) << b)) != 0) ? 1 : 0;
}
inline int nextInt() {
  int x;
  if (scanf("%d", &x) != 1) throw;
  return x;
}
inline long long nextInt64() {
  long long x;
  if (scanf("%lld", &x) != 1) throw;
  return x;
}
inline double nextDouble() {
  double x;
  if (scanf("%lf", &x) != 1) throw;
  return x;
}
const int INF = (int)1E9;
const long long INF64 = (long long)1E18;
const long double EPS = 1E-9;
const long double PI = 3.1415926535897932384626433832795;
const int MAXN = 3001000;
struct state {
  state() {}
  state(int a, int b, int i) : a(a), b(b), id(i) {}
  bool operator<(const state& s) const {
    if (a != s.a) return a < s.a;
    if (b != s.b) return b < s.b;
    return id < s.id;
  }
  bool operator!=(const state& s) const { return a != s.a || b != s.b; }
  int a, b, id;
};
int n, b[MAXN], fw[MAXN], p[MAXN];
multiset<int> ms;
state v[MAXN];
char s[MAXN];
struct answer {
  answer(int b, int a, int i) : before(b), after(a), id(i) {}
  bool operator<(const answer& a) const {
    if (before + after != a.before + a.after)
      return before + after < a.before + a.after;
    if (before + fw[id] != a.before + fw[a.id])
      return before + fw[id] > a.before + fw[a.id];
    return p[(id + fw[id]) % n] < p[(a.id + fw[a.id]) % n];
  }
  int before, after, id;
};
int getms(int v) {
  int prv = (v == 0) ? 0 : b[v - 1];
  return max(0, prv - (*ms.begin()));
}
int sum(int before, int v) {
  int prv = (v == 0) ? 0 : b[v - 1];
  return b[v + n - 1] - prv + before;
}
void go(int v) {
  ms.erase(ms.find(b[v]));
  ms.insert(b[v + n]);
}
int main() {
  cout.setf(ios::fixed);
  cout.precision(10);
  double _startTime = clock();
  scanf(" %s", s);
  n = int(strlen(s));
  for (int i = 0; i < (int)(n); i++) {
    s[i + n] = s[i];
  }
  int bal = 0;
  for (int i = 0; i < (int)(2 * n); i++) {
    if (s[i] == '(') {
      p[i] = 0;
      ++bal;
    } else {
      p[i] = 1;
      --bal;
    }
    b[i] = bal;
  }
  for (int i = (int)(n)-1; i >= 0; i--) {
    ms.insert(b[i]);
    if (s[i] == '(') {
      fw[i] = fw[i + 1] + 1;
    }
  }
  int k = 1;
  while (k < n) {
    for (int i = 0; i < (int)(n); i++) {
      v[i] = state(p[i], p[(i + k) % n], i);
    }
    int cur = 0;
    sort(v, v + n);
    for (int i = 0; i < (int)(n); i++) {
      p[v[i].id] = cur;
      if (v[i] != v[i + 1]) {
        ++cur;
      }
    }
    if (cur == n - 1) break;
    k *= 2;
  }
  answer ans(INF, INF, -1);
  for (int i = 0; i < (int)(n); i++) {
    int before = getms(i);
    answer cur(before, sum(before, i), i);
    ans = min(ans, cur);
    go(i);
  };
  cout << string(size_t(ans.before), '(');
  for (int i = 0; i < (int)(n); i++) {
    cout << s[ans.id + i];
  }
  cout << string(size_t(ans.after), ')') << endl;
  cerr << "Elapsed " << (clock() - _startTime) / CLOCKS_PER_SEC << " s" << endl;
  return 0;
};
