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;
template <typename T>
istream& operator>>(istream& is, vector<T>& a) {
  for (T& ai : a) is >> ai;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> const& a) {
  os << "[ ";
  for (const T& ai : a) os << ai << " ";
  return os << "]";
}
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& a) {
  return is >> a.first >> a.second;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2> const& a) {
  return os << "(" << a.first << ", " << a.second << ")";
}
string f() {
  string s, t;
  cin >> s >> t;
  int n = s.size(), m = t.size();
  int l = max(n, m);
  vector<int> prev((n + 1) * (m + 1) * (l + 1), -1);
  queue<int> q;
  q.push(0);
  int d = ((n + 1) * (m + 1) - 1) * (l + 1);
  while (!q.empty() && prev[d] < 0) {
    int u = q.front();
    q.pop();
    int i = u;
    int k = i % (l + 1);
    i /= l + 1;
    int j = i % (m + 1);
    i /= m + 1;
    if (k < l) {
      int v = u + 1;
      if (i < n && s[i] == '(') v += (l + 1) * (m + 1);
      if (j < m && t[j] == '(') v += l + 1;
      if (prev[v] < 0) {
        prev[v] = u;
        q.push(v);
      }
    }
    if (k > 0) {
      int v = u - 1;
      if (i < n && s[i] == ')') v += (l + 1) * (m + 1);
      if (j < m && t[j] == ')') v += l + 1;
      if (prev[v] < 0) {
        prev[v] = u;
        q.push(v);
      }
    }
  }
  string r;
  int u = d;
  while (prev[u] >= 0) {
    r.push_back((u % (l + 1) - prev[u] % (l + 1) > 0) ? '(' : ')');
    u = prev[u];
  }
  reverse((r).begin(), (r).end());
  return r;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << f() << "\n";
  return 0;
}