#include <bits/stdc++.h>
using namespace std;
const int N = 200 + 5;
const int INF = 0X3F3F3F3F;
char a[N], b[N];
int n, m;
int dp[N][N][N];
vector<char> ans;
struct node {
  int x, y, z;
  char c;
  node(int _x = 0, int _y = 0, int _z = 0, char _c = 0) {
    x = _x, y = _y, z = _z, c = _c;
  }
} p[N][N][N];
void bfs() {
  memset(dp, INF, sizeof(dp));
  queue<node> que;
  que.push(node(0, 0, 0));
  dp[0][0][0] = 0;
  while (!que.empty()) {
    node top = que.front();
    que.pop();
    int nx = top.x + (top.x < n && a[top.x] == '(');
    int ny = top.y + (top.y < m && b[top.y] == '(');
    int nz = top.z + 1;
    if (nz <= 200 && nz >= 0 && dp[nx][ny][nz] == INF) {
      dp[nx][ny][nz] = dp[top.x][top.y][top.z] + 1;
      p[nx][ny][nz] = node(top.x, top.y, top.z, '(');
      que.push(node(nx, ny, nz));
    }
    nx = top.x + (top.x < n && a[top.x] == ')');
    ny = top.y + (top.y < m && b[top.y] == ')');
    nz = top.z - 1;
    if (nz <= 200 && nz >= 0 && dp[nx][ny][nz] == INF) {
      dp[nx][ny][nz] = dp[top.x][top.y][top.z] + 1;
      p[nx][ny][nz] = node(top.x, top.y, top.z, ')');
      que.push(node(nx, ny, nz));
    }
  }
}
int main() {
  scanf("%s%s", a, b);
  n = strlen(a);
  m = strlen(b);
  bfs();
  node k = p[n][m][0];
  while (k.x > 0 || k.y > 0 || k.z > 0) {
    ans.push_back(k.c);
    k = p[k.x][k.y][k.z];
  }
  ans.push_back(k.c);
  reverse(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) printf("%c", ans[i]);
  puts("");
}
