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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        FTwoBracketSequences solver = new FTwoBracketSequences();
        solver.solve(1, in, out);
        out.close();
    }

    static class FTwoBracketSequences {
        static char[] first;
        static char[] second;
        static Integer[][][] memo;

        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            first = sc.next().toCharArray();
            second = sc.next().toCharArray();
            memo = new Integer[201][201][402];
            pw.println(trace(0, 0, 0));
        }

        private int dp(int i, int j, int k) {
            if (k < 0)
                return (int) 1e9;
            if (i == first.length && j == second.length)
                return k;
            if (k > 400)
                return (int) 1e9;
            if (memo[i][j][k] != null)
                return memo[i][j][k];
            int jj = j < second.length && second[j] == '(' ? j + 1 : j;
            int ii = i < first.length && first[i] == '(' ? i + 1 : i;
            int open = 1 + dp(ii, jj, k + 1);
            jj = j < second.length && second[j] == ')' ? j + 1 : j;
            ii = i < first.length && first[i] == ')' ? i + 1 : i;
            int close = 1 + dp(ii, jj, k - 1);
            return memo[i][j][k] = Math.min(open, close);
        }

        private String trace(int i, int j, int k) {
            if (i == first.length && j == second.length) {
                StringBuilder temp = new StringBuilder();
                while (k-- > 0)
                    temp.append(')');
                return temp.toString();
            }
            int cur = dp(i, j, k);
            int jj = j < second.length && second[j] == '(' ? j + 1 : j;
            int ii = i < first.length && first[i] == '(' ? i + 1 : i;
            int open = 1 + dp(ii, jj, k + 1);
            if (cur == 1 + dp(ii, jj, k + 1))
                return '(' + trace(ii, jj, k + 1);
            else {
                jj = j < second.length && second[j] == ')' ? j + 1 : j;
                ii = i < first.length && first[i] == ')' ? i + 1 : i;
                return ')' + trace(ii, jj, k - 1);
            }
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

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

    }
}