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 INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
void sc(int& x) { scanf("%d", &x); }
void sc(long long& x) { scanf("%lld", &x); }
template <class T, class... Ts>
void sc(T& t, Ts&... ts) {
  sc(t), sc(ts...);
}
const int MAX = 210;
int dp[MAX][MAX][MAX];
char s1[MAX], s2[MAX];
int n1, n2;
pair<pair<int, int>, pair<int, int> > get(int i1, int i2) {
  bool a = (i1 != n1), b = (i2 != n2);
  pair<pair<int, int>, pair<int, int> > ret;
  if (s1[i1] == '(')
    ret.first = {a, 0};
  else
    ret.first = {0, a};
  if (s2[i2] == '(')
    ret.second = {b, 0};
  else
    ret.second = {0, b};
  return ret;
}
int solve(int i1, int i2, int c) {
  if (c < 0) return INF;
  if (c >= MAX) return INF;
  if (i1 == n1 and i2 == n2) return c;
  auto& x = dp[i1][i2][c];
  if (x + 1) return x;
  x = INF;
  auto t = get(i1, i2);
  x = min(x, 1 + solve(i1 + t.first.first, i2 + t.second.first, c + 1));
  x = min(x, 1 + solve(i1 + t.first.second, i2 + t.second.second, c - 1));
  return x;
}
void rec(int i1, int i2, int c) {
  if (i1 == n1 and i2 == n2) {
    while (c--) printf(")");
    return;
  }
  int ans = solve(i1, i2, c);
  auto t = get(i1, i2);
  if (ans == 1 + solve(i1 + t.first.first, i2 + t.second.first, c + 1))
    printf("("), rec(i1 + t.first.first, i2 + t.second.first, c + 1);
  else
    printf(")"), rec(i1 + t.first.second, i2 + t.second.second, c - 1);
}
int main() {
  scanf(" %s %s", s1, s2);
  n1 = strlen(s1), n2 = strlen(s2);
  memset(dp, -1, sizeof(dp));
  rec(0, 0, 0);
  printf("\n");
  exit(0);
}