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

public class R605F {

	public static void main(String[] args) {
		JS scan = new JS();
		PrintWriter out = new PrintWriter(System.out);
		String s = scan.next();
		String t = scan.next();
		int n = s.length();
		int m = t.length();
		
		int[][][] dp = new int[n+1][m+1][228];
		State[][][] prev = new State[n+1][m+1][228];
		for(int i = 0; i <= n; i++) {
			for(int j = 0; j <= m; j++) {
				Arrays.fill(dp[i][j], -1);
			}
		}
		
		ArrayDeque<State> q = new ArrayDeque<State>();
		dp[0][0][0] = 0;
		q.add(new State(0,0,0));
		while(!q.isEmpty()) {
			State p = q.poll();
			
			// place (
			int ni = p.a;
			int nj = p.b;
			if(p.a < n) 
				if(s.charAt(p.a) == '(') ni++;
			if(p.b < m)
				if(t.charAt(p.b) == '(') nj++;
			if(p.c < 220 && dp[ni][nj][p.c+1] == -1) {
				dp[ni][nj][p.c+1] = dp[p.a][p.b][p.c]+1;
				prev[ni][nj][p.c+1] = p;
				q.add(new State(ni, nj, p.c+1));
			}
			
			// place )
			ni = p.a;
			nj = p.b;
			if(p.a < n) 
				if(s.charAt(p.a) == ')') ni++;
			if(p.b < m)
				if(t.charAt(p.b) == ')') nj++;
			if(p.c > 0 && dp[ni][nj][p.c-1] == -1) {
				dp[ni][nj][p.c-1] = dp[p.a][p.b][p.c]+1;
				prev[ni][nj][p.c-1] = p;
				q.add(new State(ni, nj, p.c-1));
			}
		}
		
		State at = new State(n, m, 0);
		ArrayList<Character> lst = new ArrayList<Character>();
		while(at.a != 0 || at.b != 0 || at.c != 0) {
			State before = prev[at.a][at.b][at.c];
			if(before.c < at.c) {
				lst.add('(');
			}
			else {
				lst.add(')');
			}
			
			at = before;
		}
		
		for(int i = 0; i < lst.size(); i++) out.print(lst.get(lst.size()-i-1));
		out.println();
		out.flush();
//		System.out.println(lst);
//		System.out.println(dp[n][m][0]);
	}
	
	static class State{
		
		int a;
		int b;
		int c;
		
		public State(int a, int b, int c) {
			this.a = a;
			this.b = b;
			this.c = c;
		}
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}				
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}