#include <bits/stdc++.h>
using namespace std;
const int maxn = 2111111;
char buf[maxn];
int sum[maxn];
bool ok[maxn];
int order[maxn];
template <typename T>
void debug(T a[], int n) {
  for (int i = 1; i <= n; ++i) {
    cout << setw(3) << a[i];
  }
  puts("");
}
void fix(int& i, int n) {
  while (!ok[i] && i <= n) {
    ++i;
  }
}
int run(char s[], int m) {
  int n = m >> 1;
  int i = 1, j = 2, k = 0;
  fix(i, n);
  j = i + 1;
  fix(j, n);
  while (j <= n) {
    for (k = 0; k < n; ++k) {
      if (s[i + k] ^ s[j + k]) {
        break;
      }
    }
    if (s[i + k] > s[j + k]) {
      i += k + 1;
      fix(i, n);
    } else {
      j += k + 1;
      fix(j, n);
    }
    if (j == i) {
      ++j;
      fix(j, n);
    }
  }
  return std::min(i, j);
}
int main() {
  for (int i = 1; i < 100; ++i) {
    order[i] = i;
  }
  scanf("%s", buf + 1);
  int n = std::strlen(buf + 1);
  int A, B;
  A = B = 0;
  for (int i = 1; i <= n; ++i) {
    buf[i + n] = buf[i];
    if (buf[i] == '(') {
      ++A;
    } else {
      ++B;
    }
  }
  int m = n << 1;
  for (int i = 1; i <= m; ++i) {
    if (buf[i] == '(') {
      sum[i] = 1;
    } else {
      sum[i] = -1;
    }
    sum[i] += sum[i - 1];
  }
  static int q[maxn];
  int front, rear;
  front = rear = 0;
  static int min[maxn];
  int add = 0;
  if (A < B) {
    add = B - A;
  }
  for (int i = 1; i <= m; ++i) {
    if (front < rear && q[front] + n <= i) {
      ++front;
    }
    while (front < rear && sum[q[rear - 1]] >= sum[i]) {
      --rear;
    }
    q[rear++] = i;
    min[i] = sum[q[front]];
  }
  for (int i = 1; i <= n; ++i) {
    if (add + min[i + n - 1] >= sum[i - 1]) {
      ok[i] = true;
    }
  }
  int index = run(buf, m);
  auto print = [](char ch, int n) {
    while (n--) {
      putchar(ch);
    }
  };
  if (A < B) {
    print('(', B - A);
  }
  for (int i = index; i < index + n; ++i) {
    putchar(buf[i]);
  }
  if (B < A) {
    print(')', A - B);
  }
  puts("");
  return 0;
}
