#include <bits/stdc++.h>
using namespace std;
bool hadDebugEnv = false;
bool isDebugEnv = false;
bool isDebug() {
  if (!hadDebugEnv) {
    hadDebugEnv = true;
    isDebugEnv = (getenv("SWATMAD_CF_DEBUG") != NULL);
  }
  return isDebugEnv;
}
chrono::high_resolution_clock::time_point timeStart;
const int INF = numeric_limits<int>::max();
const long long LLINF = numeric_limits<long long>::max();
std::bitset<32> bits(int x) { return std::bitset<32>(x); }
template <class F, class S>
ostream& operator<<(ostream& o, const pair<F, S>& p) {
  return o << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& a);
template <class C>
void csp(ostream& o, const C& c) {
  bool f = 1;
  for (const auto& x : c) {
    if (!f) o << ", ";
    f = 0;
    o << x;
  }
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& a) {
  o << "[";
  csp(o, a);
  o << "]";
  return o;
}
template <class T>
ostream& operator<<(ostream& o, const deque<T>& a) {
  o << "[";
  csp(o, a);
  o << "]";
  return o;
}
template <class T>
ostream& operator<<(ostream& o, const vector<vector<T>>& a) {
  for (const auto& x : a) {
    o << "[";
    csp(o, x);
    o << "]\n";
  }
  return o;
}
template <class T, class R>
ostream& operator<<(ostream& o, const map<T, R>& a) {
  o << "{";
  csp(o, a);
  o << "}";
  return o;
}
template <class T, class R>
ostream& operator<<(ostream& o, const unordered_map<T, R>& a) {
  o << "{";
  csp(o, a);
  o << "}";
  return o;
}
template <class T>
ostream& operator<<(ostream& o, const set<T>& a) {
  o << "{";
  csp(o, a);
  o << "}";
  return o;
}
template <class T>
ostream& operator<<(ostream& o, const unordered_set<T>& a) {
  o << "{";
  csp(o, a);
  o << "}";
  return o;
}
vector<int> sufArray(const string& s) {
  vector<int> p(s.length(), 0);
  vector<int> c(s.length(), 0);
  set<char> alphabet;
  map<char, int> id;
  for (const auto& x : s) {
    alphabet.insert(x);
  }
  int maxId = 0;
  for (const auto& x : alphabet) {
    id[x] = maxId++;
  }
  vector<int> cnt(alphabet.size(), 0);
  for (int i = 0; i < (int)(s.length()); ++i) {
    ++cnt[id[s[i]]];
  }
  if (isDebug()) {
    cerr << cnt << endl;
  };
  for (int i = (int)(1); i < (int)(alphabet.size()); ++i) {
    cnt[i] += cnt[i - 1];
  }
  for (int i = 0; i < (int)(s.length()); ++i) {
    p[--cnt[id[s[i]]]] = i;
  }
  c[p[0]] = 0;
  int classes = 1;
  for (int i = (int)(1); i < (int)(s.length()); ++i) {
    if (s[p[i]] != s[p[i - 1]]) {
      ++classes;
    }
    c[p[i]] = classes - 1;
  }
  vector<int> pn(s.length(), 0);
  vector<int> cn(s.length(), 0);
  for (int h = 0; (1 << h) < s.length(); ++h) {
    for (int i = 0; i < (int)(s.length()); ++i) {
      pn[i] = p[i] - (1 << h);
      if (pn[i] < 0) {
        pn[i] += s.length();
      }
    }
    cnt.assign(classes, 0);
    for (int i = 0; i < (int)(s.length()); ++i) {
      ++cnt[c[pn[i]]];
    }
    for (int i = (int)(1); i < (int)(classes); ++i) {
      cnt[i] += cnt[i - 1];
    }
    for (int i = (int)(s.length()) - 1; i >= 0; --i) {
      p[--cnt[c[pn[i]]]] = pn[i];
    }
    cn[p[0]] = 0;
    classes = 1;
    for (int i = (int)(1); i < (int)(s.length()); ++i) {
      int mid1 = (p[i] + (1 << h)) % s.length();
      int mid2 = (p[i - 1] + (1 << h)) % s.length();
      if (c[p[i]] != c[p[i - 1]] || c[mid1] != c[mid2]) {
        ++classes;
      }
      cn[p[i]] = classes - 1;
    }
    c = cn;
  }
  return p;
}
int main() {
  if (isDebug()) {
    timeStart = chrono::high_resolution_clock::now();
  };
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  string s;
  cin >> s;
  vector<int> lex = sufArray(s);
  if (isDebug()) {
    cerr << lex << endl;
  };
  vector<int> nbad(s.length(), 0);
  vector<int> lbad(s.length(), 0);
  vector<int> rbad(s.length(), 0);
  vector<bool> bad(s.length(), false);
  vector<int> l;
  l.reserve(s.length());
  int numL = 0;
  int numR = 0;
  for (int i = 0; i < (int)(s.length()); ++i) {
    if (s[i] == '(') {
      l.push_back(i);
    } else {
      if (!l.empty()) {
        l.pop_back();
      } else {
        bad[i] = true;
        ++numR;
      }
    }
  }
  for (const auto& x : l) {
    bad[x] = true;
    ++numL;
  }
  nbad[0] = numL + numR;
  lbad[0] = numL;
  rbad[0] = numR;
  int minBad = nbad[0];
  for (int i = 0; i < (int)(s.length() - 1); ++i) {
    if (isDebug()) {
      cerr << "Iter " << i << endl;
    };
    if (isDebug()) {
      cerr << l << endl;
    };
    if (bad[i]) {
      if (s[i] == '(') {
        --numL;
      } else {
        --numR;
      }
    }
    if (isDebug()) {
      cerr << "Current " << numL << " " << numR << endl;
    };
    if (s[i] == '(') {
      ++numL;
      l.push_back(i);
    } else {
      if (numL > 0) {
        --numL;
        bad[l.back()] = false;
        l.pop_back();
      } else {
        ++numR;
      }
    }
    nbad[i + 1] = numL + numR;
    lbad[i + 1] = numL;
    rbad[i + 1] = numR;
    minBad = min(minBad, nbad[i + 1]);
  }
  if (isDebug()) {
    cerr << bad << endl;
  };
  if (isDebug()) {
    cerr << nbad << endl;
  };
  if (isDebug()) {
    cerr << lbad << endl;
  };
  if (isDebug()) {
    cerr << rbad << endl;
  };
  if (isDebug()) {
    cerr << minBad << endl;
  };
  for (const auto& x : lex) {
    if (x >= s.length()) {
      continue;
    }
    if (nbad[x] == minBad) {
      if (isDebug()) {
        cerr << x << endl;
      };
      for (int i = 0; i < (int)(rbad[x]); ++i) {
        printf("(");
      }
      for (int i = 0; i < (int)(s.length()); ++i) {
        int j = (x + i) % s.length();
        printf("%c", s[j]);
      }
      for (int i = 0; i < (int)(lbad[x]); ++i) {
        printf(")");
      }
      printf("\n");
      break;
    }
  }
  if (isDebug()) {
    cerr << "Time check: "
         << double(chrono::duration_cast<chrono::milliseconds>(
                       chrono::high_resolution_clock::now() - timeStart)
                       .count()) /
                1000
         << endl;
  };
  return 0;
}
