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 int mod = 998244353;
int pwr(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * 1LL * a) % mod;
    a = (a * 1LL * a) % mod;
    b >>= 1;
  }
  return ans;
}
const int N = 205;
const int M = 405;
int dp[N][N][M];
pair<pair<int, int>, int> par[N][N][M];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  string s, t;
  cin >> s >> t;
  int n = (int)(s).size(), m = (int)(t).size();
  s = '0' + s;
  t = '0' + t;
  s += "#";
  t += "#";
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= m; j++) {
      for (int k = 0; k <= M - 1; k++) {
        dp[i][j][k] = 1e9;
      }
    }
  }
  dp[0][0][0] = 0;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= m; j++) {
      for (int k = 0; k <= M - 1; k++) {
        if (dp[i][j][k] == 1e9) continue;
        if (k + 1 < M) {
          if (dp[i + (s[i + 1] == '(')][j + (t[j + 1] == '(')][k + 1] >
              1 + dp[i][j][k]) {
            dp[i + (s[i + 1] == '(')][j + (t[j + 1] == '(')][k + 1] =
                1 + dp[i][j][k];
            par[i + (s[i + 1] == '(')][j + (t[j + 1] == '(')][k + 1] = {{i, j},
                                                                        k};
          }
        }
        if (k > 0) {
          if (dp[i + (s[i + 1] == ')')][j + (t[j + 1] == ')')][k - 1] >
              1 + dp[i][j][k]) {
            dp[i + (s[i + 1] == ')')][j + (t[j + 1] == ')')][k - 1] =
                1 + dp[i][j][k];
            par[i + (s[i + 1] == ')')][j + (t[j + 1] == ')')][k - 1] = {{i, j},
                                                                        k};
          }
        }
      }
    }
  }
  string ans = "";
  int kk = 0;
  for (int k = 1; k <= M - 1; k++) {
    if (k + dp[n][m][k] < kk + dp[n][m][kk]) kk = k;
  }
  for (int i = 1; i <= kk; i++) {
    ans += ")";
  }
  while (n || m || kk) {
    auto x = par[n][m][kk];
    if (x.second < kk)
      ans += "(";
    else
      ans += ")";
    n = x.first.first, m = x.first.second, kk = x.second;
  }
  reverse(ans.begin(), ans.end());
  cout << ans;
  return 0;
}