#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
char s[222], t[222];
int n, m;
int d[202][202][402];
int go(int N, int M, int c) {
  if (N == n && M == m && c == 0) return 0;
  int &ret = d[N][M][c];
  if (~ret) return ret;
  ret = 987654321;
  if (N == n && M == m) ret = min(ret, 1 + go(N, M, c - 1));
  if (c < 400) {
    int nn = (s[N] == '(' ? N + 1 : N), mm = (t[M] == '(' ? M + 1 : M);
    ret = min(ret, 1 + go(nn, mm, c + 1));
  }
  if (c > 0) {
    int nn = (s[N] == ')' ? N + 1 : N), mm = (t[M] == ')' ? M + 1 : M);
    ret = min(ret, 1 + go(nn, mm, c - 1));
  }
  return ret;
}
void track(int N, int M, int c) {
  if (N == n && M == m && c == 0) return;
  if (N == n && M == m) {
    putchar(')');
    track(N, M, c - 1);
    return;
  }
  int t1 = 987654321, t2 = 987654321;
  int n1, m1, n2, m2;
  if (c < 400) {
    n1 = (s[N] == '(' ? N + 1 : N), m1 = (t[M] == '(' ? M + 1 : M);
    t1 = 1 + go(n1, m1, c + 1);
  }
  if (c > 0) {
    n2 = (s[N] == ')' ? N + 1 : N), m2 = (t[M] == ')' ? M + 1 : M);
    t2 = 1 + go(n2, m2, c - 1);
  }
  if (t1 < t2) {
    putchar('(');
    track(n1, m1, c + 1);
    return;
  } else {
    putchar(')');
    track(n2, m2, c - 1);
    return;
  }
}
int main() {
  memset((d), -1, sizeof(d));
  ;
  scanf("%s%s", s, t);
  n = strlen(s), m = strlen(t);
  track(0, 0, 0);
}
