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;
const long long mod = 1e9 + 7;
long long power(long long a, long long b, long long m = mod) {
  long long x = 1;
  while (b) {
    if (b & 1) {
      x = 1ll * x * a % m;
    }
    a = 1ll * a * a % m;
    b /= 2;
  }
  return x;
}
const int N = 2e5 + 9;
string s, t;
int n, m;
int dp[202][202][202], from[202][202][202];
const int inf = mod;
int solve(int p1, int p2, int bal) {
  if (bal < 0 || bal > 200) return inf;
  if (p1 == 0 && p2 == 0 && bal == 0) {
    return 0;
  }
  int &ret = dp[p1][p2][bal];
  if (ret != -1) return ret;
  int u, v;
  if (s[p1] == '(' && t[p2] == '(') {
    u = solve(max(0, p1 - 1), max(0, p2 - 1), bal - 1);
    v = solve(p1, p2, bal + 1);
  } else if (s[p1] == '(') {
    u = solve(max(0, p1 - 1), p2, bal - 1);
    v = solve(p1, max(0, p2 - 1), bal + 1);
  } else if (t[p2] == '(') {
    u = solve(p1, max(0, p2 - 1), bal - 1);
    v = solve(max(0, p1 - 1), p2, bal + 1);
  } else if (p1 + p2 == 0) {
    u = solve(p1, p2, bal - 1);
    v = inf;
  } else {
    u = solve(p1, p2, bal - 1);
    v = solve(max(0, p1 - 1), max(0, p2 - 1), bal + 1);
  }
  if (u <= v) {
    from[p1][p2][bal] = 1;
    ret = 1 + u;
  } else {
    from[p1][p2][bal] = 2;
    ret = 1 + v;
  }
  return ret;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s >> t;
  n = s.size();
  m = t.size();
  s = '_' + s;
  t = '_' + t;
  memset(dp, -1, sizeof dp);
  solve(n, m, 0);
  string ans;
  int p1 = n, p2 = m, bal = 0;
  while (p1 > 0 || p2 > 0 || bal > 0) {
    int q = from[p1][p2][bal];
    if (q == 1) {
      if (s[p1] == '(') p1--;
      if (t[p2] == '(') p2--;
      bal--;
      ans += '(';
    } else {
      if (s[p1] == ')') p1--;
      if (t[p2] == ')') p2--;
      bal++;
      ans += ')';
    }
  }
  reverse(ans.begin(), ans.end());
  cout << ans << "\n";
  return 0;
}