#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
int n1, w[2000010], wa[2000010], wb[2000010], sa[2000010], s[2000010],
    f[2000010], q[2000010];
char st[2000010];
bool cmp(int i, int j, int h, int *r) {
  if (r[i] < r[j]) return 1;
  if (i + h >= n1) return 1;
  return r[i + h] < r[j + h];
}
void suffix(char *s) {
  n1 = strlen(s);
  int i, j, p, m = 128, *first = wa, *second = wb;
  for (i = 0; i < m; i++) w[i] = 0;
  for (i = 0; i < n1; i++) w[first[i] = s[i]]++;
  for (i = 1; i < m; i++) w[i] += w[i - 1];
  for (i = n1 - 1; i >= 0; i--) sa[--w[first[i]]] = i;
  for (j = 1, p = 0; p != n1; j <<= 1, m = p) {
    for (i = n1 - j, p = 0; i < n1; i++) second[p++] = i;
    for (i = 0; i < n1; i++)
      if (sa[i] >= j) second[p++] = sa[i] - j;
    for (i = 0; i < m; i++) w[i] = 0;
    for (i = 0; i < n1; i++) w[first[i]]++;
    for (i = 1; i < m; i++) w[i] += w[i - 1];
    for (i = n1 - 1; i >= 0; i--) sa[--w[first[second[i]]]] = second[i];
    swap(first, second);
    for (i = 1, first[sa[0]] = 0, p = 1; i < n1; i++) {
      first[sa[i]] = cmp(sa[i - 1], sa[i], j, second) ? p++ : p - 1;
    }
  }
}
int main() {
  int T, i, j, k, ca = 0, m, n;
  scanf("%s", st);
  n = strlen(st);
  for (i = 0; i < n; i++) st[i + n] = st[i];
  st[n + n] = 0;
  for (i = 0; i < n + n; i++) s[i + 1] = s[i] + (st[i] == '(' ? 1 : -1);
  suffix(st);
  int head = 0, tail = -1;
  for (i = 1; i <= n + n; i++) {
    while (head <= tail && q[head] < i - n + 1) head++;
    while (head <= tail && s[i] <= s[q[tail]]) tail--;
    q[++tail] = i;
    if (i >= n) f[i - n] = s[q[head]];
  }
  k = min(s[n], 0);
  for (i = 0; i < n + n; i++) {
    j = sa[i];
    if (j >= n) continue;
    if (f[j] - s[j] >= k) break;
  }
  for (i = 0; i < -s[n]; i++) printf("(");
  for (i = j; i < j + n; i++) printf("%c", st[i]);
  for (i = 0; i < s[n]; i++) printf(")");
  puts("");
}
