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;
int dcmp(double x, double y) {
  return fabs(x - y) <= 1e-9 ? 0 : x < y ? -1 : 1;
}
const int MAX = 220;
char s[MAX], t[MAX];
int n, m;
int memo[MAX][MAX][1500];
int dp(int i, int j, int cnt) {
  if (cnt > 1000 || cnt < 0) return (int)1e9 + 9;
  if (i == n && j == m) {
    return cnt;
  }
  int &ret = memo[i][j][cnt];
  if (ret != -1) return ret;
  int path1 = (int)1e9 + 9;
  int path2 = (int)1e9 + 9;
  int ni = i + (s[i] == ')');
  int nj = j + (t[j] == ')');
  path1 = 1 + dp(ni, nj, cnt - 1);
  ni = i + (s[i] == '(');
  nj = j + (t[j] == '(');
  path2 = 1 + dp(ni, nj, cnt + 1);
  return ret = min(path1, path2);
}
void get_path(int i, int j, int cnt) {
  if (i == n && j == m) {
    if (cnt > 0) {
      for (int k = 0; k < cnt; k++) {
        cout << ')';
      }
    }
    return;
  }
  int path1 = (int)1e9 + 9;
  int path2 = (int)1e9 + 9;
  int &ret = memo[i][j][cnt];
  int ni = i + (s[i] == ')');
  int nj = j + (t[j] == ')');
  path1 = 1 + dp(ni, nj, cnt - 1);
  int ni1 = i + (s[i] == '(');
  int nj1 = j + (t[j] == '(');
  path2 = 1 + dp(ni1, nj1, cnt + 1);
  if (path1 < path2) {
    cout << ')';
    get_path(ni, nj, cnt - 1);
    return;
  } else {
    cout << '(';
    get_path(ni1, nj1, cnt + 1);
    return;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  memset(memo, -1, sizeof(memo));
  cin >> s >> t;
  n = strlen(s);
  m = strlen(t);
  int ans = dp(0, 0, 0);
  get_path(0, 0, 0);
}