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.*;
import java.util.*;

public class A {
	FastScanner in;
	PrintWriter out;

	final int mod = (int) 1e9 + 7;
	final int mul = 239;
	int[] hash;
	int[] pow;

	int getHash(int from, int to) {
		long res = hash[to + 1] - hash[from] * 1L * pow[to - from + 1];
		res %= mod;
		if (res < 0) {
			res += mod;
		}
		return (int) res;
	}

	boolean less(int fr1, int fr2, int n) {
		int l = 0, r = n + 1;
		while (r - l > 1) {
			int m = (l + r) >> 1;
			if (getHash(fr1, fr1 + m - 1) == getHash(fr2, fr2 + m - 1)) {
				l = m;
			} else {
				r = m;
			}
		}
		if (l == n) {
			return false;
		}
		return s.charAt(fr1 + l) < s.charAt(fr2 + l);
	}

	String s;

	void solve() {
		s = in.next();
		int n = s.length();
		s = s + s;
		hash = new int[s.length() + 1];
		for (int i = 0; i < s.length(); i++) {
			hash[i + 1] = (int) ((hash[i] * 1L * mul + s.charAt(i)) % mod);
		}
		pow = new int[n + n + 2];
		pow[0] = 1;
		for (int i = 1; i < pow.length; i++) {
			pow[i] = (int) ((pow[i - 1] * 1L * mul) % mod);
		}
		int[] bal = new int[n + n - 1];
		for (int i = 0; i < n + n - 1; i++) {
			if (s.charAt(i) == '(') {
				bal[i]++;
			} else {
				bal[i]--;
			}
			if (i > 0) {
				bal[i] += bal[i - 1];
			}
		}
		int cur = s.length() - 1;
		int[] balanceChange = new int[n];
		int[] qPos = new int[n + n];
		int[] qValue = new int[n + n];
		int qSz = 0, qFrom = 0;
		for (int pos = n - 1; pos >= 0; pos--) {
			while (cur != pos) {
				cur--;
				int value = bal[cur];
				while (qSz > qFrom && qValue[qSz - 1] >= value) {
					qSz--;
				}
				qValue[qSz] = value;
				qPos[qSz] = cur;
qSz++;
			}
			while (qPos[qFrom] >= pos + n) {
				qFrom++;
			}
			int prevBalance = pos > 0 ? bal[pos - 1] : 0;
			balanceChange[pos] = qValue[qFrom] - prevBalance;
		}
		int cntOpen = 0;
		for (int i = 0; i < n; i++) {
			if (s.charAt(i) == '(') {
				cntOpen++;
			} else {
				cntOpen--;
			}
		}
		int maxBalanceChange = 0;
		if (cntOpen < 0) {
			maxBalanceChange = cntOpen;
		}
		int bestCandidate = -1;
		for (int i = 0; i < n; i++) {
			if (balanceChange[i] >= maxBalanceChange) {
				if (bestCandidate != -1) {
					if (!less(i, bestCandidate, n)) {
						continue;
					}
				}
				bestCandidate = i;
			}
		}
		if (bestCandidate < 0) {
			throw new AssertionError();
		}
		for (int i = 0; i < -cntOpen; i++) {
			out.print("(");
		}
		for (int i = 0; i < n; i++) {
			out.print(s.charAt(i + bestCandidate));
		}
		for (int i = 0; i < cntOpen; i++) {
			out.print(")");
		}
	}

	void run() {
		try {
			in = new FastScanner(new File("A.in"));
			out = new PrintWriter(new File("A.out"));

			solve();

			out.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

	void runIO() {

		in = new FastScanner(System.in);
		out = new PrintWriter(System.out);

		solve();

		out.close();
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return null;
				st = new StringTokenizer(s);
			}
			return st.nextToken();
		}

		boolean hasMoreTokens() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return false;
				st = new StringTokenizer(s);
			}
			return true;
		}

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

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

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

	public static void main(String[] args) {
		new A().runIO();
	}
}