Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[0]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
                                                                                                    
ans=""
def rec(i,j):
  if i==0 or j==0:
    return 
  global ans
  if s[i-1]==t[j-1]:
    ans+=s[i-1]
    rec(i-1,j-1)
  elif dp[i-1][j]>=dp[i][j-1]:
    rec(i-1,j)
  else:
    rec(i,j-1)
rec(ls,lt)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[0]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
                                                                                                    
ans=""
def rec(i,j):
  if i==0 or j==0:
    return 
  global ans
  if s[i-1]==t[j-1]:
    ans+=s[i-1]
    rec(i-1,j-1)
  elif dp[i-1][j]>=dp[i][j-1]:
    rec(i-1,j)
  else:
    rec(i,j-1)
rec(ls,lt)
print(ans[::-1])

Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[0]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    dp[i+1][j+1]=max(dp[i][j]+(s[i]==t[j]),dp[i+1][j],dp[i][j+1])

ans=""
def rec(i,j):
  if i==0 or j==0:
    return 
  global ans
  if s[i-1]==t[j-1]:
    ans+=s[i-1]
    rec(i-1,j-1)
  elif dp[i-1][j]>=dp[i][j-1]:
    rec(i-1,j)
  else:
    rec(i,j-1)
rec(ls,lt)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[0]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
                                                                                                    
ans=""
def rec(i,j):
  if i==0 or j==0:
    return 
  global ans
  if s[i-1]==t[j-1]:
    ans+=s[i-1]
    rec(i-1,j-1)
  elif dp[i-1][j]>=dp[i][j-1]:
    rec(i-1,j)
  else:
    rec(i,j-1)
rec(ls,lt)
print(ans[::-1])

Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[0]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    dp[i+1][j+1]=max(dp[i][j]+(s[i]==t[j]),dp[i+1][j],dp[i][j+1])

ans=""
def rec(i,j):
  if i==0 and j==0:
    return 
  global ans
  if s[i-1]==t[j-1]:
    ans+=s[i-1]
    rec(i-1,j-1)
  elif dp[i-1][j]>=dp[i][j-1]:
    rec(i-1,j)
  else:
    rec(i,j-1)
rec(ls,lt)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[0]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
                                                                                                    
ans=""
def rec(i,j):
  if i==0 or j==0:
    return 
  global ans
  if s[i-1]==t[j-1]:
    ans+=s[i-1]
    rec(i-1,j-1)
  elif dp[i-1][j]>=dp[i][j-1]:
    rec(i-1,j)
  else:
    rec(i,j-1)
rec(ls,lt)
print(ans[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[""]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    if len(dp[i+1][j])==max(len(dp[i][j+1]),len(dp[i+1][j]),len(dp[i][j])+(s[i]==t[j])):
      dp[i+1][j+1]=dp[i+1][j]
    elif len(dp[i][j+1])==max(len(dp[i][j+1]),len(dp[i+1][j]),len(dp[i][j])+(s[i]==t[j])):
      dp[i+1][j+1]=dp[i][j+1]
    else:
      dp[i+1][j+1]=dp[i][j]+s[i]
print(dp[ls][lt])

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[0]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
                                                                                                    
ans=""
def rec(i,j):
  if i==0 or j==0:
    return 
  global ans
  if s[i-1]==t[j-1]:
    ans+=s[i-1]
    rec(i-1,j-1)
  elif dp[i-1][j]>=dp[i][j-1]:
    rec(i-1,j)
  else:
    rec(i,j-1)
rec(ls,lt)
print(ans[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[""]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    if len(dp[i+1][j])==max(len(dp[i][j+1]),len(dp[i+1][j]),len(dp[i][j])+(s[i]==t[j])):
      dp[i+1][j+1]=dp[i+1][j]
    elif len(dp[i][j+1])==max(len(dp[i][j+1]),len(dp[i+1][j]),len(dp[i][j])+(s[i]==t[j])):
      dp[i+1][j+1]=dp[i][j+1]
    else:
      dp[i+1][j+1]=dp[i][j]+s[i]
print(dp[ls][lt])

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[0]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
                                                                                                    
ans=""
def rec(i,j):
  if i==0 or j==0:
    return 
  global ans
  if s[i-1]==t[j-1]:
    ans+=s[i-1]
    rec(i-1,j-1)
  elif dp[i-1][j]>=dp[i][j-1]:
    rec(i-1,j)
  else:
    rec(i,j-1)
rec(ls,lt)
print(ans[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[""]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    if len(dp[i+1][j])==max(len(dp[i][j+1]),len(dp[i+1][j]),len(dp[i][j])+(s[i]==t[j])):
      dp[i+1][j+1]=dp[i+1][j]
    elif len(dp[i][j+1])==max(len(dp[i][j+1]),len(dp[i+1][j]),len(dp[i][j])+(s[i]==t[j])):
      dp[i+1][j+1]=dp[i][j+1]
    elif len(dp[i][j])+(s[i]==t[j])==max(len(dp[i][j+1]),len(dp[i+1][j]),len(dp[i][j])+(s[i]==t[j])):
      a=list(dp[i][j])
      a.append(s[i])
      dp[i+1][j+1]="".join(a)
print(dp[ls][lt])

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
s=input()
t=input()
ls=len(s)
lt=len(t)
dp=[[0]*(lt+1) for i in range(ls+1)]
for i in range(ls):
  for j in range(lt):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
                                                                                                    
ans=""
def rec(i,j):
  if i==0 or j==0:
    return 
  global ans
  if s[i-1]==t[j-1]:
    ans+=s[i-1]
    rec(i-1,j-1)
  elif dp[i-1][j]>=dp[i][j-1]:
    rec(i-1,j)
  else:
    rec(i,j-1)
rec(ls,lt)
print(ans[::-1])