Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
ls = len( s)
lt = len( t)
CNT = [ [0]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            CNT[i][j] = CNT[i-1][j-1]+1
        else:
            if CNT[i][j-1] >= CNT[i-1][j]:
                CNT[i][j] = CNT[i][j-1]
            else:
                CNT[i][j] = CNT[i-1][j]
i = lt
j = ls
ans = ""
while i > 0 and j > 0:
    if t[i-1] == s[j-1]:
        ans += t[i-1]
        i -= 1
        j -= 1
    else:
        if CNT[i-1][j] > CNT[i][j-1]:
            i -= 1
        else:
            j -= 1
print( ans[::-1])

Fixed submission:
s = input()
t = input()
ls = len( s)
lt = len( t)
CNT = [ [0]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            CNT[i][j] = CNT[i-1][j-1]+1
        else:
            if CNT[i][j-1] >= CNT[i-1][j]:
                CNT[i][j] = CNT[i][j-1]
            else:
                CNT[i][j] = CNT[i-1][j]
i = lt
j = ls
ans = ""
while i > 0 and j > 0:
    if t[i-1] == s[j-1]:
        ans += t[i-1]
        i -= 1
        j -= 1
    else:
        if CNT[i-1][j] > CNT[i][j-1]:
            i -= 1
        else:
            j -= 1
print( ans[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
ls = len( s)
lt = len( t)
ANS = [ [""]*(ls+1) for _ in range(lt+1) ]
CNT = [ [0]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            ANS[i][j] = ANS[i-1][j-1]+s[j-1]
            CNT[i][j] = CNT[i-1][j-1]+1
        else:
            if CNT[i][j-1] >= CNT[i-1][j]:
                ANS[i][j] = ANS[i][j-1]
                CNT[i][j] = CNT[i][j-1]
            else:
                ANS[i][j] = ANS[i-1][j]
                CNT[i][j] = CNT[i-1][j]
print( ANS[lt][ls])

Fixed submission:
s = input()
t = input()
ls = len( s)
lt = len( t)
CNT = [ [0]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            CNT[i][j] = CNT[i-1][j-1]+1
        else:
            if CNT[i][j-1] >= CNT[i-1][j]:
                CNT[i][j] = CNT[i][j-1]
            else:
                CNT[i][j] = CNT[i-1][j]
i = lt
j = ls
ans = ""
while i > 0 and j > 0:
    if t[i-1] == s[j-1]:
        ans += t[i-1]
        i -= 1
        j -= 1
    else:
        if CNT[i-1][j] > CNT[i][j-1]:
            i -= 1
        else:
            j -= 1
print( ans[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
ls = len( s)
lt = len( t)
ANS = [ [""]*(ls+1) for _ in range(lt+1) ]
CNT = [ [0]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            ANS[i][j] = ANS[i-1][j-1]+s[j-1]
            CNT[i][j] = CNT[i-1][j-1]+1
        else:
            if CNT[i][j-1] >= CNT[i-1][j]:
                ANS[i][j] = ANS[i][j-1]
                CNT[i][j] = CNT[i][j-1]
            else:
                ANS[i][j] = ANS[i-1][j]
                CNT[i][j] = CNT[i-1][j]
print( ANS[lt][ls])

Fixed submission:
s = input()
t = input()
ls = len( s)
lt = len( t)
CNT = [ [0]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            CNT[i][j] = CNT[i-1][j-1]+1
        else:
            if CNT[i][j-1] >= CNT[i-1][j]:
                CNT[i][j] = CNT[i][j-1]
            else:
                CNT[i][j] = CNT[i-1][j]
i = lt
j = ls
ans = ""
while i > 0 and j > 0:
    if t[i-1] == s[j-1]:
        ans += t[i-1]
        i -= 1
        j -= 1
    else:
        if CNT[i-1][j] > CNT[i][j-1]:
            i -= 1
        else:
            j -= 1
print( ans[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
ls = len( s)
lt = len( t)
ANS = [ [("", 0)]*(ls+1) for _ in range(lt+1) ]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            word, cnt = ANS[i-1][j-1]
            ANS[i][j] = ( word + s[j-1], cnt + 1)
        else:
            wordo, cnto = ANS[i-1][j]
            wordl, cntl = ANS[i][j-1]
            if cnto >= cntl:
                ANS[i][j] = (wordo, cnto)
            else:
                ANS[i][j] = (wordl, cntl)
print( ANS[lt][ls][0])


Fixed submission:
s = input()
t = input()
ls = len( s)
lt = len( t)
CNT = [ [0]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            CNT[i][j] = CNT[i-1][j-1]+1
        else:
            if CNT[i][j-1] >= CNT[i-1][j]:
                CNT[i][j] = CNT[i][j-1]
            else:
                CNT[i][j] = CNT[i-1][j]
i = lt
j = ls
ans = ""
while i > 0 and j > 0:
    if t[i-1] == s[j-1]:
        ans += t[i-1]
        i -= 1
        j -= 1
    else:
        if CNT[i-1][j] > CNT[i][j-1]:
            i -= 1
        else:
            j -= 1
print( ans[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
ls = len( s)
lt = len( t)
ANS = [ [("", 0)]*(ls+1) for _ in range(lt+1) ]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            word, cnt = ANS[i-1][j-1]
            ANS[i][j] = ( word + s[j-1], cnt + 1)
        else:
            wordo, cnto = ANS[i-1][j]
            wordl, cntl = ANS[i][j-1]
            if cnto >= cntl:
                ANS[i][j] = (wordo, cnto)
            else:
                ANS[i][j] = (wordl, cntl)
print( ANS[lt][ls][0])


Fixed submission:
s = input()
t = input()
ls = len( s)
lt = len( t)
CNT = [ [0]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            CNT[i][j] = CNT[i-1][j-1]+1
        else:
            if CNT[i][j-1] >= CNT[i-1][j]:
                CNT[i][j] = CNT[i][j-1]
            else:
                CNT[i][j] = CNT[i-1][j]
i = lt
j = ls
ans = ""
while i > 0 and j > 0:
    if t[i-1] == s[j-1]:
        ans += t[i-1]
        i -= 1
        j -= 1
    else:
        if CNT[i-1][j] > CNT[i][j-1]:
            i -= 1
        else:
            j -= 1
print( ans[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
ls = len( s)
lt = len( t)
LCS = [ [0]*(ls+1) for _ in range( lt+1)]
LC = [ [""]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1, ls+1):
        if t[i-1] == s[j-1]:
            LCS[i][j] = LCS[i-1][j-1] + 1
            LC[i][j] = LC[i-1][j-1] + t[i-1]
        else:
            if LCS[i][j-1] <= LCS[i-1][j]:
                LCS[i][j] = LCS[i-1][j]
                LC[i][j] = LC[i-1][j]
            else:
                LCS[i][j] = LCS[i][j-1]
                LC[i][j] = LC[i][j-1]
print(LC[lt][ls])


Fixed submission:
s = input()
t = input()
ls = len( s)
lt = len( t)
CNT = [ [0]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            CNT[i][j] = CNT[i-1][j-1]+1
        else:
            if CNT[i][j-1] >= CNT[i-1][j]:
                CNT[i][j] = CNT[i][j-1]
            else:
                CNT[i][j] = CNT[i-1][j]
i = lt
j = ls
ans = ""
while i > 0 and j > 0:
    if t[i-1] == s[j-1]:
        ans += t[i-1]
        i -= 1
        j -= 1
    else:
        if CNT[i-1][j] > CNT[i][j-1]:
            i -= 1
        else:
            j -= 1
print( ans[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
ls = len( s)
lt = len( t)
LCS = [ [0]*(ls+1) for _ in range( lt+1)]
LC = [ [""]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1, ls+1):
        if t[i-1] == s[j-1]:
            LCS[i][j] = LCS[i-1][j-1] + 1
            LC[i][j] = LC[i-1][j-1] + t[i-1]
        else:
            if LCS[i][j-1] <= LCS[i-1][j]:
                LCS[i][j] = LCS[i-1][j]
                LC[i][j] = LC[i-1][j]
            else:
                LCS[i][j] = LCS[i][j-1]
                LC[i][j] = LC[i][j-1]
print(LC[lt][ls])


Fixed submission:
s = input()
t = input()
ls = len( s)
lt = len( t)
CNT = [ [0]*(ls+1) for _ in range(lt+1)]
for i in range(1,lt+1):
    for j in range(1,ls+1):
        if s[j-1] == t[i-1]:
            CNT[i][j] = CNT[i-1][j-1]+1
        else:
            if CNT[i][j-1] >= CNT[i-1][j]:
                CNT[i][j] = CNT[i][j-1]
            else:
                CNT[i][j] = CNT[i-1][j]
i = lt
j = ls
ans = ""
while i > 0 and j > 0:
    if t[i-1] == s[j-1]:
        ans += t[i-1]
        i -= 1
        j -= 1
    else:
        if CNT[i-1][j] > CNT[i][j-1]:
            i -= 1
        else:
            j -= 1
print( ans[::-1])