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 long long read() {
  char c = getchar();
  long long f = 1, x = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + (c - '0'), c = getchar();
  return x * f;
}
void MOD(int &x) {
  if (x >= 1000000007) x -= 1000000007;
}
int f[210][210][410], g[210][210][410];
char s[210], t[210];
int num;
int dfs(int i, int j, int k) {
  int &w = f[i][j][k];
  if (w != (1 << 30)) return w;
  if (k) {
    int c = dfs(i - (s[i - 1] == '('), j - (t[j - 1] == '('), k - 1) + 1;
    if (c < w) {
      w = c;
      g[i][j][k] = '(';
    }
  }
  if (k < num) {
    int c = dfs(i - (s[i - 1] == ')'), j - (t[j - 1] == ')'), k + 1) + 1;
    if (c < w) {
      w = c;
      g[i][j][k] = ')';
    }
  }
  return w;
}
char ans[1000];
int main() {
  scanf("%s%s", s, t);
  int n = strlen(s), m = strlen(t);
  num = n + m;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= m; j++)
      for (int k = 0; k <= n + m; k++) f[i][j][k] = (1 << 30);
  f[0][0][0] = 0;
  dfs(n, m, 0);
  int i = n, j = m, k = 0;
  int cnt = 0;
  while (i || j || k) {
    ans[++cnt] = g[i][j][k];
    if (g[i][j][k] == '(') {
      i -= (s[i - 1] == '(');
      j -= (t[j - 1] == '(');
      k -= 1;
    } else {
      i -= (s[i - 1] == ')');
      j -= (t[j - 1] == ')');
      k += 1;
    }
  }
  reverse(ans + 1, ans + cnt + 1);
  printf("%s\n", ans + 1);
}