#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
string s1, s2;
bool visited[201][201][201 + 20];
char moves[201][201][201 + 20];
tuple<long long int, long long int, long long int> par[201][201][201 + 20];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s1 >> s2;
  queue<tuple<long long int, long long int, long long int> > fringe;
  memset(moves, -1, sizeof moves);
  fringe.push({0, 0, 0});
  visited[0][0][0] = true;
  while (1) {
    tuple<long long int, long long int, long long int> u = fringe.front();
    long long int i, j, b;
    tie(i, j, b) = u;
    fringe.pop();
    if (u == tuple<long long int, long long int, long long int>{s1.size(),
                                                                s2.size(), 0}) {
      string ans = "";
      while (moves[get<0>(u)][get<1>(u)][get<2>(u)] != -1) {
        ans += moves[get<0>(u)][get<1>(u)][get<2>(u)];
        u = par[get<0>(u)][get<1>(u)][get<2>(u)];
      }
      reverse(ans.begin(), ans.end());
      cout << ans << endl;
      return 0;
    }
    for (auto c : "()") {
      tuple<long long int, long long int, long long int> v = {
          ((i < s1.size() && s1[i] == c) ? i + 1 : i),
          ((j < s2.size() && s2[j] == c) ? j + 1 : j),
          (c == '(' ? b + 1 : b - 1)};
      if (get<2>(v) < 0 || get<2>(v) > 210) continue;
      if (visited[get<0>(v)][get<1>(v)][get<2>(v)]) continue;
      fringe.push(v);
      visited[get<0>(v)][get<1>(v)][get<2>(v)] = 1;
      moves[get<0>(v)][get<1>(v)][get<2>(v)] = c;
      par[get<0>(v)][get<1>(v)][get<2>(v)] = u;
    }
  }
}
