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;
char s[201], t[201];
int m, n;
int f[203][203][403];
int tr[203][203][403][3];
void init() {
  for (int i = 0; i <= 202; ++i)
    for (int j = 0; j <= 202; ++j)
      for (int k = 0; k <= 401; ++k) {
        f[i][j][k] = 999999;
      }
}
void atr(const int &a, const int &b, const int &c, const int &d, const int &e,
         const int &g) {
  tr[d][e][g][0] = a;
  tr[d][e][g][1] = b;
  tr[d][e][g][2] = c;
}
int dp(int i, int j, int k);
void mini(int &res, const int &i, const int &j, const int &k, const int &i0,
          const int &j0, const int &k0) {
  if (dp(i, j, k) + 1 < res) {
    res = dp(i, j, k) + 1;
    atr(i, j, k, i0, j0, k0);
  }
}
int MM = 200;
int dp(int i, int j, int k) {
  if (k < 0 || k > MM) return 999999 - 1;
  if (i > m && j > n) {
    if (k == 0) return 0;
  }
  int &r = f[i][j][k];
  if (r < 999999) return r;
  r = 999999 - 1;
  int di, dj;
  di = (i <= m && s[i] == '(');
  dj = (j <= n && t[j] == '(');
  mini(r, i + di, j + dj, k + 1, i, j, k);
  dj = (j <= n && t[j] == ')');
  di = (i <= m && s[i] == ')');
  mini(r, i + di, j + dj, k - 1, i, j, k);
  return r;
}
int main() {
  scanf(" %s %s", s + 1, t + 1);
  m = strlen(s + 1);
  n = strlen(t + 1);
  MM = min(MM, n + m);
  init();
  int rr;
  cerr << (rr = dp(1, 1, 0));
  string s;
  int x = 1, y = 1, z = 0, u, v, w;
  for (; s.size() < rr;) {
    u = tr[x][y][z][0];
    v = tr[x][y][z][1];
    w = tr[x][y][z][2];
    if (z < w)
      s.push_back('(');
    else
      s.push_back(')');
    x = u;
    y = v;
    z = w;
    if (x > m && y > n) {
      if (z > 0) {
        string tc(z, ')');
        s += tc;
      } else {
        string to(-z, '(');
        s = to + s;
      }
      break;
    }
  }
  cout << s;
  return 0;
}