#include <bits/stdc++.h>
using namespace std;
const int N = 2000010;
const int H = 37;
const int P = 1000000007;
int k, n, m;
int a[N], sum;
int Ans = 1e9, x;
int h[N], p[N];
vector<int> g;
multiset<int> S;
char s[N];
int Get(int l, int r) {
  return ((h[r] - 1ll * h[l - 1] * p[r - l + 1]) % P + P) % P;
}
bool Cmp(int x, int y) {
  int l = 0, r = n - 1;
  while (l <= r) {
    int Mid = l + r >> 1;
    if (Get(x, x + Mid) == Get(y, y + Mid))
      l = Mid + 1;
    else
      r = Mid - 1;
  }
  if (l == n) return 0;
  return a[x + l] < a[y + l];
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 1; i <= n; i++)
    a[i + n] = a[i] = s[i - 1] == '(' ? 0 : 1, sum += a[i] ? 1 : -1;
  for (int i = 1; i <= n * 2; i++) h[i] = (1ll * h[i - 1] * H + a[i] + 1) % P;
  p[0] = 1;
  for (int i = 1; i <= n; i++) p[i] = 1ll * p[i - 1] * H % P;
  int t = 0, T = 0;
  for (int i = 1; i < n; i++) {
    t += a[i] ? 1 : -1;
    S.insert(t);
  }
  for (int i = 1; i <= n; i++) {
    t += a[i + n - 1] ? 1 : -1;
    S.insert(t);
    int len = max((*S.rbegin()) - T, 0) * 2 - sum;
    if (len < Ans) Ans = len, x = max((*S.rbegin()) - T, 0), g.clear();
    if (len == Ans) g.push_back(i);
    T += a[i] ? 1 : -1;
    S.erase(S.find(T));
  }
  int pos = g[0];
  for (int i = 1; i < g.size(); i++)
    if (Cmp(g[i], pos)) pos = g[i];
  for (int i = 1; i <= x; i++) putchar('(');
  for (int i = pos; i <= pos + n - 1; i++) putchar(a[i] ? ')' : '(');
  for (int i = 1; i <= Ans - x; i++) putchar(')');
  return 0;
}
