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 N = 205;
long long n1, n2, dp[N][N][N];
string s1, s2, s = "";
long long go(long long i, long long j, long long k) {
  if (k < 0 || k >= N) return 1e10;
  if (i == n1 && j == n2 && k == 0) return 0;
  long long &ans = dp[i][j][k];
  if (ans != -1) return ans;
  ans = 1e10;
  long long x, y;
  x = i;
  y = j;
  if (i < n1 && s1[i] == '(') x++;
  if (j < n2 && s2[j] == '(') y++;
  ans = min(ans, 1 + go(x, y, k + 1));
  x = i;
  y = j;
  if (i < n1 && s1[i] == ')') x++;
  if (j < n2 && s2[j] == ')') y++;
  ans = min(ans, 1 + go(x, y, k - 1));
  return ans;
}
void build(long long i, long long j, long long k) {
  long long x1, x2, y1, y2;
  x1 = x2 = i;
  y1 = y2 = j;
  if (s1[i] == '(') x1++;
  if (s2[j] == '(') y1++;
  if (s1[i] == ')') x2++;
  if (s2[j] == ')') y2++;
  if (i == n1 && j == n2 && k == 0) return;
  if (go(i, j, k) == (1 + go(x1, y1, k + 1))) {
    s += "(";
    build(x1, y1, k + 1);
  } else {
    s += ")";
    build(x2, y2, k - 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, i, j, x, y, t;
  cin >> s1 >> s2;
  n1 = s1.size();
  n2 = s2.size();
  memset(dp, -1, sizeof(dp));
  go(0, 0, 0);
  x = y = 0;
  if (s1[0] == '(') x++;
  if (s2[0] == '(') y++;
  build(0, 0, 0);
  cout << s;
}