#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
char s[MAXN];
int n;
int classes[MAXN];
int bottom = 0, whereb = 0;
int main() {
  gets(s);
  n = strlen(s);
  int bal = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '(') {
      ++bal;
      classes[i] = 0;
    } else {
      classes[i] = 1;
      --bal;
    }
    if (bottom > bal) {
      bottom = bal;
    }
    if (bottom == bal) {
      whereb = i;
    }
  }
  for (int j = 1; j <= n * 2; j <<= 1) {
    vector<pair<pair<int, int>, int> > tmpa;
    for (int i = 0; i < n; ++i) {
      tmpa.push_back(make_pair(make_pair(classes[i], classes[(i + j) % n]), i));
    }
    sort((tmpa).begin(), (tmpa).end());
    pair<int, int> prev = tmpa[0].first;
    int c = 0;
    for (int i = 0; i < n; ++i) {
      if (prev != tmpa[i].first) {
        ++c;
        prev = tmpa[i].first;
      }
      classes[tmpa[i].second] = c;
    }
  }
  if (bal <= 0) {
    int tmpbal = 0;
    pair<int, int> best = make_pair(1e9 + 9, -1);
    int nowmin = 0;
    for (int i = 0; i < n; ++i) {
      if (tmpbal == bottom || (nowmin >= tmpbal && tmpbal - bottom <= -bal)) {
        best = min(best, make_pair(classes[i], i));
      }
      if (s[i] == '(') {
        ++tmpbal;
      } else {
        --tmpbal;
      }
      nowmin = min(nowmin, tmpbal);
    }
    for (int i = 0; i < -bal; ++i) {
      printf("(");
    }
    for (int i = 0; i < n; ++i) {
      printf("%c", s[(i + best.second) % n]);
    }
    printf("\n");
    return 0;
  }
  bool can[MAXN];
  memset(can, 0, sizeof can);
  int nowbal = 0;
  int nowmin = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (nowbal <= nowmin) {
      can[i] = true;
    }
    if (s[i] == ')') {
      ++nowbal;
    } else {
      --nowbal;
    }
    nowmin = min(nowmin, nowbal);
  }
  int tmpbal = 0;
  pair<int, int> best = make_pair(1e9 + 9, -1);
  for (int i = 0; i < n; ++i) {
    if ((tmpbal - bottom <= bal && can[i]) || tmpbal == bottom) {
      best = min(best, make_pair(classes[i], i));
    }
    if (s[i] == '(') {
      ++tmpbal;
    } else {
      --tmpbal;
    }
  }
  for (int i = 0; i < n; ++i) {
    printf("%c", s[(i + best.second) % n]);
  }
  for (int i = 0; i < bal; ++i) {
    printf(")");
  }
  printf("\n");
  return 0;
}
