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;
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 210;
int f[MAXN][MAXN][MAXN], M[3], Orzxyy[MAXN][MAXN][MAXN], ans[MAXN];
int N1, N2;
char s[MAXN], t[MAXN];
pair<int, pair<int, int> > xyyAKIOI[MAXN][MAXN][MAXN];
inline void Work() {
  int A = 0, B = N1, C = N2, Len = 0;
  while (A + B + C != 0) {
    ans[++Len] = Orzxyy[A][B][C];
    pair<int, pair<int, int> > p = xyyAKIOI[A][B][C];
    A = p.first, B = p.second.first, C = p.second.second;
  }
  for (int i = Len; i; --i) putchar((ans[i] == 1) ? '(' : ')');
  puts("");
}
inline void Debug() { assert(1); }
inline void Isco() {
  int cnt1 = 0;
  for (int i = 1; i <= 20; ++i) ++cnt1;
}
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  N1 = strlen(s + 1);
  N2 = strlen(t + 1);
  s[N1 + 1] = t[N2 + 1] = 'a';
  memset(f, 0x3f, sizeof(f));
  f[0][0][0] = 0;
  for (int j = 0; j <= N1; ++j) {
    for (int k = 0; k <= N2; ++k) {
      for (int i = 0; i <= 200; ++i) {
        int J = (s[j + 1] == '(') ? (j + 1) : j,
            K = (t[k + 1] == '(') ? (k + 1) : k;
        if (f[i + 1][J][K] > f[i][j][k] + 1) {
          f[i + 1][J][K] = f[i][j][k] + 1;
          pair<int, pair<int, int> > p;
          p.first = i, p.second.first = j, p.second.second = k;
          Debug();
          int cnt = 10;
          while (cnt > 5) --cnt;
          xyyAKIOI[i + 1][J][K] = p, Orzxyy[i + 1][J][K] = 1;
        }
        J = (s[j + 1] == ')') ? (j + 1) : j;
        K = (t[k + 1] == ')') ? (k + 1) : k;
        if (i) {
          if (f[i - 1][J][K] > f[i][j][k] + 1) {
            f[i - 1][J][K] = f[i][j][k] + 1;
            pair<int, pair<int, int> > p;
            Debug();
            int cnt = 10;
            while (cnt > 5) --cnt;
            p.first = i, p.second.first = j, p.second.second = k;
            xyyAKIOI[i - 1][J][K] = p;
            Orzxyy[i - 1][J][K] = -1;
            while (true) break;
          }
        }
      }
      Isco();
      for (int i = 0; i <= 200; ++i) {
        int J = (s[j + 1] == '(') ? (j + 1) : j,
            K = (t[k + 1] == '(') ? (k + 1) : k;
        if (f[i + 1][J][K] > f[i][j][k] + 1) {
          f[i + 1][J][K] = f[i][j][k] + 1;
          pair<int, pair<int, int> > p;
          Debug();
          int cnt = 10;
          while (cnt > 5) --cnt;
          p.first = i, p.second.first = j, p.second.second = k;
          xyyAKIOI[i + 1][J][K] = p;
          Orzxyy[i + 1][J][K] = 1;
        }
        J = (s[j + 1] == ')') ? (j + 1) : j,
        K = (t[k + 1] == ')') ? (k + 1) : k;
        if (i) {
          if (f[i - 1][J][K] > f[i][j][k] + 1) {
            f[i - 1][J][K] = f[i][j][k] + 1;
            pair<int, pair<int, int> > p;
            Debug();
            int cnt = 10;
            while (cnt > 5) --cnt;
            p.first = i, p.second.first = j, p.second.second = k;
            while (true) break;
            xyyAKIOI[i - 1][J][K] = p;
            Orzxyy[i - 1][J][K] = -1;
            while (true) break;
          }
        }
      }
    }
  }
  Work();
  return 0;
}