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.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

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

    static class FDveSkobochniePosledovatelnosti {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            final int INF = Integer.MAX_VALUE;
            final int MAX_BAL = 202;

            String s1 = in.nextString();
            String s2 = in.nextString();
            int n1 = s1.length();
            int n2 = s2.length();
            int[][][] dp = new int[MAX_BAL][n1 + 1][n2 + 1];
            for (int bal = 0; bal < MAX_BAL; bal++) {
                for (int i = 0; i <= n1; i++) {
                    for (int j = 0; j <= n2; j++) {
                        dp[bal][i][j] = INF;
                    }
                }
            }
            dp[0][0][0] = 0;
            FDveSkobochniePosledovatelnosti.Elem[][][] prev = new FDveSkobochniePosledovatelnosti.Elem[MAX_BAL][n1 + 1][n2 + 1];
            for (int i = 0; i <= n1; i++) {
                for (int j = 0; j <= n2; j++) {
                    for (int bal = 0; bal < MAX_BAL; bal++) {
                        if (dp[bal][i][j] == INF) {
                            continue;
                        }
                        for (char bracket : new char[]{'(', ')'}) {
                            int nextI = i + (i < n1 && s1.charAt(i) == bracket ? 1 : 0);
                            int nextJ = j + (j < n2 && s2.charAt(j) == bracket ? 1 : 0);
                            int nextBal = bal + (bracket == '(' ? 1 : -1);
                            if (nextBal < 0 || nextBal >= MAX_BAL) {
                                continue;
                            }
                            if (dp[bal][i][j] + 1 < dp[nextBal][nextI][nextJ]) {
                                dp[nextBal][nextI][nextJ] = dp[bal][i][j] + 1;
                                prev[nextBal][nextI][nextJ] = new FDveSkobochniePosledovatelnosti.Elem(i, j, bracket, bal);
                            }
                        }
                    }
                }
            }
            int best = INF;
            int curBal = -1;
            int curI = n1;
            int curJ = n2;
            for (int bal = 0; bal < MAX_BAL; bal++) {
                if (best > dp[bal][n1][n2] + bal) {
                    best = dp[bal][n1][n2];
                    curBal = bal;
                }
            }
            int add = curBal;
            StringBuilder ret = new StringBuilder();
            while (curBal > 0 || curI > 0 || curJ > 0) {
                FDveSkobochniePosledovatelnosti.Elem e = prev[curBal][curI][curJ];
                ret.append(e.bracket);
                curBal = e.bal;
                curI = e.i;
                curJ = e.j;
            }
            ret.reverse().append(")".repeat(add));
            out.println(ret);
        }

        private static class Elem {
            private int i;
            private int j;
            private char bracket;
            private int bal;

            private Elem(int i, int j, char bracket, int bal) {
                this.i = i;
                this.j = j;
                this.bracket = bracket;
                this.bal = bal;
            }

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}