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 power_mod(long long num, long long g) {
  if (g == 0) return 1;
  if (g % 2 == 1)
    return (num * power_mod((num * num) % 1000000007, g / 2)) % 1000000007;
  return power_mod((num * num) % 1000000007, g / 2);
}
long long power(long long num, long long g) {
  if (g == 0) return 1;
  if (g % 2 == 1) return (num * power((num * num), g / 2));
  return power((num * num), g / 2);
}
long long a[205][205][205];
long long l, m;
string s, t;
long long solve(long long x, long long y, long long z) {
  if (a[x][y][z] > -1) return a[x][y][z];
  if (x == l && y == m) return a[x][y][z] = z;
  if (x == l) {
    if (t[y] == '(') return a[x][y][z] = solve(x, y + 1, z + 1) + 1;
    if (z > 0) return a[x][y][z] = solve(x, y + 1, z - 1) + 1;
    return a[x][y][z] = solve(x, y + 1, z) + 2;
  }
  if (y == m) {
    if (s[x] == '(') return a[x][y][z] = solve(x + 1, y, z + 1) + 1;
    if (z > 0) return a[x][y][z] = solve(x + 1, y, z - 1) + 1;
    return a[x][y][z] = solve(x + 1, y, z) + 2;
  }
  if (s[x] == t[y]) {
    if (s[x] == '(') return a[x][y][z] = solve(x + 1, y + 1, z + 1) + 1;
    if (z > 0) return a[x][y][z] = solve(x + 1, y + 1, z - 1) + 1;
    return a[x][y][z] = solve(x + 1, y + 1, z) + 2;
  }
  if (z > 0) {
    if (s[x] == '(') {
      return a[x][y][z] =
                 min(solve(x + 1, y, z + 1) + 1, solve(x, y + 1, z - 1) + 1);
    } else {
      return a[x][y][z] =
                 min(solve(x + 1, y, z - 1) + 1, solve(x, y + 1, z + 1) + 1);
    }
  }
  if (s[x] == '(') return a[x][y][z] = solve(x + 1, y, z + 1) + 1;
  return a[x][y][z] = solve(x, y + 1, z + 1) + 1;
}
void solve1(long long x, long long y, long long z) {
  if (x == l && y == m && z == 0) return;
  if (x == l && y == m) {
    cout << ")";
    solve1(x, y, z - 1);
    return;
  }
  if (x == l) {
    if (t[y] == '(') {
      cout << "(";
      solve1(x, y + 1, z + 1);
      return;
    }
    if (z > 0) {
      cout << ")";
      solve1(x, y + 1, z - 1);
      return;
    }
    cout << "()";
    solve1(x, y + 1, z);
    return;
  }
  if (y == m) {
    if (s[x] == '(') {
      cout << "(";
      solve1(x + 1, y, z + 1);
      return;
    }
    if (z > 0) {
      cout << ")";
      solve1(x + 1, y, z - 1);
      return;
    }
    cout << "()";
    solve1(x + 1, y, z);
    return;
  }
  if (s[x] == t[y]) {
    if (t[y] == '(') {
      cout << "(";
      solve1(x + 1, y + 1, z + 1);
      return;
    }
    if (z > 0) {
      cout << ")";
      solve1(x + 1, y + 1, z - 1);
      return;
    }
    cout << "()";
    solve1(x + 1, y + 1, z);
    return;
  }
  if (z > 0) {
    if (s[x] == '(') {
      if (a[x + 1][y][z + 1] < a[x][y + 1][z - 1]) {
        cout << "(";
        solve1(x + 1, y, z + 1);
      } else {
        cout << ")";
        solve1(x, y + 1, z - 1);
      }
      return;
    } else {
      if (a[x + 1][y][z - 1] < a[x][y + 1][z + 1]) {
        cout << ")";
        solve1(x + 1, y, z - 1);
      } else {
        cout << "(";
        solve1(x, y + 1, z + 1);
      }
      return;
    }
  }
  cout << "(";
  if (s[x] == '(') {
    solve1(x + 1, y, z + 1);
  } else
    solve1(x, y + 1, z + 1);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> s >> t;
  l = s.size();
  m = t.size();
  for (long long i = 0; i < l + 1; i++)
    for (long long j = 0; j < m + 1; j++)
      for (long long k = 0; k < max(l, m) + 1; k++) a[i][j][k] = -1;
  solve(0, 0, 0);
  solve1(0, 0, 0);
  return 0;
}