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>
int inp() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int sum = 0;
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum;
}
int f[210][210][410];
char s[210], t[210];
int fi[210][210][410], fj[210][210][410], fu[210][210][410];
char br[3] = {'(', ' ', ')'}, ans[10010];
void ckmin(int i, int j, int u, int b, int _i, int _j, int _u) {
  f[i][j][u] = std::min(f[i][j][u], b);
  if (f[i][j][u] == b) {
    fi[i][j][u] = _i;
    fj[i][j][u] = _j;
    fu[i][j][u] = _u;
  }
}
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  int n = strlen(s + 1);
  int m = strlen(t + 1);
  memset(f, 0x3f, sizeof(f));
  f[0][0][0] = 0;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= m; j++) {
      for (int u = 0; u <= 400; u++)
        ckmin(i + (s[i + 1] == '('), j + (t[j + 1] == '('), u + 1,
              f[i][j][u] + 1, i, j, u);
      for (int u = 400; u > 0; u--)
        ckmin(i + (s[i + 1] == ')'), j + (t[j + 1] == ')'), u - 1,
              f[i][j][u] + 1, i, j, u);
    }
  int i = n;
  int j = m;
  int u = 0;
  while (i != 0 || j != 0 || u != 0) {
    ans[f[i][j][u]] = br[fu[i][j][u] - u + 1];
    int _i = fi[i][j][u];
    int _j = fj[i][j][u];
    int _u = fu[i][j][u];
    i = _i;
    j = _j;
    u = _u;
  }
  for (int i = 1; i <= f[n][m][0]; i++) putchar(ans[i]);
  putchar('\n');
}