#include <bits/stdc++.h>
const long long inf = 0x3f3f3f3f3f3f3f3LL;
const long long mod = (long long)1e9 + 7;
using namespace std;
template <class T>
void smin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void smax(T& a, T val) {
  if (a < val) a = val;
}
const long long N = 5 * (long long)1e5 + 10;
string s, t;
long long n, m;
long long dp[205][205][205];
vector<char> v;
long long solve(long long idx1, long long idx2, long long balance) {
  if (balance > max(n, m) or balance < 0) return inf;
  if (idx1 >= n and idx2 >= m and balance == 0) {
    return 0;
  }
  long long& ans = dp[idx1][idx2][balance];
  if (ans != -1) {
    return ans;
  }
  ans = inf;
  ans =
      1 + solve(idx1 + (s[idx1] == '('), idx2 + (t[idx2] == '('), balance + 1);
  smin(ans, 1 + solve(idx1 + (s[idx1] == ')'), idx2 + (t[idx2] == ')'),
                      balance - 1));
  return ans;
}
string vals = "";
void trace(long long idx1, long long idx2, long long balance) {
  if (idx1 >= n and idx2 >= m and balance == 0) {
    cout << vals;
    exit(0);
  }
  long long& ans = dp[idx1][idx2][balance];
  if (ans == 1 + solve(idx1 + (s[idx1] == '('), idx2 + (t[idx2] == '('),
                       balance + 1)) {
    vals += "(";
    trace(idx1 + (s[idx1] == '('), idx2 + (t[idx2] == '('), balance + 1);
    return;
  }
  vals += ")";
  trace(idx1 + (s[idx1] == ')'), idx2 + (t[idx2] == ')'), balance - 1);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> s >> t;
  n = (long long)(s.size()), m = (long long)(t.size());
  s = s + '#';
  t = t + '#';
  memset(dp, -1, sizeof dp);
  solve(0, 0, 0);
  trace(0, 0, 0);
  return 0;
}
