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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int memo[201][201][201];
int nxt[201][201][201];
class FTwoBracketSequences {
  string a;
  string b;
  bool is_open(string &x, int p) { return p < x.length() && x[p] == '('; }
  bool is_close(string &x, int p) { return p < x.length() && x[p] == ')'; }
  int dp(int x, int y, int o) {
    if (x == a.length() && y == b.length() && o == 0) return 0;
    if (memo[x][y][o] != -1) return memo[x][y][o];
    auto &ans = memo[x][y][o];
    ans = 800;
    bool a_open = is_open(a, x);
    bool b_open = is_open(b, y);
    if (a_open || b_open || o == 0) {
      int xp = x + a_open;
      int yp = y + b_open;
      int cur = 1 + dp(xp, yp, o + 1);
      if (cur < ans) {
        ans = cur;
        nxt[x][y][o] = +1;
      }
    }
    if (o) {
      int xp = x + is_close(a, x);
      int yp = y + is_close(b, y);
      int cur = 1 + dp(xp, yp, o - 1);
      if (cur < ans) {
        ans = cur;
        nxt[x][y][o] = -1;
      }
    }
    return ans;
  }

 public:
  void solve(std::istream &in, std::ostream &out) {
    memset(memo, -1, sizeof memo);
    in >> a >> b;
    dp(0, 0, 0);
    int x = 0, y = 0, o = 0;
    while (x < a.length() || y < b.length() || o > 0) {
      int d = nxt[x][y][o];
      o += d;
      assert(o >= 0);
      if (d == +1) {
        out << "(";
        if (is_open(a, x)) ++x;
        if (is_open(b, y)) ++y;
      } else {
        out << ")";
        if (is_close(a, x)) ++x;
        if (is_close(b, y)) ++y;
      }
    }
    out << endl;
  }
};
int main() {
  FTwoBracketSequences solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}