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.
)(()()))((
 )())))(((())))())))))))()())(())))))))())))(((())))())()()))(())())((()())(((((()()()())()()()))((()
 ()
 (((())))))()(()
 ))(
 )
 (()()
 )(
 (

(()(()()))
 (((((((((((((((((((((((())))())()()))(())())((()())(((((()()()())()()()))((())())))(((())))())))))))()())(())))))))())))
 ()
 ((()(((())))))()
 (())
 ()
 (()())
 ()
 ()

import java.awt.*;
import java.io.*;
import java.util.*;
import java.math.BigInteger;
import static java.math.BigInteger.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

//<editor-fold defaultstate="collapsed" desc="Main">
public class Main {
    // https://netbeans.org/kb/73/java/editor-codereference_ru.html#display

    private void run() {
        try {
            Locale.setDefault(Locale.US);
        } catch (Exception e) {
        }
        boolean oj = true;
        try {
            oj = System.getProperty("MYLOCAL") == null;
        } catch (Exception e) {
        }

        if (oj) {
            sc = new FastScanner(new InputStreamReader(System.in));
            out = new PrintWriter(new OutputStreamWriter(System.out));
//            try {
//                sc = new FastScanner(new FileReader ("stacks.in" ));
//                out = new PrintWriter(new FileWriter("stacks.out"));
//            } catch (IOException e) {
//                MLE();
//            }
        } else {
            try {
                sc = new FastScanner(new FileReader("input.txt"));
                out = new PrintWriter(new FileWriter("output.txt"));
            } catch (IOException e) {
                MLE();
            }
        }
        Solver s = new Solver();
        s.sc = sc;
        s.out = out;
        s.solve();
        if (!oj) {
            err.println("Time: " + (System.currentTimeMillis() - timeBegin) / 1e3);
            err.printf("Mem: %d\n", (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) >> 20);
        }
        out.flush();
    }

    private void show(int[] arr) {
        for (int v : arr) {
            err.print(" " + v);
        }
        err.println();
    }

    public static void exit() {
        err.println("Time: " + (System.currentTimeMillis() - timeBegin) / 1e3);
        err.printf("Mem: %d\n", (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) >> 20);
        out.flush();
        out.close();
        System.exit(0);
    }

    public static void MLE() {
        int[][] arr = new int[1024 * 1024][];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = new int[1024 * 1024];
        }
    }

    public static void main(String[] args) {
        new Main().run();
    }

    static long timeBegin = System.currentTimeMillis();
    static FastScanner sc;
    static PrintWriter out;
    static PrintStream err = System.err;
}
    //</editor-fold>

//<editor-fold defaultstate="collapsed" desc="FastScanner">
class FastScanner {

    BufferedReader br;
    StringTokenizer st;

    FastScanner(InputStreamReader reader) {
        br = new BufferedReader(reader);
        st = new StringTokenizer("");
    }

    String next() {
        while (!st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception ex) {
                return null;
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        try {
            return br.readLine();
        } catch (IOException ex) {
            return null;
        }
    }
}
//</editor-fold>

class Solver {

    void aser(boolean OK) {
        if (!OK) {
            Main.MLE();
            //for(;;);
        }
    }

    FastScanner sc;
    PrintWriter out;
    static PrintStream err = System.err;


    
    Random rnd = new Random(1212);
    int nxt(int l, int r){ return l + rnd.nextInt(r-l+1); }
    
    String begStr(){
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 1e6; i++) {
            sb.append(nxt(0, 1)==1?'(':')');
        }
        return sb.toString();
    }
    
    class Pair{
        int pos;
        char ch;

        public Pair(int pos, char ch) {
            this.pos = pos;
            this.ch = ch;
        }
    }
    
    int cmp(int i, int j){
        int l = 0, r = n;
        while( l < r ){
            int m = (l + r + 1) / 2;
            if( hasher.getHash(i,m) == hasher.getHash(j,m) )
                l = m;
            else
                r = m - 1;
        }
        if( l==n ) return 0;
        return s.charAt(i+l) - s.charAt(j+l);
    }
    

    int n;
    String s;
    boolean[] canBeg;
    int lastBeg = -1000000000;
    int inTheEndAddInBeg;
    Hasher hasher;

    
    void solveTest(String _s){
        s = _s;
        //s = sc.next();
        //s = begStr();
        n = s.length();

        {
            int index = -1;
            Stack<Pair> st = new Stack<>();
            for (int i = 0; i < s.length(); i++) {
                char ch = s.charAt(i);
                if( !st.isEmpty() && st.peek().ch == '(' && ch == ')' )
                    st.pop();
                else{
                    if( !st.isEmpty() && st.peek().ch==')' && ch == '(' ){
                        index = st.pop().pos + 1;
                        lastBeg = i;
                        break;
                    }
                    st.add(new Pair(i, ch));
                }
            }

            if( index != -1 ){
                s = (s + s).substring(index, index + n);
                lastBeg -= index;
            } else {
                s = s + s;
                lastBeg = n - 1;
            }
            hasher = new Hasher(s);
        }
        
        {
            canBeg = new boolean[n];
            Stack<Character> st = new Stack<>();
            for (int i = 0; i < n; i++) {
                canBeg[i] = st.isEmpty();
                char ch = s.charAt(i);
                 if( !st.isEmpty() && st.peek() == '(' && ch == ')' )
                    st.pop();
                else
                    st.add(ch);
            }    
            inTheEndAddInBeg = 0;
            if( st.isEmpty() ) inTheEndAddInBeg = 0;
            else if( st.peek() == '(' ) inTheEndAddInBeg = -st.size();
            else if( st.peek() == ')' ) inTheEndAddInBeg =  st.size();
            else aser(false);
        }
        
        int bestInd = -1;
        for (int i = 0; i <= lastBeg; i++) {
            if (canBeg[i] && (bestInd == -1
                    //|| s.substring(i, i + n).compareTo(s.substring(bestInd, bestInd + n)) < 0)) {
                    || cmp(i,bestInd) < 0)) {
                bestInd = i;
            }
        }
        aser(bestInd != -1);
        StringBuilder sb = new StringBuilder();
        if( 0 < inTheEndAddInBeg )
            for (int iter = 0; iter < inTheEndAddInBeg; iter++)
                sb.append('(');
        sb.append(s.subSequence(bestInd, bestInd + n));
        if( inTheEndAddInBeg < 0 )
            for (int iter = 0; iter < -inTheEndAddInBeg; iter++)
                sb.append(')');
        out.println(sb);
    }
    
    void solve(){
        solveTest(sc.next());
        //solveTest(")(");
        
//        for (int l = 1; l <= 20; l++) {
//            for (int msk = 0; msk < (1<<l); msk++) {
//                String s = "";
//                for (int j = 0; j < l; j++) {
//                    if( (msk & (1<<j)) != 0 )
//                        s += "(";
//                    else 
//                        s += ")";
//                }
//                err.println(s);
//                solveTest(s);
//            }
//        }
    }
}

class Hasher{
    static final long base = valueOf(21512).nextProbablePrime().longValue();
    static final long[] pows = new long[(int)1e6 + 5];
    static {
        pows[0] = 1;
        for (int i = 1; i < pows.length; i++) {
            pows[i] = base * pows[i-1];
        }
    }
    
    long[] hash;

    public Hasher(String s) {
        hash = new long[s.length()];
        for (int i = 0; i < s.length(); i++) {
            hash[i] = s.charAt(i) * pows[i];
            if( 0 < i ) hash[i] += hash[i-1];
        }
    }
    
    long getHash(int l, int length){
        int r = l + length - 1;
        return (hash[r] - (l==0?0:hash[l-1])) * pows[pows.length-1-r];
    }
    
}