Buggy python submission (verdict: Runtime Error):
def sakujo();
url1 = raw_input()
url2 = raw_input()

a, b = len(url1), len(url2)
x = [0 for i in range(b+1)]
for i in range(a):
e1 = url1[i]
y = x+[]
for j in range(b):
if e1 == url2[j]:
x[j+1] = y[j] + 1
elif x1[j+1] < x[j]:
x[j+1] = x[j]
return x[-1]


n=input()
for ix in range(n):
def sakujo

Fixed submission:
def longest():
    alps1 = raw_input()
    alps2 = raw_input()
    
    x, y = len(alps1), len(alps2)
    k = [0 for i in range(y+1)]
    for i in range(x):
        e1 = alps1[i]
        l = k+[]
        for j in range(y):
            if e1 == alps2[j]:
                k[j+1] = l[j] + 1
            elif k[j+1] < k[j]:
                k[j+1] = k[j]
 
    return k[-1]
    
n = input()
for i in range(n):
    print longest()

Buggy python submission (verdict: Runtime Error):
def sakujo();
seq1 = raw_input()
seq2 = raw_input()

a, b = len(seq1), len(seq2)
x1 = [0 for i in range(b+1)]
for i in range(a):
e1 = seq1[i]
x2 = x1+[]
for j in range(b):
if e1 == seq2[j]:
x1[j+1] = x2[j] + 1
elif x1[j+1] < x1[j]:
x1[j+1] = x1[j]
return x1[-1]


n=input()
for ix in range(n):
def sakujo

Fixed submission:
def longest():
    alps1 = raw_input()
    alps2 = raw_input()
    
    x, y = len(alps1), len(alps2)
    k = [0 for i in range(y+1)]
    for i in range(x):
        e1 = alps1[i]
        l = k+[]
        for j in range(y):
            if e1 == alps2[j]:
                k[j+1] = l[j] + 1
            elif k[j+1] < k[j]:
                k[j+1] = k[j]
 
    return k[-1]
    
n = input()
for i in range(n):
    print longest()

Buggy python submission (verdict: Runtime Error):
def sakujo();
seq1 = raw_input()
seq2 = raw_input()

a, b = len(seq1), len(seq2)
x1 = [0 for i in range(b+1)]
for i in range(a):
e1 = seq1[i]
x2 = x1+[]
for j in range(b):
if e1 == seq2[j]:
x1[j+1] = x2[j] + 1
elif x1[j+1] < x1[j]:
x1[j+1] = x1[j]
return x1[-1]


n=input()
for i in range(n):
def sakujo

Fixed submission:
def longest():
    alps1 = raw_input()
    alps2 = raw_input()
    
    x, y = len(alps1), len(alps2)
    k = [0 for i in range(y+1)]
    for i in range(x):
        e1 = alps1[i]
        l = k+[]
        for j in range(y):
            if e1 == alps2[j]:
                k[j+1] = l[j] + 1
            elif k[j+1] < k[j]:
                k[j+1] = k[j]
 
    return k[-1]
    
n = input()
for i in range(n):
    print longest()

Buggy python submission (verdict: Runtime Error):
def sakujo();
seq1 = raw_input()
seq2 = raw_input()

a, b = len(seq1), len(seq2)
x1 = [0 for i in range(b+1)]
for i in range(a):
e1 = seq1[i]
x2 = x1+[]
for j in range(b):
if e1 == seq2[j]:
x1[j+1] = x2[j] + 1
elif x1[j+1] < x1[j]:
x1[j+1] = x1[j]
return x1[-1]


n=input()
for ix in range(n):
def sakujo

Fixed submission:
def longest():
    alps1 = raw_input()
    alps2 = raw_input()
    
    x, y = len(alps1), len(alps2)
    k = [0 for i in range(y+1)]
    for i in range(x):
        e1 = alps1[i]
        l = k+[]
        for j in range(y):
            if e1 == alps2[j]:
                k[j+1] = l[j] + 1
            elif k[j+1] < k[j]:
                k[j+1] = k[j]
 
    return k[-1]
    
n = input()
for i in range(n):
    print longest()

