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

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author NMouad21
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    FTwoBracketSequences solver = new FTwoBracketSequences();
    solver.solve(1, in, out);
    out.close();
  }

  static class FTwoBracketSequences {

    private int n;
    private int m;
    private int mx;
    private char[] s;
    private char[] t;
    private int[][][] dp;
    private char[][][] decision;

    private final int solve(int i, int j, int d) {
      if (d < 0 || d >= mx) {
        return Constants.INF32;
      }
      if (i == n && j == m) {
        for (int x = d; x > 0; x--) {
          decision[i][j][x] = ')';
        }
        return d;
      }
      if (dp[i][j][d] != -1) {
        return dp[i][j][d];
      }

      int ans = Constants.INF32;
      for (char c : "()".toCharArray()) {
        int nans =
            solve(i + (s[i] == c ? 1 : 0), j + (t[j] == c ? 1 : 0), d + (c == '(' ? 1 : -1)) + 1;
        if (nans < ans) {
          ans = nans;
          decision[i][j][d] = c;
        }
      }

      return dp[i][j][d] = ans;
    }

    public final void solve(int testNumber, InputReader in, PrintWriter out) {
      s = (in.next() + "#").toCharArray();
      n = s.length - 1;
      t = (in.next() + "#").toCharArray();
      m = t.length - 1;
      mx = (Math.max(n, m) + 1) << 1;
      dp = new int[n + 1][m + 1][mx];
      decision = new char[n + 1][m + 1][mx];
      ArrayUtils.deepFill(dp, -1);
      solve(0, 0, 0);

      int i = 0, j = 0, d = 0;
      while (decision[i][j][d] != 0) {
        out.print(decision[i][j][d]);
        int ni = i + (s[i] == decision[i][j][d] ? 1 : 0);
        int nj = j + (t[j] == decision[i][j][d] ? 1 : 0);
        int nd = d + ('(' == decision[i][j][d] ? 1 : -1);
        i = ni;
        j = nj;
        d = nd;
      }
      out.println();
    }

  }

  static final class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[1 << 16];
    private int curChar;
    private int numChars;

    public InputReader() {
      this.stream = System.in;
    }

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

    private final int read() {
      if (this.numChars == -1) {
        throw new UnknownError();
      } else {
        if (this.curChar >= this.numChars) {
          this.curChar = 0;

          try {
            this.numChars = this.stream.read(this.buf);
          } catch (IOException ex) {
            throw new InputMismatchException();
          }

          if (this.numChars <= 0) {
            return -1;
          }
        }

        return this.buf[this.curChar++];
      }
    }

    public final String next() {
      int c;
      while (isSpaceChar(c = this.read())) {
      }

      StringBuilder result = new StringBuilder();
      result.appendCodePoint(c);

      while (!isSpaceChar(c = this.read())) {
        result.appendCodePoint(c);
      }

      return result.toString();
    }

    private static final boolean isSpaceChar(final int c) {
      return c == 32 || c == 10 || c == 13 || c == 9
          || c == -1; // 32 == ' ', 10 == '\n', 13 == '\r', 9 == '\t'
    }

  }

  static final class ArrayUtils {

    private ArrayUtils() {
      throw new RuntimeException("DON'T");
    }

    public static final void deepFill(Object o, int v) {
      if (!o.getClass().isArray()) {
        throw new IllegalArgumentException();
      }
      if (o instanceof int[]) {
        int[] arr = (int[]) o;
        Arrays.fill(arr, v);
      } else if (o instanceof Integer[]) {
        Integer[] arr = (Integer[]) o;
        Arrays.fill(arr, v);
      } else {
        Object[] objArray = (Object[]) o;
        for (Object obj : objArray) {
          deepFill(obj, v);
        }
      }
    }

  }

  static class Constants {

    public static final int INF32 = 0x3f3f3f3f;

  }
}

