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;
const int INF = (int)2e9;
const long long INFL = (long long)9e18;
const int MAXINT = ((~0) ^ (1 << 31));
const long long MAXLL = ((~0) ^ ((long long)1 << 63));
template <class T>
inline T pow2(T a) {
  return a * a;
}
template <class T>
inline bool mineq(T& a, T b) {
  return (a > b) ? (a = b, true) : false;
}
template <class T>
inline bool maxeq(T& a, T b) {
  return (a < b) ? (a = b, true) : false;
}
const int maxn = (int)2e6 + 10;
;
const int MOD = (int)1e9 + 7;
;
long long hash1[maxn], hash2[maxn], p1[maxn], p2[maxn], rp1[maxn], rp2[maxn],
    a[maxn];
bool valid[maxn];
long long n;
string str;
long long powmod(long long a, long long b) {
  if (!b) return 1;
  long long t = powmod(a, b / 2);
  t = (t * t) % MOD;
  if (b & 1) t = (t * a) % MOD;
  return t;
}
void pre() {
  p1[0] = p2[0] = rp1[0] = rp2[0] = 1;
  hash1[0] = hash2[0] = str[0];
  for (int i = 1; i < (int)(str.size()); i++) {
    p1[i] = (p1[i - 1] * 31) % MOD;
    rp1[i] = powmod(p1[i], MOD - 2);
    p2[i] = (p2[i - 1] * 61) % MOD;
    rp2[i] = powmod(p2[i], MOD - 2);
    hash1[i] = (hash1[i - 1] + p1[i] * str[i]) % MOD;
    hash2[i] = (hash2[i - 1] + p2[i] * str[i]) % MOD;
  }
}
inline long long gethash(int l, int r, long long hash[maxn],
                         long long rp[maxn]) {
  long long pr = (l ? hash[l - 1] : 0);
  return ((hash[r] - pr + MOD) * rp[l]) % MOD;
}
inline pair<long long, long long> gethash(int l, int r) {
  return make_pair(gethash(l, r, hash1, rp1), gethash(l, r, hash2, rp2));
}
inline bool cmp(int a, int b) {
  int l = 0, r = n - 1, mid = -1, ans = -1;
  if (b == -1) return true;
  while (l <= r) {
    mid = (l + r) / 2;
    if (gethash(a, a + mid) == gethash(b, b + mid)) {
      l = mid + 1;
      ans = mid;
    } else {
      r = mid - 1;
    }
  }
  if (a + ans + 1 == (int)str.size() || b + ans + 1 == (int)str.size())
    return false;
  return str[a + ans + 1] < str[b + ans + 1];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> str;
  n = str.size();
  str += str;
  pre();
  int ans = -1, open = 0, close = 0, dif = 0;
  multiset<int> st;
  for (int i = 0; i < (int)(n); i++) {
    if (str[i] == '(')
      open++;
    else
      close++;
    a[i] = open - close;
  }
  for (int i = 0; i < (int)(2 * n); i++) {
    if (str[i] == '(')
      dif++;
    else
      dif--;
    st.insert(dif);
    if (i >= n) st.erase(st.find(a[i - n]));
    if (i >= n - 1) {
      long long pr = (i == n - 1 ? 0 : a[i - n]);
      if (*st.begin() - pr >= 0) valid[i - n + 1] = true;
      if (open < close && *st.begin() - pr >= open - close)
        valid[i - n + 1] = true;
    }
  }
  for (int i = 0; i < (int)(n); i++) {
    if (valid[i] && cmp(i, ans)) ans = i;
  }
  cerr << "* " << ans << endl;
  if (open < close) {
    for (int i = 0; i < (int)(close - open); i++) cout << '(';
  }
  for (int i = ans; i < (int)(ans + n); i++) cout << str[i];
  if (open > close) {
    for (int i = 0; i < (int)(open - close); i++) cout << ')';
  }
  cerr << open << " " << close << endl;
}