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 MOD = 1000000007;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
char s[222], t[222];
int n, m;
int d[202][202][402];
int go(int N, int M, int c) {
  if (N == n && M == m && c == 0) return 0;
  int &ret = d[N][M][c];
  if (~ret) return ret;
  ret = 987654321;
  if (N == n && M == m) ret = min(ret, 1 + go(N, M, c - 1));
  if (c < 400) {
    int nn = (s[N] == '(' ? N + 1 : N), mm = (t[M] == '(' ? M + 1 : M);
    ret = min(ret, 1 + go(nn, mm, c + 1));
  }
  if (c > 0) {
    int nn = (s[N] == ')' ? N + 1 : N), mm = (t[M] == ')' ? M + 1 : M);
    ret = min(ret, 1 + go(nn, mm, c - 1));
  }
  return ret;
}
void track(int N, int M, int c) {
  if (N == n && M == m && c == 0) return;
  if (N == n && M == m) {
    putchar(')');
    track(N, M, c - 1);
    return;
  }
  int t1 = 987654321, t2 = 987654321;
  int n1, m1, n2, m2;
  if (c < 400) {
    n1 = (s[N] == '(' ? N + 1 : N), m1 = (t[M] == '(' ? M + 1 : M);
    t1 = 1 + go(n1, m1, c + 1);
  }
  if (c > 0) {
    n2 = (s[N] == ')' ? N + 1 : N), m2 = (t[M] == ')' ? M + 1 : M);
    t2 = 1 + go(n2, m2, c - 1);
  }
  if (t1 < t2) {
    putchar('(');
    track(n1, m1, c + 1);
    return;
  } else {
    putchar(')');
    track(n2, m2, c - 1);
    return;
  }
}
int main() {
  memset((d), -1, sizeof(d));
  ;
  scanf("%s%s", s, t);
  n = strlen(s), m = strlen(t);
  track(0, 0, 0);
}