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, bool p = 0) {
  if (c < 0) return INF;
  if (c >= MAX) return INF;
  if (i1 == n1 and i2 == n2) {
    if (p)
      for (int i = 0; i < c; i++) printf(")");
    return c;
  }
  auto& x = dp[i1][i2][c];
  if (x + 1 and !p) return x;
  auto t = get(i1, i2);
  int a = 1 + solve(i1 + t.first.first, i2 + t.second.first, c + 1);
  int b = 1 + solve(i1 + t.first.second, i2 + t.second.second, c - 1);
  if (p) {
    if (a <= b)
      printf("("), solve(i1 + t.first.first, i2 + t.second.first, c + 1, 1);
    else
      printf(")"), solve(i1 + t.first.second, i2 + t.second.second, c - 1, 1);
  }
  return x = min(a, b);
}
int main() {
  scanf(" %s %s", s1, s2);
  n1 = strlen(s1), n2 = strlen(s2);
  memset(dp, -1, sizeof(dp));
  solve(0, 0, 0, 1);
  printf("\n");
  exit(0);
}