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 N = 205;
int dp[N][N][2 * N], n, m, idxi, idxj, idx1, idx2, k, idxx, k1, val;
pair<pair<int, int>, int> dp1[N][N][2 * N];
string s1, s2;
vector<char> v;
int main() {
  cin >> s1 >> s2;
  n = s1.size();
  m = s2.size();
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= m; j++) {
      for (int k = 0; k <= 400; 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 <= 400; k++) {
        if (dp[i][j][k] == 1e9) continue;
        idxi = i;
        idxj = j;
        if (i == 1 && j == 3 && k == 2) {
        }
        if (i < n)
          if (s1[i] == '(') idxi++;
        if (j < m)
          if (s2[j] == '(') idxj++;
        if (dp[idxi][idxj][k + 1] >= dp[i][j][k] + 1) {
          dp[idxi][idxj][k + 1] = dp[i][j][k] + 1;
          dp1[idxi][idxj][k + 1] = {{i, j}, 1};
        }
        idxi = i;
        idxj = j;
        if (i < n)
          if (s1[i] == ')') idxi++;
        if (j < m)
          if (s2[j] == ')') idxj++;
        if (dp[idxi][idxj][k - 1] >= dp[i][j][k] + 1) {
          dp[idxi][idxj][k - 1] = dp[i][j][k] + 1;
          dp1[idxi][idxj][k - 1] = {{i, j}, -1};
        }
      }
    }
  }
  idx1 = n;
  idx2 = m;
  k = 0;
  for (int i = 0; i <= 400; i++) {
    if (1e9 != dp[n][m][i]) {
      val = i;
      break;
    }
  }
  for (int i = 1; i <= val; i++) {
    v.push_back(')');
  }
  k = val;
  while (true) {
    if (idx1 == idx2 && idx1 == 0 && k == 0) {
      break;
    }
    k1 = k;
    if (dp1[idx1][idx2][k].second == 1LL)
      v.push_back('('), k--;
    else
      v.push_back(')'), k++;
    idxx = idx1;
    idx1 = dp1[idx1][idx2][k1].first.first;
    idx2 = dp1[idxx][idx2][k1].first.second;
  }
  reverse(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    cout << v[i];
  }
}