#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long f = 1, x = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + (c - '0'), c = getchar();
  return x * f;
}
void MOD(int &x) {
  if (x >= 1000000007) x -= 1000000007;
}
int f[210][210][410], g[210][210][410];
char s[210], t[210];
int num;
int dfs(int i, int j, int k) {
  int &w = f[i][j][k];
  if (w != (1 << 30)) return w;
  if (k) {
    int c = dfs(i - (s[i - 1] == '('), j - (t[j - 1] == '('), k - 1) + 1;
    if (c < w) {
      w = c;
      g[i][j][k] = '(';
    }
  }
  if (k < num) {
    int c = dfs(i - (s[i - 1] == ')'), j - (t[j - 1] == ')'), k + 1) + 1;
    if (c < w) {
      w = c;
      g[i][j][k] = ')';
    }
  }
  return w;
}
char ans[1000];
int main() {
  scanf("%s%s", s, t);
  int n = strlen(s), m = strlen(t);
  num = n + m;
  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] = (1 << 30);
  f[0][0][0] = 0;
  dfs(n, m, 0);
  int i = n, j = m, k = 0;
  int cnt = 0;
  while (i || j || k) {
    ans[++cnt] = g[i][j][k];
    if (g[i][j][k] == '(') {
      i -= (s[i - 1] == '(');
      j -= (t[j - 1] == '(');
      k -= 1;
    } else {
      i -= (s[i - 1] == ')');
      j -= (t[j - 1] == ')');
      k += 1;
    }
  }
  reverse(ans + 1, ans + cnt + 1);
  printf("%s\n", ans + 1);
}
