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


(()()()(()()))
import java.io.*;
import java.util.*;

public class D {

    public static void main(String[] args) {
        FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = 1;
        while (t --> 0) solver.solve(1, scan, out);
        out.close();
    }

    static class Task {
        static char[] a, b;
        static ArrayDeque<State> queue = new ArrayDeque<>();
        static boolean[][][] found;
        static State ans = null;

        public void solve(int testNumber, FastReader scan, PrintWriter out) {
            a = scan.next().toCharArray();
            b = scan.next().toCharArray();
            queue.addLast(new State(0, 0, 0, 'N'));
            found = new boolean[a.length+1][b.length+1][a.length+b.length+1];
            while(!queue.isEmpty()) {
                State p = queue.pollFirst();
                if(p.x == a.length && p.y == b.length && p.z == 0) {
                    ans = p;
                    break;
                }
                if(p.z < found[0][0].length-1) {
                    State open = next(p, '(');
                    if (!found[open.x][open.y][open.z]) {
                        queue.addLast(open);
                        found[open.x][open.y][open.z] = true;
                    }
                }
                if(p.z > 0) {
                    State closed = next(p, ')');
                    if (!found[closed.x][closed.y][closed.z]) {
                        queue.addLast(closed);
                        found[closed.x][closed.y][closed.z] = true;
                    }
                }
            }
            StringBuilder res = new StringBuilder();
            while(ans.prev != null) {
                res.append(ans.curr);
                ans = ans.prev;
            }
            out.println(res.reverse());
        }

        static State next(State prev, char curr) {
            State ret = new State(prev.x, prev.y, prev.z, curr);
            if(ret.x != a.length && a[ret.x] == curr) ret.x++;
            if(ret.y != b.length && b[ret.y] == curr) ret.y++;
            ret.z += curr == '(' ? 1 : -1;
            ret.prev = prev;
            return ret;
        }

        static class State {
            int x, y, z;
            State prev = null;
            char curr;
            public State(int a, int b, int c, char d) {
                x = a;
                y = b;
                z = c;
                curr = d;
            }
        }

    }

    static void shuffle(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffle(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

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

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}