#include <bits/stdc++.h>
using namespace std;
const int maxn = 205;
const int oo = 1000000009;
char s[maxn], t[maxn];
int n, m, f[maxn][maxn][2 * maxn];
pair<int, pair<int, int> > trace[maxn][maxn][2 * maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s + 1 >> t + 1;
  n = strlen(s + 1);
  m = strlen(t + 1);
  s[n + 1] = 'K';
  t[m + 1] = 'K';
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= m; ++j)
      for (int k = 0; k <= n + m; ++k) f[i][j][k] = oo;
  f[0][0][0] = 0;
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= m; ++j) {
      for (int k = 0; k < n + m; ++k)
        if (f[i][j][k] < oo) {
          int ii = i + (s[i + 1] == '('), jj = j + (t[j + 1] == '(');
          if (f[ii][jj][k + 1] > f[i][j][k] + 1) {
            f[ii][jj][k + 1] = f[i][j][k] + 1;
            trace[ii][jj][k + 1] =
                pair<int, pair<int, int> >(1, pair<int, int>(i, j));
          }
        }
      for (int k = n + m; k > 0; --k)
        if (f[i][j][k] < oo) {
          int ii = i + (s[i + 1] == ')'), jj = j + (t[j + 1] == ')');
          if (f[ii][jj][k - 1] > f[i][j][k] + 1) {
            f[ii][jj][k - 1] = f[i][j][k] + 1;
            trace[ii][jj][k - 1] =
                pair<int, pair<int, int> >(-1, pair<int, int>(i, j));
          }
        }
    }
  vector<char> res;
  int i = n, j = m, k = 0;
  while (i > 0 || j > 0 || k > 0) {
    if (trace[i][j][k].first == 1) {
      res.push_back('(');
      int ti = i;
      i = trace[i][j][k].second.first;
      j = trace[ti][j][k].second.second;
      --k;
    } else {
      res.push_back(')');
      int ti = i;
      i = trace[i][j][k].second.first;
      j = trace[ti][j][k].second.second;
      ++k;
    }
  }
  for (auto i = res.rbegin(); i != res.rend(); ++i) cout << *i;
}
