#include <bits/stdc++.h>
using namespace std;
const int N = 1000000 + 5;
char str[N << 1];
int a[N << 1];
bool flag[N << 1];
int len;
int offset, pos;
pair<int, int> que[N << 1];
int p1, p2;
int sa[N << 1], rk[N << 1];
void da(char *s, int n, int m) {
  static int t1[N << 1], t2[N << 1], c[N << 1];
  int *x = t1, *y = t2, i, j, k, p = 1;
  memset(c, 0, sizeof(c[0]) * m);
  for (i = 0; i < n; i++) c[x[i] = s[i]]++;
  for (i = 1; i < m; i++) c[i] += c[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--c[x[i]]] = i;
  for (k = 1; p < n; k <<= 1, m = p) {
    for (p = 0, i = n - k; i < n; i++) y[p++] = i;
    for (i = 0; i < n; i++)
      if (sa[i] >= k) y[p++] = sa[i] - k;
    memset(c, 0, sizeof(c[0]) * m);
    for (i = 0; i < n; i++) c[x[i]]++;
    for (i = 1; i < m; i++) c[i] += c[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--c[x[y[i]]]] = y[i];
    for (swap(x, y), x[sa[0]] = 0, p = i = 1; i < n; i++)
      x[sa[i]] = y[sa[i]] == y[sa[i - 1]] && y[sa[i] + k] == y[sa[i - 1] + k]
                     ? p - 1
                     : p++;
  }
}
int main() {
  scanf("%s", str + 1);
  len = strlen(str + 1);
  offset = 0;
  for (int i = 1; i <= len; ++i) offset += (str[i] == '(' ? 1 : -1);
  memcpy(str + len + 1, str + 1, len + 1);
  a[0] = 0;
  for (int i = 1; i <= len << 1; ++i)
    a[i] = a[i - 1] + (str[i] == '(' ? 1 : -1);
  p1 = p2 = 0;
  for (int i = 1; i <= len << 1; ++i) {
    while (p1 != p2 && que[p2 - 1].first > a[i]) --p2;
    que[p2++] = pair<int, int>(a[i], i);
    while (p1 != p2 && i - que[p1].second >= len) ++p1;
    if (i - len >= 0) {
      if (que[p1].first - a[i - len] >= offset ||
          que[p1].first - a[i - len] >= 0)
        flag[i - len + 1] = true;
    }
  }
  da(str + 1, len << 1 | 1, 128);
  for (int i = 1; i <= len << 1; ++i) {
    if (sa[i] < len && flag[sa[i] + 1]) {
      pos = sa[i] + 1;
      break;
    }
  }
  while (offset < 0) printf("("), ++offset;
  for (int i = pos; i < pos + len; ++i) printf("%c", str[i]);
  while (offset > 0) printf(")"), --offset;
  puts("");
}
