#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 10;
const long long md = 1e9 + 7;
int need[N], reduce[N];
long long st[N], head[N], tail[N], sdfsdfsd[N];
int n;
string s;
struct candidate {
  int start, headLen, tailLen;
  candidate() {}
  candidate(int start, int headLen, int tailLen)
      : start(start), headLen(headLen), tailLen(tailLen) {}
};
long long getSuperHash(int l, int r) {
  if (l == 0 && r == n - 1) {
    return sdfsdfsd[l];
  }
  if (l < n && r >= n) {
    return (sdfsdfsd[l] + sdfsdfsd[r] * st[n - l]) % md;
  }
  if (l >= n) {
    l -= n;
    r -= n;
  }
  if (r == n - 1) {
    return sdfsdfsd[l];
  }
  r++;
  long long res = (sdfsdfsd[l] - sdfsdfsd[r] * st[r - l]) % md;
  return (res + md) % md;
}
long long getHash(candidate i, int len) {
  if (len <= i.headLen) {
    return head[len];
  }
  long long res = head[i.headLen];
  len -= i.headLen;
  if (len <= n) {
    return (res + getSuperHash(i.start, i.start + len - 1) * st[i.headLen]) %
           md;
  }
  res += getSuperHash(i.start, i.start + n - 1) * st[i.headLen];
  res %= md;
  len -= n;
  return (res + st[n + i.headLen] * tail[len]) % md;
}
char compare(candidate last, candidate cur) {
  int l = 0, r = n + cur.headLen + cur.tailLen;
  if (getHash(last, r) == getHash(cur, r)) {
    return true;
  }
  while (l + 1 < r) {
    int len = (l + r) / 2;
    (getHash(last, len) == getHash(cur, len) ? l : r) = len;
  }
  int p = getHash(last, r) == getHash(cur, r) ? r : l;
  if (p < last.headLen) {
    return true;
  }
  p -= last.headLen;
  assert(p < n + last.tailLen);
  return p < n ? s[last.start + p] == '(' : false;
}
int main() {
  st[0] = 1;
  for (int i = 1; i < N; i++) {
    st[i] = st[i - 1] * 239 % md;
    head[i] = (head[i - 1] + st[i]) % md;
    tail[i] = (tail[i - 1] + st[i] * 2) % md;
  }
  getline(cin, s);
  n = s.length();
  s += s;
  need[n - 1] = s[n - 1] == ')';
  reduce[n - 1] = s[n - 1] == '(';
  sdfsdfsd[n - 1] = s[n - 1] - '(' + 1;
  need[n] = s[n] == ')';
  reduce[n] = s[n] == '(';
  sdfsdfsd[n] = s[n] - '(' + 1;
  for (int i = n - 2; i >= 0; i--) {
    need[i] = s[i] == ')';
    reduce[i] = s[i] == '(';
    int take = min(reduce[i], need[i + 1]);
    need[i] = need[i] + need[i + 1] - take;
    reduce[i] = reduce[i] + reduce[i + 1] - take;
    sdfsdfsd[i] = (s[i] - '(' + 1 + sdfsdfsd[i + 1] * st[1]) % md;
  }
  for (int i = n + 1; i < n * 2; i++) {
    need[i] = s[i] == ')';
    reduce[i] = s[i] == '(';
    int take = min(reduce[i - 1], need[i]);
    need[i] = need[i] + need[i - 1] - take;
    reduce[i] = reduce[i] + reduce[i - 1] - take;
    sdfsdfsd[i] = (sdfsdfsd[i - 1] + st[i - n] * (s[i] - '(' + 1)) % md;
  }
  int minCost = need[0] + reduce[0];
  vector<candidate> c;
  c.emplace_back(0, need[0], reduce[0]);
  for (int l = 1, r = n; l < n; l++, r++) {
    int take = min(reduce[l], need[r]), need, reduce;
    need = ::need[l] + ::need[r] - take;
    reduce = ::reduce[l] + ::reduce[r] - take;
    if (need + reduce > minCost) {
      continue;
    }
    if (need + reduce < minCost) {
      c.clear();
    }
    minCost = need + reduce;
    c.emplace_back(l, need, reduce);
  }
  for (candidate i : c)
    if (!compare(c[0], i)) {
      c[0] = i;
    }
  while (c[0].headLen--) {
    printf("(");
  }
  for (int i = 0; i < n; i++) {
    printf("%c", s[i + c[0].start]);
  }
  while (c[0].tailLen--) {
    printf(")");
  }
}
