#include <bits/stdc++.h>
using namespace std;
long long power_mod(long long num, long long g) {
  if (g == 0) return 1;
  if (g % 2 == 1)
    return (num * power_mod((num * num) % 1000000007, g / 2)) % 1000000007;
  return power_mod((num * num) % 1000000007, g / 2);
}
long long power(long long num, long long g) {
  if (g == 0) return 1;
  if (g % 2 == 1) return (num * power((num * num), g / 2));
  return power((num * num), g / 2);
}
long long a[205][205][205];
long long l, m;
string s, t;
long long solve(long long x, long long y, long long z) {
  if (a[x][y][z] > -1) return a[x][y][z];
  if (x == l && y == m) return a[x][y][z] = z;
  if (x == l) {
    if (t[y] == '(') return a[x][y][z] = solve(x, y + 1, z + 1) + 1;
    if (z > 0) return a[x][y][z] = solve(x, y + 1, z - 1) + 1;
    return a[x][y][z] = solve(x, y + 1, z) + 2;
  }
  if (y == m) {
    if (s[x] == '(') return a[x][y][z] = solve(x + 1, y, z + 1) + 1;
    if (z > 0) return a[x][y][z] = solve(x + 1, y, z - 1) + 1;
    return a[x][y][z] = solve(x + 1, y, z) + 2;
  }
  if (s[x] == t[y]) {
    if (s[x] == '(') return a[x][y][z] = solve(x + 1, y + 1, z + 1) + 1;
    if (z > 0) return a[x][y][z] = solve(x + 1, y + 1, z - 1) + 1;
    return a[x][y][z] = solve(x + 1, y + 1, z) + 2;
  }
  if (z > 0) {
    if (s[x] == '(') {
      return a[x][y][z] =
                 min(solve(x + 1, y, z + 1) + 1, solve(x, y + 1, z - 1) + 1);
    } else {
      return a[x][y][z] =
                 min(solve(x + 1, y, z - 1) + 1, solve(x, y + 1, z + 1) + 1);
    }
  }
  if (s[x] == '(') return a[x][y][z] = solve(x + 1, y, z + 1) + 1;
  return a[x][y][z] = solve(x, y + 1, z + 1) + 1;
}
void solve1(long long x, long long y, long long z) {
  if (x == l && y == m && z == 0) return;
  if (x == l && y == m) {
    cout << ")";
    solve1(x, y, z - 1);
    return;
  }
  if (x == l) {
    if (t[y] == '(') {
      cout << "(";
      solve1(x, y + 1, z + 1);
      return;
    }
    if (z > 0) {
      cout << ")";
      solve1(x, y + 1, z - 1);
      return;
    }
    cout << "()";
    solve1(x, y + 1, z);
    return;
  }
  if (y == m) {
    if (s[x] == '(') {
      cout << "(";
      solve1(x + 1, y, z + 1);
      return;
    }
    if (z > 0) {
      cout << ")";
      solve1(x + 1, y, z - 1);
      return;
    }
    cout << "()";
    solve1(x + 1, y, z);
    return;
  }
  if (s[x] == t[y]) {
    if (t[y] == '(') {
      cout << "(";
      solve1(x + 1, y + 1, z + 1);
      return;
    }
    if (z > 0) {
      cout << ")";
      solve1(x + 1, y + 1, z - 1);
      return;
    }
    cout << "()";
    solve1(x + 1, y + 1, z);
    return;
  }
  if (z > 0) {
    if (s[x] == '(') {
      if (a[x + 1][y][z + 1] < a[x][y + 1][z - 1]) {
        cout << "(";
        solve1(x + 1, y, z + 1);
      } else {
        cout << ")";
        solve1(x, y + 1, z - 1);
      }
      return;
    } else {
      if (a[x + 1][y][z - 1] < a[x][y + 1][z + 1]) {
        cout << ")";
        solve1(x + 1, y, z - 1);
      } else {
        cout << "(";
        solve1(x, y + 1, z + 1);
      }
      return;
    }
  }
  cout << "(";
  if (s[x] == '(') {
    solve1(x + 1, y, z + 1);
  } else
    solve1(x, y + 1, z + 1);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> s >> t;
  l = s.size();
  m = t.size();
  for (long long i = 0; i < l + 1; i++)
    for (long long j = 0; j < m + 1; j++)
      for (long long k = 0; k < max(l, m) + 1; k++) a[i][j][k] = -1;
  solve(0, 0, 0);
  solve1(0, 0, 0);
  return 0;
}
