Problem: Polycarpus has a finite sequence of opening and closing brackets. In order not to fall asleep in a lecture, Polycarpus is having fun with his sequence. He is able to perform two operations:

  * adding any bracket in any position (in the beginning, the end, or between any two existing brackets); 
  * cyclic shift — moving the last bracket from the end of the sequence to the beginning. 



Polycarpus can apply any number of operations to his sequence and adding a cyclic shift in any order. As a result, he wants to get the correct bracket sequence of the minimum possible length. If there are several such sequences, Polycarpus is interested in the lexicographically smallest one. Help him find such a sequence.

Acorrect bracket sequence is a sequence of opening and closing brackets, from which you can get a correct arithmetic expression by adding characters "1" and "+" . Each opening bracket must correspond to a closed one. For example, the sequences "(())()", "()", "(()(()))" are correct and ")(", "(()" and "(()))(" are not.

The sequence a1 a2... an is lexicographically smaller than sequence b1 b2... bn, if there is such number i from 1 to n, thatak = bk for 1 ≤ k < i and ai < bi. Consider that "("  < ")".

Input

The first line contains Polycarpus's sequence consisting of characters "(" and ")". The length of a line is from 1 to 1 000 000.

Output

Print a correct bracket sequence of the minimum length that Polycarpus can obtain by his operations. If there are multiple such sequences, print the lexicographically minimum one.

Examples

Input

()(())


Output

(())()

Input

()(


Output

(())

Note

The sequence in the first example is already correct, but to get the lexicographically minimum answer, you need to perform four cyclic shift operations. In the second example you need to add a closing parenthesis between the second and third brackets and make a cyclic shift. You can first make the shift, and then add the bracket at the end.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
inline long long pow(long long a, long long b, long long mo) {
  if (!a) return 0;
  long long tmp = 1;
  for (; b; b >>= 1) {
    if (b & 1) tmp = (long long)tmp * a % mo;
    a = (long long)a * a % mo;
  }
  return tmp;
}
template <class T>
inline void R(T &xx) {
  xx = 0;
  char ch = getchar();
  bool F = 0;
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') F = 1, ch = getchar();
  while (ch >= '0' && ch <= '9')
    xx = xx + xx + (xx << 3) + ch - 48, ch = getchar();
  if (F) xx = -xx;
}
char s[2000011];
int n;
int w[2000011], wa[2000011], wb[2000011], sa[2000011], r[2000011];
void da(char a[], int n, int m) {
  int p, *x = wa, *y = wb;
  n++;
  for (int i = (0); i <= (m); i++) w[i] = 0;
  for (int i = 0; i < (int)(n); i++) w[r[i] = a[i]]++;
  for (int i = (1); i <= (m); i++) w[i] += w[i - 1];
  for (int i = 0; i < (int)(n); i++) sa[--w[a[i]]] = i;
  for (int j = 1;; j <<= 1, m = p) {
    p = 0;
    for (int i = (n - j); i < (int)(n); i++) y[p++] = i;
    for (int i = 0; i < (int)(n); i++)
      if (sa[i] >= j) y[p++] = sa[i] - j;
    for (int i = (0); i <= (m); i++) w[i] = 0;
    for (int i = 0; i < (int)(n); i++) w[r[i]]++;
    for (int i = (1); i <= (m); i++) w[i] += w[i - 1];
    for (int i = (n)-1; ~i; i--) sa[--w[r[y[i]]]] = y[i];
    for (int i = 0; i < (int)(n); i++) x[i] = r[i];
    p = 1;
    r[sa[0]] = 0;
    for (int i = (1); i < (int)(n); i++)
      r[sa[i]] = (x[sa[i]] == x[sa[i - 1]] && x[sa[i] + j] == x[sa[i - 1] + j])
                     ? p - 1
                     : p++;
    if (p == n) break;
  }
}
pair<int, int> seg[2000011 << 2];
void build(int p, int l, int r) {
  if (l == r) {
    seg[p] = (s[l] == 1) ? make_pair(1, 0) : make_pair(-1, -1);
    return;
  }
  int mid = l + r >> 1;
  build((p << 1), l, mid);
  build((p << 1 | 1), mid + 1, r);
  seg[p] = make_pair(seg[(p << 1)].first + seg[(p << 1 | 1)].first,
                     min(seg[(p << 1)].second,
                         seg[(p << 1)].first + seg[(p << 1 | 1)].second));
}
pair<int, int> que(int p, int l, int r, int L, int R) {
  if (L <= l && R >= r) return seg[p];
  int mid = l + r >> 1;
  if (R <= mid) return que((p << 1), l, mid, L, R);
  if (L > mid) return que((p << 1 | 1), mid + 1, r, L, R);
  pair<int, int> le = que((p << 1), l, mid, L, R),
                 ri = que((p << 1 | 1), mid + 1, r, L, R);
  return make_pair(le.first + ri.first, min(le.second, le.first + ri.second));
}
int main() {
  gets(s);
  int l = n = strlen(s);
  for (int i = 0; i < (int)(n); i++) s[i + n] = (s[i] = (s[i] == '(' ? 1 : 2));
  n <<= 1;
  da(s, n, 3);
  int cnt = 0, addl = 0, addr = 0;
  for (int i = 0; i < (int)(l); i++)
    if (s[i] == 1)
      cnt++;
    else
      cnt--;
  if (cnt > 0)
    addr = cnt;
  else
    addl = -cnt;
  build(1, 0, n - 1);
  for (int i = (1); i <= (n); i++)
    if (sa[i] < l &&
        addl + que(1, 0, n - 1, sa[i], sa[i] + l - 1).second >= 0) {
      for (int j = 0; j < (int)(addl); j++) putchar('(');
      for (int j = (sa[i]); j <= (sa[i] + l - 1); j++)
        putchar((s[j] == 2) ? ')' : '(');
      for (int j = 0; j < (int)(addr); j++) putchar(')');
      puts("");
      return 0;
    }
  return 0;
}