#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
const long long bas = 131, mod = 2147483647;
long long pw[N], hsh[2 * N], num[2 * N], fsum[2 * N], que[2 * N];
long long dif, len, c1, c2, f, b, h;
char rd[N];
int main() {
  scanf("%s", rd), len = strlen(rd);
  for (int i = 0; i < len; i++)
    num[i + 1] = num[i + 1 + len] = ((rd[i] == '(') ? 1 : 2),
            (rd[i] == '(') ? c1++ : c2++;
  pw[0] = 1, f = 1, dif = abs(c1 - c2);
  for (int i = 1; i <= len; i++) pw[i] = pw[i - 1] * bas % mod;
  for (int i = 1; i <= 2 * len; i++) {
    fsum[i] = fsum[i - 1] + ((num[i] == 1) ? 1 : -1);
    hsh[i] = (hsh[i - 1] * bas + num[i]) % mod;
  }
  for (int i = 1; i < len; i++) {
    while (f <= b && fsum[i] <= fsum[que[b]]) b--;
    que[++b] = i;
  }
  for (int i = len; i <= 2 * len; i++) {
    while (f <= b && fsum[i] <= fsum[que[b]]) b--;
    que[++b] = i;
    int l = f, r = b, ans = 0;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (que[mid] + len < i + 1)
        l = mid + 1;
      else
        r = mid - 1, ans = mid;
    }
    bool i1 = fsum[i - len] - fsum[que[ans]] > dif;
    bool i2 = fsum[que[ans]] - fsum[i - len] < 0;
    if ((c1 <= c2 && i1) || (c1 >= c2 && i2)) continue;
    l = 1, r = len, ans = 0;
    while (l <= r) {
      int mid = (l + r) / 2;
      long long hsh1 =
          ((hsh[i - len + mid] - hsh[i - len] * pw[mid] % mod) % mod + mod) %
          mod;
      long long hsh2 =
          ((hsh[h - 1 + mid] - hsh[h - 1] * pw[mid] % mod) % mod + mod) % mod;
      if (hsh1 != hsh2)
        r = mid - 1;
      else
        l = mid + 1, ans = mid;
    }
    if (num[i - len + ans + 1] < num[h + ans] || !h) h = i - len + 1;
  }
  if (c1 < c2)
    for (int j = 1; j <= dif; j++) printf("(");
  for (int j = 1; j <= len; j++)
    (num[j + h - 1] == 1) ? printf("(") : printf(")");
  if (c1 > c2)
    for (int j = 1; j <= dif; j++) printf(")");
  return 0;
}
