#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 4, sz = 1 << 20, inf = 1e9;
struct node {
  int c1, c2, id;
  node() { c1 = c2 = id = 0; }
  node(const int &cc1, const int &cc2, const int &cid) {
    c1 = cc1;
    c2 = cc2;
    id = cid;
  }
};
inline bool operator<(const node &lhs, const node &rhs) {
  if (lhs.c1 == rhs.c1) return lhs.c2 < rhs.c2;
  return lhs.c1 < rhs.c1;
}
inline bool operator==(const node &lhs, const node &rhs) {
  return lhs.c1 == rhs.c1 && lhs.c2 == rhs.c2;
}
string s;
vector<node> v;
int c[N];
int t[sz + sz];
int moment[N];
int best = -1;
inline void upd(int x, const int &delta) {
  t[x += sz] = delta;
  while (x >>= 1) t[x] = min(t[x << 1], t[(x << 1) | 1]);
}
inline int get(int l, int r) {
  int res = inf;
  for (l += sz, r += sz; l <= r; l >>= 1, r >>= 1) {
    if (l & 1) res = min(res, t[l++]);
    if (!(r & 1)) res = min(res, t[r--]);
  }
  return res;
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin >> s;
  int n = s.size();
  v.resize(n);
  for (int i = 0; i < n; ++i) v[i] = node(s[i], s[i], i);
  sort(v.begin(), v.end());
  int cnt = 0;
  c[v[0].id] = ++cnt;
  for (int i = 1; i < n; ++i)
    if (v[i] == v[i - 1])
      c[v[i].id] = c[v[i - 1].id];
    else
      c[v[i].id] = ++cnt;
  for (int k = 0; (1 << k) <= n; ++k) {
    for (int i = 0; i < n; ++i) v[i] = node(c[i], c[(i + (1 << k)) % n], i);
    sort(v.begin(), v.end());
    cnt = 0;
    c[v[0].id] = ++cnt;
    for (int i = 1; i < n; ++i)
      if (v[i] == v[i - 1])
        c[v[i].id] = c[v[i - 1].id];
      else
        c[v[i].id] = ++cnt;
  }
  int balance = 0;
  for (int i = 0; i < n; ++i) {
    balance += (s[i] == ')' ? -1 : +1);
    moment[i] = balance;
    upd(i, balance);
  }
  for (int i = 0; i < n; ++i) {
    if (i == 0 && (max(0, -balance) + get(0, n - 1) < 0))
      continue;
    else if (((-moment[i - 1] + get(i, n - 1) + max(0, -balance) < 0) ||
              (-moment[i - 1] + moment[n - 1] + get(0, i - 1) +
                   max(0, -balance) <
               0)))
      continue;
    if (best == -1 || c[best] > c[i]) best = i;
  }
  while (balance < 0) {
    cout << "(";
    ++balance;
  }
  for (int j = best; j < n; ++j) cout << s[j];
  for (int j = 0; j < best; ++j) cout << s[j];
  while (balance > 0) {
    cout << ")";
    --balance;
  }
  return 0;
}
