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 F
{
	static int oo = (int)1e3;

	public static long go(String a, String b, int i, int j, int open, long[][][] memo, String[][][] out)
	{
		if (memo[i][j][open] != -1)
			return memo[i][j][open];

		if (i == a.length() && j == b.length())
		{
			out[i][j][open] = "";

			for (int k = 0; k < open; k++)
				out[i][j][open] += ")";
				
			return memo[i][j][open] = open;
		}

		int il = i + ((i < a.length() && a.charAt(i) == '(') ? 1 : 0);
		int jl = j + ((j < b.length() && b.charAt(j) == '(') ? 1 : 0);
		long left = oo;

		if (((i < a.length() && a.charAt(i) == '(')) || (j < b.length() && b.charAt(j) == '(') || open == 0)
			left = 1 + go(a, b, il, jl, open + 1, memo, out);

		int ir = i + ((i < a.length() && a.charAt(i) == ')') ? 1 : 0);
		int jr = j + ((j < b.length() && b.charAt(j) == ')') ? 1 : 0);
		long right = oo;

		if (open > 0)
			right = 1 + go(a, b, ir, jr, open - 1, memo, out);

		if (left <= right)
			out[i][j][open] = "(" + out[il][jl][open + 1];
		else
			out[i][j][open] = ")" + out[ir][jr][open - 1];

		return memo[i][j][open] = Math.min(left, right);
	}

	public static void solve(FastIO io)
	{
		String a = io.next();
		String b = io.next();

		long[][][] memo = new long[a.length() + 1][b.length() + 1][405];
		String[][][] out = new String[a.length() + 1][b.length() + 1][405];

		for (long[][] i : memo)
			for (long[] j : i)
				Arrays.fill(j, -1);

		go(a, b, 0, 0, 0, memo, out);

		int i = 0, j = 0;
		int open = 0;
		
		// while (i != a.length() && j != b.length())
		// {
		// 	if (a.charAt(i) == b.charAt(j))
		// 	{
		// 		open += a.charAt(i) == '(' ? 1 : -1;
		// 	}
		// }
		io.println(out[0][0][0]);
	}

	public static void main(String[] args) {
		FastIO io = new FastIO();

		solve(io);
		
		io.close();
	}
}

class FastIO extends PrintWriter
{
	BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = new StringTokenizer("");

	FastIO()
	{
		super(System.out);
	}

	public String next()
	{
		while (!st.hasMoreTokens())
		{
			try {
				st = new StringTokenizer(r.readLine());
			} catch (Exception e) {
				//TODO: handle exception
			}
		}
		return st.nextToken();
	}

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

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

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