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>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
using namespace std;
const int oo = 2e9;
const long long OO = 4e18;
const long double pi = arg(complex<long double>(-1, 0));
const long double pi2 = pi + pi;
const int md = 0x3b800001;
const int MD = 1e9 + 7;
inline long long time() {
  return chrono ::system_clock().now().time_since_epoch().count();
}
mt19937 rnd(time());
mt19937_64 RND(time());
template <typename t>
inline void umin(t &a, t b) {
  a = min(a, b);
}
template <typename t>
inline void umax(t &a, t b) {
  a = max(a, b);
}
const int N = 228;
string s, t;
int n, m, f[N][N][N + N];
char pr[N][N][N + N];
void solve() {
  memset(f, 127, sizeof f);
  cin >> s >> t;
  n = int(s.size()), m = int(t.size());
  f[0][0][0] = 0;
  pr[0][0][0] = '#';
  for (int i = 0; i < n + 1; ++i)
    for (int j = 0; j < m + 1; ++j) {
      for (int b = 0; b < n + m + 1; ++b)
        if (b) {
          int pi = i, pj = j, pb = b - 1;
          if (i && s[i - 1] == '(') --pi;
          if (j && t[j - 1] == '(') --pj;
          if (f[i][j][b] > f[pi][pj][pb] + 1) {
            f[i][j][b] = f[pi][pj][pb] + 1;
            pr[i][j][b] = '(';
          }
        }
      for (int b = n + m - 1; ~b; --b) {
        int pi = i, pj = j, pb = b + 1;
        if (i && s[i - 1] == ')') --pi;
        if (j && t[j - 1] == ')') --pj;
        if (f[i][j][b] > f[pi][pj][pb] + 1) {
          f[i][j][b] = f[pi][pj][pb] + 1;
          pr[i][j][b] = ')';
        }
      }
    }
  if (f[n][m][0] > 700) return void(cout << "wat\n");
  int i = n, j = m, p = 0;
  string ans = "";
  for (; i || j || p;) {
    char c = pr[i][j][p];
    if (c == '(') {
      --p;
      if (i && s[i - 1] == '(') --i;
      if (j && t[j - 1] == '(') --j;
    } else {
      ++p;
      if (i && s[i - 1] == ')') --i;
      if (j && t[j - 1] == ')') --j;
    }
    if (c != '#') ans += c;
  }
  reverse(ans.begin(), ans.end());
  cout << ans << endl;
}
int main() {
  ios_base ::sync_with_stdio(0);
  solve();
  return 0;
}