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;
const int N = 203;
const int inf = 1e9;
inline int read() {
  int p = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    p = p * 10 + ch - '0';
    ch = getchar();
  }
  return p * f;
}
char a[N], b[N];
struct node {
  int i, j, k;
  node() {}
  node(int _i, int _j, int _k) {
    i = _i;
    j = _j;
    k = _k;
  }
};
node g[N][N][N];
char ch[N][N][N];
int nw = 0;
bool f[N][N][N];
queue<node> q;
vector<char> ans;
int main() {
  scanf("%s%s", a + 1, b + 1);
  int alen = strlen(a + 1);
  int blen = strlen(b + 1);
  q.push({0, 0, 0});
  memset(f, 0, sizeof(f));
  f[0][0][0] = 1;
  while (!q.empty()) {
    int i = q.front().i;
    int j = q.front().j;
    int k = q.front().k;
    q.pop();
    if (k < alen + blen) {
      int x = i + (a[i + 1] == '(');
      int y = j + (b[j + 1] == '(');
      int z = k + 1;
      if (!f[x][y][z]) {
        f[x][y][z] = 1;
        q.push(node(x, y, z));
        ch[x][y][z] = '(';
        g[x][y][z] = node(i, j, k);
      }
    }
    if (k) {
      int x = i + (a[i + 1] == ')');
      int y = j + (b[j + 1] == ')');
      int z = k - 1;
      if (!f[x][y][z]) {
        f[x][y][z] = 1;
        q.push(node(x, y, z));
        ch[x][y][z] = ')';
        g[x][y][z] = node(i, j, k);
      }
    }
    if (i == alen && j == blen && k == 0) {
      while (i || j || k) {
        ans.push_back(ch[i][j][k]);
        int x = g[i][j][k].i;
        int y = g[i][j][k].j;
        int z = g[i][j][k].k;
        i = x;
        j = y;
        k = z;
      }
    }
  }
  for (int i = ans.size() - 1; i >= 0; i--) printf("%c", ans[i]);
  printf("\n");
  return 0;
}