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;
void fast() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int MAN = 210;
int dp[MAN][MAN][MAN];
tuple<int, int, int> pred[MAN][MAN][MAN];
int INF = 1e9;
signed main() {
  fast();
  int n1, n2, i, j, n2i, n2j, a, b, c, d, bal, ni, nj;
  string s1, s2;
  cin >> s1 >> s2;
  char sk;
  n1 = ((int)s1.size());
  n2 = ((int)s2.size());
  s1 = '#' + s1;
  s2 = '#' + s2;
  for (i = 0; i <= n1; i++)
    for (j = 0; j <= n2; j++)
      for (bal = 0; bal < MAN; bal++) dp[i][j][bal] = INF;
  dp[0][0][0] = 0;
  for (i = 0; i <= n1; i++) {
    for (j = 0; j <= n2; j++) {
      for (bal = 0; bal < MAN; bal++) {
        if (dp[i][j][bal] == INF) continue;
        ni = i + (i + 1 <= n1 && s1[i + 1] == '(');
        nj = j + (j + 1 <= n2 && s2[j + 1] == '(');
        if (bal + 1 < MAN && dp[ni][nj][bal + 1] > dp[i][j][bal] + 1) {
          dp[ni][nj][bal + 1] = dp[i][j][bal] + 1;
          pred[ni][nj][bal + 1] = make_tuple(i, j, bal);
        }
        ni = i + (i + 1 <= n1 && s1[i + 1] == ')');
        nj = j + (j + 1 <= n2 && s2[j + 1] == ')');
        if (bal - 1 >= 0 && dp[ni][nj][bal - 1] > dp[i][j][bal] + 1) {
          dp[ni][nj][bal - 1] = dp[i][j][bal] + 1;
          pred[ni][nj][bal - 1] = make_tuple(i, j, bal);
        }
      }
    }
  }
  int balmi = INF;
  for (i = 0; i < MAN; i++) {
    if (dp[n1][n2][i] + i < balmi) balmi = i;
  }
  string ans = "";
  for (i = 0; i < balmi; i++) {
    ans += ')';
  }
  i = n1;
  j = n2;
  bal = balmi;
  int i2, j2, bal2;
  while (pred[i][j][bal] != make_tuple(0, 0, 0)) {
    tie(i2, j2, bal2) = pred[i][j][bal];
    if (bal2 < bal)
      ans += '(';
    else
      ans += ')';
    i = i2;
    j = j2;
    bal = bal2;
  }
  ans += '(';
  for (i = ((int)ans.size()) - 1; i >= 0; i--) cout << ans[i];
  return 0;
}