Problem: You are given two bracket sequences (not necessarily regular) s and t consisting only of characters '(' and ')'. You want to construct the shortest regular bracket sequence that contains both given bracket sequences as subsequences (not necessarily contiguous).

Recall what is the regular bracket sequence:

  * () is the regular bracket sequence; 
  * if S is the regular bracket sequence, then (S) is a regular bracket sequence; 
  * if S and T regular bracket sequences, then ST (concatenation of S and T) is a regular bracket sequence. 



Recall that the subsequence of the string s is such string t that can be obtained from s by removing some (possibly, zero) amount of characters. For example, "coder", "force", "cf" and "cores" are subsequences of "codeforces", but "fed" and "z" are not.

Input

The first line of the input contains one bracket sequence s consisting of no more than 200 characters '(' and ')'.

The second line of the input contains one bracket sequence t consisting of no more than 200 characters '(' and ')'.

Output

Print one line — the shortest regular bracket sequence that contains both given bracket sequences as subsequences (not necessarily contiguous). If there are several answers, you can print any.

Examples

Input


(())(()
()))()


Output


(())()()


Input


)
((


Output


(())


Input


)
)))


Output


((()))


Input


())
(()(()(()(


Output


(()()()(()()))

Solution (in PYTHON3):

Solution:
import sys,math,itertools
from collections import Counter,deque,defaultdict
from bisect import bisect_left,bisect_right 
from heapq import heappop,heappush,heapify, nlargest
from copy import deepcopy
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_1(): return list(map(lambda x:int(x)-1, sys.stdin.readline().split()))
def inps(): return sys.stdin.readline()
def inpsl(x): tmp = sys.stdin.readline(); return list(tmp[:x])
def err(x): print(x); exit()

s = list(input())
n = len(s)
t = list(input())
m = len(t)
d = {'(':1 , ')':-1}
s = [1 if x=='(' else -1 for x in s]
t = [1 if x=='(' else -1 for x in t]
s.append(0); t.append(0)
K = 210
dp = [[[INF]*K for _ in range(m+2)] for i in range(n+2)]
pa = [[[-1 for k in range(K)] for j in range(m+1)] for i in range(n+1)]
dp[0][0][0] = 0
for i in range(n+1):
    for j in range(m+1):
        for k in range(201):
            nk = k+1
            ni = i+(s[i]==1)
            nj = j+(t[j]==1)
            if dp[ni][nj][nk] > dp[i][j][k]+1:
                dp[ni][nj][nk] = dp[i][j][k]+1
                pa[ni][nj][nk] = (i,j,k)
        for k in range(1,201):
            nk = k-1
            ni = i+(s[i]==-1)
            nj = j+(t[j]==-1)
            if dp[ni][nj][nk] > dp[i][j][k]+1:
                dp[ni][nj][nk] = dp[i][j][k]+1
                pa[ni][nj][nk] = (i,j,k)
rem = -1
mi = INF
for k,num in enumerate(dp[n][m]):
    if k+num < mi:
        rem = k; mi = k+num
res = []
i,j,k = n,m,rem
while i>0 or j>0 or k>0:
    pi,pj,pk = pa[i][j][k]
    if k > pk: res.append('(')
    else: res.append(')')
    i,j,k = pi,pj,pk
res = res[::-1]
for i in range(rem): res.append(')')
print(''.join(res))