Buggy python submission (verdict: Runtime Error):
def sakujo():
 moji1 = raw_input()
 moji2 = raw_input()
  
 a, b = len(moji1), len(moji2)
 x1 = [for i in range(b+1)]
 for i in range(a):
  e1 = seq1[i]
  x2 = x1+[]
  for j in range(b):
   if e1 == moji2[j]:
    x1[j+1] = x2[j] + 1
   elif x1[j+1] < x1[j]:
    x1[j+1] = x1[j]
 return x1[-1]

 
n=input()
for ix in range(n):
 def sakujo

Fixed submission:
def longest():
    alps1 = raw_input()
    alps2 = raw_input()
    
    x, y = len(alps1), len(alps2)
    k = [0 for i in range(y+1)]
    for i in range(x):
        e1 = alps1[i]
        l = k+[]
        for j in range(y):
            if e1 == alps2[j]:
                k[j+1] = l[j] + 1
            elif k[j+1] < k[j]:
                k[j+1] = k[j]
 
    return k[-1]
    
n = input()
for i in range(n):
    print longest()

Buggy python submission (verdict: Runtime Error):
def sakujo():
 moji1 = raw_input()
 moji2 = raw_input()
  
 a, b = len(moji1), len(moji2)
 x1 = [0 for i in range(b+1)]
 for i in range(a):
  e1 = seq1[i]
  x2 = x1+[]
  for j in range(b):
   if e1 == moji2[j]:
    x1[j+1] = x2[j] + 1
   elif x1[j+1] < x1[j]:
    x1[j+1] = x1[j]
 return x1[-1]

 
n=input()
for ix in range(n):
 def sakujo

Fixed submission:
def longest():
    alps1 = raw_input()
    alps2 = raw_input()
    
    x, y = len(alps1), len(alps2)
    k = [0 for i in range(y+1)]
    for i in range(x):
        e1 = alps1[i]
        l = k+[]
        for j in range(y):
            if e1 == alps2[j]:
                k[j+1] = l[j] + 1
            elif k[j+1] < k[j]:
                k[j+1] = k[j]
 
    return k[-1]
    
n = input()
for i in range(n):
    print longest()

Buggy python submission (verdict: Runtime Error):
def sakujo():
 moji1 = raw_input()
 moji2 = raw_input()
  
 a, b = len(moji1), len(moji2)
 x1 = [0 for i in range(b+1)]
 for i in range(a):
  e1 = moji1[i]
  x2 = x1+[]
  for j in range(b):
   if e1 == moji2[j]:
    x1[j+1] = x2[j] + 1
   elif x1[j+1] < x1[j]:
    x1[j+1] = x1[j]
 return x1[-1]

 
n=input()
for ix in range(n):
 def sakujo

Fixed submission:
def longest():
    alps1 = raw_input()
    alps2 = raw_input()
    
    x, y = len(alps1), len(alps2)
    k = [0 for i in range(y+1)]
    for i in range(x):
        e1 = alps1[i]
        l = k+[]
        for j in range(y):
            if e1 == alps2[j]:
                k[j+1] = l[j] + 1
            elif k[j+1] < k[j]:
                k[j+1] = k[j]
 
    return k[-1]
    
n = input()
for i in range(n):
    print longest()

Buggy python submission (verdict: Runtime Error):
def longest():
    moji1 = raw_input()
    moji2 = raw_input()
  
    a, b = len(seq1), len(seq2)
    x1 = [0 for i in range(b+1)]

    for i in range(a):
        e1 = moji1[i]
        x2 = x1+[]
        for j in range(b):
            if e1 == moji2[j]:
                x1[j+1] = x2[j] + 1
            elif x1[j+1] < x1[j]:
                x1[j+1] = x1[j]

    return x1[-1]
  
n = input()
for i in range(n):
    print longest()

Fixed submission:
def longest():
    alps1 = raw_input()
    alps2 = raw_input()
    
    x, y = len(alps1), len(alps2)
    k = [0 for i in range(y+1)]
    for i in range(x):
        e1 = alps1[i]
        l = k+[]
        for j in range(y):
            if e1 == alps2[j]:
                k[j+1] = l[j] + 1
            elif k[j+1] < k[j]:
                k[j+1] = k[j]
 
    return k[-1]
    
n = input()
for i in range(n):
    print longest()