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 E {

	static char[] s1, s2;

	static int INF = (int) 1e9;

	static PrintWriter out = new PrintWriter(System.out);

	static int val(char c) {
		return c == '(' ? 1 : -1;
	}

	static int MAX = 420;

	static int[][][] memo;

	static int dp(int i, int j, int bal) {
		if (i == s1.length && j == s2.length)
			return bal;
		if (memo[i][j][bal] != -1)
			return memo[i][j][bal];
		int ans = INF;
		// open
		if (bal < MAX) {
			ans = Math.min(ans, 1 + dp(i + (i < s1.length && s1[i] == '(' ? 1 : 0),
					j + (j < s2.length && s2[j] == '(' ? 1 : 0), bal + 1));
		}

		boolean ad1 = i < s1.length && s1[i] == ')';
		boolean ad2 = j < s2.length && s2[j] == ')';
		if (bal > 0 && (ad1 || ad2))
			ans = Math.min(ans, 1 + dp(i + (ad1 ? 1 : 0), j + (ad2 ? 1 : 0), bal - 1));
		return memo[i][j][bal] = ans;

	}

	static void print(int i, int j, int bal) {
		if (i == s1.length && j == s2.length) {
			while (bal-- > 0)
				out.print(')');
			return;
		}

		int ans = dp(i, j, bal);
		// open
		if (bal < MAX && ans == 1 + dp(i + (i < s1.length && s1[i] == '(' ? 1 : 0),
				j + (j < s2.length && s2[j] == '(' ? 1 : 0), bal + 1)) {
			out.print('(');
			print(i + (i < s1.length && s1[i] == '(' ? 1 : 0), j + (j < s2.length && s2[j] == '(' ? 1 : 0), bal + 1);
			return;
		}
		out.print(')');
		boolean ad1 = i < s1.length && s1[i] == ')';
		boolean ad2 = j < s2.length && s2[j] == ')';
		print(i + (ad1 ? 1 : 0), j + (ad2 ? 1 : 0), bal - 1);

	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		s1 = sc.next().toCharArray();
		s2 = sc.next().toCharArray();
		memo = new int[201][201][MAX + 2];
		for (int[][] x2 : memo)
			for (int[] x : x2)
				Arrays.fill(x, -1);
		print(0, 0, 0);
		out.println();
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

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

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		boolean ready() throws IOException {
			return br.ready();
		}

	}

	static void sort(int[] a) {
		shuffle(a);
		Arrays.sort(a);
	}

	static void shuffle(int[] a) {
		int n = a.length;
		Random rand = new Random();
		for (int i = 0; i < n; i++) {
			int tmpIdx = rand.nextInt(n);
			int tmp = a[i];
			a[i] = a[tmpIdx];
			a[tmpIdx] = tmp;
		}
	}

}