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;
string S, T;
int A, B;
int hoge[202][202][204];
vector<int> from[202][202][204];
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> S >> T;
  A = S.size();
  B = T.size();
  memset(hoge, 0x11, sizeof(hoge));
  hoge[0][0][0] = 0;
  for (x = 0; x < (A + 1); x++)
    for (y = 0; y < (B + 1); y++) {
      for (i = 0; i < (102); i++) {
        int nx = x;
        int ny = y;
        if (x < A && S[x] == '(') nx++;
        if (y < B && T[y] == '(') ny++;
        if (hoge[x][y][i] + 1 < hoge[nx][ny][i + 1]) {
          hoge[nx][ny][i + 1] = hoge[x][y][i] + 1;
          from[nx][ny][i + 1] = {x, y, i, '('};
        }
        nx = x, ny = y;
        if (x < A && S[x] == ')') nx++;
        if (y < B && T[y] == ')') ny++;
        if (i && hoge[x][y][i] + 1 < hoge[nx][ny][i - 1]) {
          hoge[nx][ny][i - 1] = hoge[x][y][i] + 1;
          from[nx][ny][i - 1] = {x, y, i, ')'};
        }
      }
      for (i = 100; i >= 0; i--) {
        int nx = x;
        int ny = y;
        if (x < A && S[x] == '(') nx++;
        if (y < B && T[y] == '(') ny++;
        if (hoge[x][y][i] + 1 < hoge[nx][ny][i + 1]) {
          hoge[nx][ny][i + 1] = hoge[x][y][i] + 1;
          from[nx][ny][i + 1] = {x, y, i, '('};
        }
        nx = x, ny = y;
        if (x < A && S[x] == ')') nx++;
        if (y < B && T[y] == ')') ny++;
        if (i && hoge[x][y][i] + 1 < hoge[nx][ny][i - 1]) {
          hoge[nx][ny][i - 1] = hoge[x][y][i] + 1;
          from[nx][ny][i - 1] = {x, y, i, ')'};
        }
      }
    }
  x = A, y = B, i = 0;
  while (hoge[x][y][i]) {
    s.push_back(from[x][y][i][3]);
    int nx = from[x][y][i][0];
    int ny = from[x][y][i][1];
    int ni = from[x][y][i][2];
    x = nx, y = ny, i = ni;
  }
  reverse((s.begin()), (s.end()));
  cout << s << endl;
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}