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;
int Get() {
  char c;
  bool o = false;
  while (!isdigit(c = getchar()))
    if (c == '-') o = true;
  int x = c - '0';
  while (isdigit(c = getchar())) x = x * 10 + c - '0';
  return o ? -x : x;
}
const int maxn = 2e2 + 7;
int f[maxn][maxn][maxn << 1];
int prei[maxn][maxn][maxn << 1];
int prej[maxn][maxn][maxn << 1];
int prek[maxn][maxn][maxn << 1];
int ansn;
char ansseq[maxn << 2];
char s[maxn], t[maxn];
int main() {
  scanf("%s\n%s", s + 1, t + 1);
  int n = strlen(s + 1), m = strlen(t + 1);
  memset(f, 127 / 3, sizeof(f));
  f[0][0][0] = 0;
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= m; ++j)
      for (int k = 0; k <= n + m; ++k) {
        if (i == n && j == m) continue;
        int u = i, v = j, w = k + 1;
        if (w <= n + m) {
          if (i < n && s[i + 1] == '(') u = i + 1;
          if (j < m && t[j + 1] == '(') v = j + 1;
          if (f[u][v][w] > f[i][j][k] + 1) {
            f[u][v][w] = f[i][j][k] + 1;
            prei[u][v][w] = i;
            prej[u][v][w] = j;
            prek[u][v][w] = k;
          }
        }
        u = i, v = j, w = k - 1;
        if (w >= 0) {
          if (i < n && s[i + 1] == ')') u = i + 1;
          if (j < m && t[j + 1] == ')') v = j + 1;
          if (f[u][v][w] > f[i][j][k] + 1) {
            f[u][v][w] = f[i][j][k] + 1;
            prei[u][v][w] = i;
            prej[u][v][w] = j;
            prek[u][v][w] = k;
          }
        }
      }
  int ans = 2147483647, ansi = 0;
  for (int i = 0; i <= n + m; ++i)
    if (ans > f[n][m][i] + i) {
      ans = f[n][m][i] + i;
      ansi = i;
    }
  for (int i = 1; i <= ansi; ++i) ansseq[++ansn] = ')';
  int u = n, v = m, w = ansi;
  while (u || v || w) {
    int i = prei[u][v][w], j = prej[u][v][w], k = prek[u][v][w];
    if (w == k + 1) ansseq[++ansn] = '(';
    if (w == k - 1) ansseq[++ansn] = ')';
    u = i, v = j, w = k;
  }
  for (int i = ansn; i >= 1; --i) putchar(ansseq[i]);
}