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>
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")
using namespace std;
long long power(long long x, long long y, long long m) {
  long long temp;
  if (y == 0) return 1;
  temp = (power(x, y / 2, m)) % m;
  if (y % 2 == 0)
    return ((temp % m) * temp);
  else
    return ((x * temp % m) * temp % m) % m;
}
long long inv(long long x, long long m = 1000000007) {
  return (power(x, m - 2, m)) % m;
}
string s, t;
long long DP[201][201][201], BEST = 0;
long long REC(long long idx, long long idx2, long long C) {
  if (C >= 201) return INT_MAX;
  if (idx == s.size() && idx2 == t.size()) return C;
  if (DP[idx][idx2][C] + 1) return DP[idx][idx2][C];
  bool a = 0, b = 0;
  if (idx < s.size())
    if (s[idx] == '(') a = 1;
  if (idx2 < t.size())
    if (t[idx2] == '(') b = 1;
  long long miner = INT_MAX;
  if (C) {
    miner = REC(min(idx + (!a), (long long)s.size()),
                min(idx2 + (!b), (long long)t.size()), C - 1) +
            1;
  }
  miner = min(miner, REC(min(idx + a, (long long)s.size()),
                         min(idx2 + b, (long long)t.size()), C + 1) +
                         1);
  return DP[idx][idx2][C] = miner;
}
int32_t main() {
  cin.tie(0), iostream::sync_with_stdio(0);
  cin >> s >> t;
  for (long long i = 0; i < 201; i++)
    for (long long l = 0; l < 201; l++)
      for (long long x = 0; x < 201; x++) DP[i][l][x] = -1;
  BEST = REC(0, 0, 0);
  long long A = 0, B = 0, C = 0;
  BEST--;
  while (BEST >= 0) {
    bool F = 0, F2 = 0;
    if (A < s.size())
      if (s[A] == '(') F = 1;
    if (B < t.size())
      if (t[B] == '(') F2 = 1;
    if (C) {
      if (REC(A + (!F), B + (!F2), C - 1) == BEST) {
        cout << ')', BEST--, C--, A = min(A + (!F), (long long)s.size()),
                                  B = min(B + (!F2), (long long)t.size());
        goto a;
      }
    }
    if (REC(A + F, B + F2, C + 1) == BEST)
      cout << '(', BEST--, C++, A = min(A + (F), (long long)s.size()),
                                B = min(B + (F2), (long long)t.size());
    else {
      while (C--) {
        cout << ')';
      }
      return 0;
    }
  a:;
  }
  return 0;
}