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 inf = 1e9;
struct node {
  int i, j, bal;
  char scoba;
  node() {}
  node(long long _i, long long _j, long long _k, char _scoba)
      : i(_i), j(_j), bal(_k), scoba(_scoba) {}
};
node p[210][210][410];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s, t;
  cin >> s >> t;
  long long n = s.size(), m = t.size();
  vector<vector<vector<long long> > > dp(
      n + 1, vector<vector<long long> >(m + 1, vector<long long>(410, inf)));
  dp[0][0][0] = 0;
  for (long long i = 0; i <= n; ++i) {
    for (long long j = 0; j <= m; ++j) {
      for (long long k = 0; k <= 410; ++k) {
        if (dp[i][j][k] == inf) continue;
        long long nxti = i + (i < n && s[i] == '('),
                  nxtj = j + (j < m && t[j] == '(');
        if (k + 1 < 410 && dp[nxti][nxtj][k + 1] > dp[i][j][k] + 1) {
          dp[nxti][nxtj][k + 1] = dp[i][j][k] + 1;
          p[nxti][nxtj][k + 1] = node(i, j, k, '(');
        }
        nxti = i + (i < n && s[i] == ')'), nxtj = j + (j < m && t[j] == ')');
        if (k > 0 && dp[nxti][nxtj][k - 1] > dp[i][j][k] + 1) {
          dp[nxti][nxtj][k - 1] = dp[i][j][k] + 1;
          p[nxti][nxtj][k - 1] = node(i, j, k, ')');
        }
      }
    }
  }
  long long curi = n, curj = m, cur_balance = 0;
  for (long long i = 0; i < 410; ++i) {
    if (dp[n][m][cur_balance] + cur_balance > dp[n][m][i] + i &&
        dp[n][m][i] != inf) {
      cur_balance = i;
    }
  }
  string ans = "";
  long long temp = cur_balance;
  while (curi > 0 || curj > 0 || cur_balance) {
    node a = p[curi][curj][cur_balance];
    long long ni = a.i;
    long long nj = a.j;
    long long nbal = a.bal;
    ans += a.scoba;
    curi = a.i;
    curj = a.j;
    cur_balance = a.bal;
  }
  while (temp--) ans = ')' + ans;
  reverse(ans.begin(), ans.end());
  cout << ans;
  return 0;
}