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 PYTHON):

Solution:
import sys
range = xrange
input = raw_input

A = [0 if c == '(' else 1 for c in input()]
B = [0 if c == '(' else 1 for c in input()]

n = len(A)
m = len(B)

big = 10**8

DP = [[[big]*201 for _ in range(n + 1)] for _ in range(m + 1)]
DP[0][0][0] = 0
way = [[[-1]*201 for _ in range(n + 1)] for _ in range(m + 1)]

for j in range(m + 1):
    for i in range(n + 1):
        DPji = DP[j][i]
        iprim = i + (i < n and A[i] == 1)
        jprim = j + (j < m and B[j] == 1)
        for k in reversed(range(1, 201)):
            val = DPji[k] + 1
            if DP[jprim][iprim][k - 1] > val:
                DP[jprim][iprim][k - 1] = val
                way[jprim][iprim][k - 1] = 1
        
        iprim = i + (i < n and A[i] == 0)
        jprim = j + (j < m and B[j] == 0)
        for k in range(200):
            val = DPji[k] + 1
            if DP[jprim][iprim][k + 1] > val:
                DP[jprim][iprim][k + 1] = val
                way[jprim][iprim][k + 1] = 0
        
        iprim = i + (i < n and A[i] == 1)
        jprim = j + (j < m and B[j] == 1)
        for k in reversed(range(1, 201)):
            val = DPji[k] + 1
            if DP[jprim][iprim][k - 1] > val:
                DP[jprim][iprim][k - 1] = val
                way[jprim][iprim][k - 1] = 1
ans = []

i = n
j = m
k = 0
counter = 0
while i != 0 or j != 0 or k != 0:
    counter += 1
    c = way[j][i][k]
    ans.append(c)
    val = DP[j][i][k] - 1
    k += 1 - 2 * (c == 0)

    matchi = +(i > 0 and A[i - 1] == c)
    matchj = +(j > 0 and B[j - 1] == c)
    
    if DP[j][i][k] == val:
        pass
    elif matchi and DP[j][i - 1][k] == val:
        i -= 1
    elif matchj and DP[j - 1][i][k] == val:
        j -= 1
    else:
        i -= 1
        j -= 1

#print DP[m][n][0]
print ''.join('(' if x == 0 else ')' for x in reversed(ans))