#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
void sc(int& x) { scanf("%d", &x); }
void sc(long long& x) { scanf("%lld", &x); }
template <class T, class... Ts>
void sc(T& t, Ts&... ts) {
  sc(t), sc(ts...);
}
const int MAX = 210;
int dp[MAX][MAX][MAX];
char s1[MAX], s2[MAX];
int n1, n2;
pair<pair<int, int>, pair<int, int> > get(int i1, int i2) {
  bool a = (i1 != n1), b = (i2 != n2);
  pair<pair<int, int>, pair<int, int> > ret;
  if (s1[i1] == '(')
    ret.first = {a, 0};
  else
    ret.first = {0, a};
  if (s2[i2] == '(')
    ret.second = {b, 0};
  else
    ret.second = {0, b};
  return ret;
}
int solve(int i1, int i2, int c, bool p = 0) {
  if (c < 0) return INF;
  if (c >= MAX) return INF;
  if (i1 == n1 and i2 == n2) {
    if (p)
      for (int i = 0; i < c; i++) printf(")");
    return c;
  }
  auto& x = dp[i1][i2][c];
  if (x + 1 and !p) return x;
  auto t = get(i1, i2);
  int a = 1 + solve(i1 + t.first.first, i2 + t.second.first, c + 1);
  int b = 1 + solve(i1 + t.first.second, i2 + t.second.second, c - 1);
  if (p) {
    if (a <= b)
      printf("("), solve(i1 + t.first.first, i2 + t.second.first, c + 1, 1);
    else
      printf(")"), solve(i1 + t.first.second, i2 + t.second.second, c - 1, 1);
  }
  return x = min(a, b);
}
int main() {
  scanf(" %s %s", s1, s2);
  n1 = strlen(s1), n2 = strlen(s2);
  memset(dp, -1, sizeof(dp));
  solve(0, 0, 0, 1);
  printf("\n");
  exit(0);
}
