Problem: You are given two bracket sequences (not necessarily regular) s and t consisting only of characters '(' and ')'. You want to construct the shortest regular bracket sequence that contains both given bracket sequences as subsequences (not necessarily contiguous).

Recall what is the regular bracket sequence:

  * () is the regular bracket sequence; 
  * if S is the regular bracket sequence, then (S) is a regular bracket sequence; 
  * if S and T regular bracket sequences, then ST (concatenation of S and T) is a regular bracket sequence. 



Recall that the subsequence of the string s is such string t that can be obtained from s by removing some (possibly, zero) amount of characters. For example, "coder", "force", "cf" and "cores" are subsequences of "codeforces", but "fed" and "z" are not.

Input

The first line of the input contains one bracket sequence s consisting of no more than 200 characters '(' and ')'.

The second line of the input contains one bracket sequence t consisting of no more than 200 characters '(' and ')'.

Output

Print one line — the shortest regular bracket sequence that contains both given bracket sequences as subsequences (not necessarily contiguous). If there are several answers, you can print any.

Examples

Input


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


Output


(())()()


Input


)
((


Output


(())


Input


)
)))


Output


((()))


Input


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


Output


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

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class Problem_F {
	static final int INF = Integer.MAX_VALUE / 2;
	static char[] S, T;
	static int[][][] dp, dp2;

	public static void solve(int t, int i, int j, int k) {
		int x, y;
		x = i - 1 + t % 2;
		y = j - (t + 1) / 2;
		if ((t % 2 == 0 ? S[i] : T[j]) == '(') {
			if (k > 0 && dp[i][j][k] > dp[x][y][k - 1] + 1) {
				dp[i][j][k] = dp[x][y][k - 1] + 1;
				dp2[i][j][k] = t;
			}
		} else {
			if (k < 200 && dp[i][j][k] > dp[x][y][k + 1] + 1) {
				dp[i][j][k] = dp[x][y][k + 1] + 1;
				dp2[i][j][k] = t;
			}
		}
	}

	public static void main(String[] args) {
		InputReader in = new InputReader();
		StringBuilder out = new StringBuilder();

		S = (" " + in.nextLine()).toCharArray();
		T = (" " + in.nextLine()).toCharArray();
		dp = new int[S.length][T.length][201];
		dp2 = new int[S.length][T.length][201];
		for (int i = 0; i < S.length; i++) {
			for (int j = 0; j < T.length; j++) {
				Arrays.fill(dp[i][j], INF);
			}
		}
		for (int i = 0; i < 201; i++) {
			dp[0][0][i] = i;
		}
		for (int i = 0; i < S.length; i++) {
			for (int j = i == 0 ? 1 : 0; j < T.length; j++) {
				for (int k = 0; k < 201; k++) {
					if (i > 0) {
						solve(0, i, j, k);
					}
					if (j > 0) {
						solve(1, i, j, k);
					}
					if (i > 0 && j > 0 && S[i] == T[j]) {
						solve(2, i, j, k);
					}
				}
			}
		}
		int k = 0;
		for (int i = 0; i < 201; i++) {
			if (dp[S.length - 1][T.length - 1][k] + k > dp[S.length - 1][T.length - 1][i] + i) {
				k = i;
			}
		}
		for (int i = 0; i < k; i++) {
			out.append(')');
		}
		int x = S.length - 1;
		int y = T.length - 1;
		while (x > 0 || y > 0) {
			if (dp2[x][y][k] == 0) {
				out.append(S[x]);
				k += S[x] == ')' ? 1 : -1;
				x--;
			} else if (dp2[x][y][k] == 1) {
				out.append(T[y]);
				k += T[y] == ')' ? 1 : -1;
				y--;
			} else {
				out.append(S[x]);
				k += S[x] == ')' ? 1 : -1;
				x--;
				y--;
			}
		}
		while (k-- > 0) {
			out.append('(');
		}
		out.reverse().append('\n');

		System.out.print(out);
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer st;

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

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

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return null;
		}

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