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;
long long modulo(long long base, long long exponent, long long modulus);
long long choose(int n, int k);
int inverse(int a, int m);
void build();
void fileio();
int ncr(int n, int r);
const int nax = 1e6 + 10;
const int LG = log2(nax) + 1;
vector<int> fact(nax);
int dp[405][405][405];
int n, m;
string a, b;
int dpsolve(int open, int x, int y) {
  if (open < 0 || open >= (n + m)) return 100000;
  if (x >= n && y >= m) {
    if (open == 0) return 0;
  }
  int &ans = dp[open][x][y];
  if (ans != -1) return ans;
  ans = 100000;
  {
    ans = min(ans, dpsolve(open + 1, x + (x < n && a[x] == '('),
                           y + (y < m && b[y] == '(')) +
                       1);
  }
  {
    ans = min(ans, dpsolve(open - 1, x + (x < n && a[x] == ')'),
                           y + (y < m && b[y] == ')')) +
                       1);
  }
  return ans;
}
string f;
void backtrack(int open, int x, int y) {
  if (open < 0 || open >= (n + m)) return;
  int &ans = dp[open][x][y];
  if (ans == dpsolve(open + 1, x + (x < n && a[x] == '('),
                     y + (y < m && b[y] == '(')) +
                 1) {
    f += '(';
    backtrack(open + 1, x + (x < n && a[x] == '('), y + (y < m && b[y] == '('));
    return;
  }
  if (ans == dpsolve(open - 1, x + (x < n && a[x] == ')'),
                     y + (y < m && b[y] == ')')) +
                 1) {
    f += ')';
    backtrack(open - 1, x + (x < n && a[x] == ')'), y + (y < m && b[y] == ')'));
    return;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> a >> b;
  n = a.size();
  m = b.size();
  memset(dp, -1, sizeof(dp));
  dpsolve(0, 0, 0);
  backtrack(0, 0, 0);
  cout << f << '\n';
  return 0;
}
int ncr(int n, int r) {
  if (r > n || r < 0 || n < 0) return 0;
  int ans = fact[n];
  int temp = (fact[n - r] * fact[r]) % 1000000007;
  ans = (ans * inverse(temp, 1000000007)) % 1000000007;
  return ans;
}
void fileio() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
void build() {
  fact[0] = 1;
  for (int i = 1; i < nax; i++) fact[i] = (fact[i - 1] * i) % 1000000007;
}
long long modulo(long long base, long long exponent, long long modulus) {
  if (modulus == 1) return 0;
  long long result = 1;
  base = base % modulus;
  while (exponent > 0) {
    if (exponent % 2 == 1) {
      result = (result * base) % modulus;
    }
    exponent = exponent >> 1;
    base = (base * base) % modulus;
  }
  return result;
}
long long choose(int n, int k) {
  if (k == 0) return 1;
  return (n * choose(n - 1, k - 1)) / k;
}
void EE(int a, int b, int &co1, int &co2) {
  if (a % b == 0) {
    co1 = 0;
    co2 = 1;
    return;
  }
  EE(b, a % b, co1, co2);
  int temp = co1;
  co1 = co2;
  co2 = temp - co2 * (a / b);
}
int inverse(int a, int m) {
  int x, y;
  EE(a, m, x, y);
  if (x < 0) x += m;
  return x;
}