#include <bits/stdc++.h>
using namespace std;
const int Mod = 1000000007;
class mint {
 public:
  int first;
  mint(long long second = 0) {
    second %= Mod;
    first = (int)second;
  }
};
mint operator+(mint a, mint b) {
  a.first += b.first;
  if (a.first >= Mod) a.first -= Mod;
  return a;
}
mint operator-(mint a, mint b) {
  a.first -= b.first;
  if (a.first < 0) a.first += Mod;
  return a;
}
mint operator*(mint a, mint b) { return mint((long long)a.first * b.first); }
bool operator==(mint a, mint b) { return a.first == b.first; }
bool operator!=(mint a, mint b) { return a.first != b.first; }
pair<int, int> operator+(pair<int, int> a, pair<int, int> b) {
  if (a.second < b.first)
    b.first -= a.second, a.second = 0;
  else
    a.second -= b.first, b.first = 0;
  return {a.first + b.first, a.second + b.second};
}
pair<int, int> F(char c) {
  if (c == '(')
    return {0, 1};
  else
    return {1, 0};
}
string s;
int l;
pair<int, int> Pref[1000015], Suff[1000015];
mint _H[1000015], *H = _H + 1;
mint HP = 101;
mint Hpot[1000015];
mint HL[1000015], HR[1000015];
mint Hash(int lo, int hi) {
  if (lo < 0) return HL[hi - lo + 1];
  if (lo > 2000000) return HR[hi - lo + 1];
  return H[hi] - H[lo - 1] * Hpot[hi - lo + 1];
}
mint Hash(pair<int, int> t) { return Hash(t.first, t.first + t.second - 1); }
mint Hash(int t) { return Hash(t, t); }
int LCP(int a, int b, int MaxLen) {
  int lo = 0, hi = MaxLen, mid = (lo + hi + 1) / 2;
  while (lo != hi) {
    if (Hash(a, a + mid - 1) == Hash(b, b + mid - 1))
      lo = mid;
    else
      hi = mid - 1;
    mid = (lo + hi + 1) / 2;
  }
  return lo;
}
vector<pair<int, int> > Func(int id) {
  pair<int, int> t = Suff[l - id] + Pref[id];
  return {{-2000000, t.first}, {id, l - id}, {0, id}, {3000000, t.second}};
}
bool Cmp(int id1, int id2) {
  if (id2 == -1) return true;
  vector<pair<int, int> > V1 = Func(id1), V2 = Func(id2);
  vector<int> Vp = {0};
  for (int i = 0, j = V1[0].second; i < 4; ++i, j += V1[i].second)
    Vp.push_back(j);
  for (int i = 0, j = V2[0].second; i < 4; ++i, j += V2[i].second)
    Vp.push_back(j);
  sort(Vp.begin(), Vp.end());
  vector<pair<int, int> > VV1, VV2;
  int tmp = 0;
  for (int i = 0, j = 1; i < 4; ++i) {
    while (j < (int)Vp.size() && Vp[j] <= tmp + V1[i].second) {
      VV1.push_back({V1[i].first + Vp[j - 1] - tmp, Vp[j] - Vp[j - 1]});
      ++j;
    }
    tmp += V1[i].second;
  }
  tmp = 0;
  for (int i = 0, j = 1; i < 4; ++i) {
    while (j < (int)Vp.size() && Vp[j] <= tmp + V2[i].second) {
      VV2.push_back({V2[i].first + Vp[j - 1] - tmp, Vp[j] - Vp[j - 1]});
      ++j;
    }
    tmp += V2[i].second;
  }
  for (int i = (int)(0); i < (int)(Vp.size() - 1); ++i)
    if (Hash(VV1[i]) != Hash(VV2[i])) {
      tmp = LCP(VV1[i].first, VV2[i].first, VV1[i].second);
      return Hash(VV1[i].first + tmp).first < Hash(VV2[i].first + tmp).first;
    }
  return false;
}
int main() {
  Hpot[0] = 1;
  for (int i = (int)(1); i < (int)(1000005); ++i)
    Hpot[i] = Hpot[i - 1] * HP, HL[i] = HL[i - 1] * HP + ')',
    HR[i] = HR[i - 1] * HP + '(';
  cin >> s;
  l = (int)s.size();
  for (int i = (int)(0); i < (int)(l); ++i) H[i] = H[i - 1] * HP + s[i];
  for (int i = (int)(0); i < (int)(l); ++i) Pref[i + 1] = Pref[i] + F(s[i]);
  for (int i = (int)(0); i < (int)(l); ++i)
    Suff[i + 1] = F(s[l - i - 1]) + Suff[i];
  int MinLen = l * 2;
  for (int i = (int)(0); i < (int)(l + 1); ++i) {
    pair<int, int> t = Suff[l - i] + Pref[i];
    MinLen = min(MinLen, l + t.first + t.second);
  }
  cerr << "MinLen"
       << " = " << MinLen << endl;
  int Best = -1;
  for (int i = (int)(0); i < (int)(l + 1); ++i) {
    pair<int, int> t = Suff[l - i] + Pref[i];
    if (MinLen != l + t.first + t.second) continue;
    if (Cmp(i, Best)) Best = i;
  }
  pair<int, int> r = Suff[l - Best] + Pref[Best];
  for (int i = (int)(0); i < (int)(r.first); ++i) cout << "(";
  cout << string(s.begin() + Best, s.end())
       << string(s.begin(), s.begin() + Best);
  for (int i = (int)(0); i < (int)(r.second); ++i) cout << ")";
  cout << endl;
  return 0;
}
