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 JAVA):

Solution:
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Vadim Semenov
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskF solver = new TaskF();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskF {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        String sequence = in.next();
        final int length = sequence.length();
        int[] s = new int[length];
        for (int i = 0; i < length; ++i) {
            s[i] = sequence.charAt(i) - '(';
        }
        int[] suffixArray = buildSuffixArray(s);
        int[] balance = new int[length * 2];
        for (int i = 1; i < balance.length; ++i) {
            balance[i] = balance[i - 1];
            if (s[(i - 1) % length] == 0) {
                balance[i]++;
            } else {
                balance[i]--;
            }
        }
        int total = balance[length];
        int opened = 0, closed = 0;
        if (total > 0) {
            closed = total;
        } else {
            opened = -total;
        }
        RMQ rmq = new RMQ(balance);
        int best = -1;
        for (int i : suffixArray) {
            int offset = balance[i];
            offset = opened - offset;
            if (rmq.query(i + 1, i + 1 + length) + offset >= 0) {
                if (balance[i + length] + offset != closed) {
                    throw new AssertionError(balance[i + length] + " + " + offset + " != " + closed);
                }
                best = i;
                break;
            }
        }
        for (int i = 0; i < opened; ++i) {
            out.print('(');
        }
        out.print(sequence.substring(best, sequence.length()));
        out.print(sequence.substring(0, best));
        for (int i = 0; i < closed; ++i) {
            out.print(')');
        }
        out.println();
    }

    private static class RMQ {
        int[][] data;
        int[] log;

        RMQ(int[] initial) {
            int length = initial.length;
            log = new int[length + 1];
            for (int i = 2; i <= length; ++i) {
                log[i] = log[i >>> 1] + 1;
            }
            data = new int[log[length]][length];
            System.arraycopy(initial, 0, data[0], 0, length);
            for (int level = 1; level < log[length]; ++level) {
                int len = 1 << (level - 1);
                for (int i = 0; (i + len + len) <= length; ++i) {
                    data[level][i] = Math.min(data[level - 1][i], data[level - 1][i + len]);
                }
            }
        }

        int query(int from, int to) {
            int level = log[to - from];
            return Math.min(data[level][from], data[level][to - (1 << level)]);
        }
    }

    private int[] buildSuffixArray(int[] s) {
        final int length = s.length;
        int[] suffixArray = new int[length];
        int[] bucket = new int[length];
        int[] _suffixArray = new int[length];
        int[] _bucket = new int[length];
        int[] position = new int[Math.max(2, length)];
        int buckets = 0;
        {
            for (int i : s) {
                position[i]++;
            }
            int pos = 0;
            for (int i = 0; i < position.length; ++i) {
                int tmp = position[i];
                position[i] = pos;
                pos += tmp;
            }
            for (int i = 0; i < length; ++i) {
                suffixArray[position[s[i]]++] = i;
            }
            position[0] = 0;
            for (int i = 1; i < length; ++i) {
                if (s[suffixArray[i]] != s[suffixArray[i - 1]]) {
                    buckets++;
                    position[buckets] = i;
                }
                bucket[suffixArray[i]] = buckets;
            }
        }
        for (int part = 1; part < length; part <<= 1) {
            for (int i = 0; i < length; ++i) {
                int idx = (suffixArray[i] - part + length) % length;
                _suffixArray[position[bucket[idx]]++] = idx;
            }
            buckets = 0;
            position[0] = 0;
            for (int i = 1; i < length; ++i) {
                if (bucket[_suffixArray[i]] != bucket[_suffixArray[i - 1]] ||
                        bucket[(_suffixArray[i] + part) % length] != bucket[(_suffixArray[i - 1] + part) % length]) {
                    buckets++;
                    position[buckets] = i;
                }
                _bucket[_suffixArray[i]] = buckets;
            }
            int[] swap = bucket; bucket = _bucket; _bucket = swap;
            swap = suffixArray; suffixArray = _suffixArray; _suffixArray = swap;
        }
        return suffixArray;
    }
}

class InputReader {
    private final BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(readLine());
        }
        return tokenizer.nextToken();
    }

    public String readLine() {
        String line;
        try {
            line = reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return line;
    }
}