#include <bits/stdc++.h>
using namespace std;
int n, N, a[2000005], s[2000005], q[2000005], ql, qr, rec[1000005], ans;
int f[2000005][22];
string in;
int main() {
  ios::sync_with_stdio(0);
  cin >> in;
  n = in.size();
  for (int i = 1; i <= n; ++i) {
    if (in[i - 1] == '(')
      a[i] = a[i + n] = 0;
    else
      a[i] = a[i + n] = 1;
  }
  N = n * 2;
  for (int i = 1; i <= N; ++i) {
    if (a[i] == 0)
      s[i] = s[i - 1] + 1;
    else
      s[i] = s[i - 1] - 1;
  }
  ql = 1;
  for (int i = N; i > n; --i) {
    while (qr >= ql && s[q[qr]] >= s[i]) --qr;
    q[++qr] = i;
  }
  for (int i = n; i; --i) {
    while (qr >= ql && s[q[qr]] >= s[i]) --qr;
    q[++qr] = i;
    if (q[ql] == i + n) ++ql;
    rec[i] = s[q[ql]] - s[i - 1];
    if (s[n] < 0) rec[i] -= s[n];
  }
  long long o = 2;
  for (int i = 1; i <= N; ++i) f[i][0] = a[i];
  for (int k = 0; k < 20; ++k) {
    for (int i = 1; i <= N - (2 << k) + 1; ++i)
      f[i][k + 1] = (f[i][k] * o + f[i + (1 << k)][k]) % 1000000007ll;
    o = o * o % 1000000007ll;
  }
  ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (rec[i] < 0) continue;
    if (!ans) {
      ans = i;
      continue;
    }
    int x = ans, y = i, o = 0;
    for (int k = 20; k >= 0; --k) {
      if (o + (1 << k) > n) continue;
      if (f[x][k] == f[y][k]) x += (1 << k), y += (1 << k), o += (1 << k);
    }
    if (o < n && a[y] < a[x]) ans = i;
  }
  string out = "";
  in += in;
  for (int i = ans; i <= ans + n - 1; ++i) out += in[i - 1];
  int O = s[n];
  if (O > 0) {
    cout << out;
    while (O > 0) cout << ")", --O;
  } else {
    while (O < 0) cout << "(", ++O;
    cout << out;
  }
  cout << endl;
  return 0;
}
