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("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
string s1, s2;
bool visited[201][201][201 + 20];
char moves[201][201][201 + 20];
tuple<long long int, long long int, long long int> par[201][201][201 + 20];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s1 >> s2;
  queue<tuple<long long int, long long int, long long int> > fringe;
  memset(moves, -1, sizeof moves);
  fringe.push({0, 0, 0});
  visited[0][0][0] = true;
  while (1) {
    tuple<long long int, long long int, long long int> u = fringe.front();
    long long int i, j, b;
    tie(i, j, b) = u;
    fringe.pop();
    if (u == tuple<long long int, long long int, long long int>{s1.size(),
                                                                s2.size(), 0}) {
      string ans = "";
      while (moves[get<0>(u)][get<1>(u)][get<2>(u)] != -1) {
        ans += moves[get<0>(u)][get<1>(u)][get<2>(u)];
        u = par[get<0>(u)][get<1>(u)][get<2>(u)];
      }
      reverse(ans.begin(), ans.end());
      cout << ans << endl;
      return 0;
    }
    for (auto c : "()") {
      tuple<long long int, long long int, long long int> v = {
          ((i < s1.size() && s1[i] == c) ? i + 1 : i),
          ((j < s2.size() && s2[j] == c) ? j + 1 : j),
          (c == '(' ? b + 1 : b - 1)};
      if (get<2>(v) < 0 || get<2>(v) > 210) continue;
      if (visited[get<0>(v)][get<1>(v)][get<2>(v)]) continue;
      fringe.push(v);
      visited[get<0>(v)][get<1>(v)][get<2>(v)] = 1;
      moves[get<0>(v)][get<1>(v)][get<2>(v)] = c;
      par[get<0>(v)][get<1>(v)][get<2>(v)] = u;
    }
  }
}