Harryxun/stf_run huggingface dataset:
# coding: utf-8

row, col = map(int, input().split())
spreadsheet = []

for i in range(row):
    val = list(map(int, input().split()))
    val.append(sum(val))
    spreadsheet.append(val)

for r in spreadsheet:
    print(' '.join(map(str, r)))

last_row = []
for j in range(len(spreadsheet[1])):
    col_sum = 0
    for i in range(len(spreadsheet)):
        col_sum += spreadsheet[i][j]
    last_row.append(col_sum)

print(' '.join(map(str, last_row)))



### FIXED CODE ###

# coding: utf-8

row, col = map(int, input().split())
spreadsheet = []

for i in range(row):
    val = list(map(int, input().split()))
    val.append(sum(val))
    spreadsheet.append(val)

for r in spreadsheet:
    print(' '.join(map(str, r)))

last_row = []
for j in range(len(spreadsheet[0])):
    col_sum = 0
    for i in range(len(spreadsheet)):
        col_sum += spreadsheet[i][j]
    last_row.append(col_sum)

print(' '.join(map(str, last_row)))
import bisect

a,b,n=map(int,input().split())
l1=[int(input()) for i in range(a)]
l2=[int(input()) for i in range(b)]
x=[int(input()) for i in range(n)]
l1.sort()
l2.sort()
for i in range(n):
    idx1=bisect.bisect_left(l1,x[i])
    if idx1<a:
        p=abs(l1[idx1-1]-x[i])
        q=abs(l1[idx1]-x[i])
        if p>=q:
            po=l1[idx1]
            dis1=q
        else:
            po=l1[idx1-1]
            dis1=p
    else:
        dis1=x[i]-l1[-1]
        po=l1[-1]
    idx3=bisect.bisect_left(l2,po)
    if idx3<b:
        dis=min(abs(l2[idx3-1]-po),abs(l2[idx3]-po))
    else:
        dis=po-l2[-1]
    dis1+=dis
    idx2=bisect.bisect_left(l2,x[i])
    if idx2<b:
        p=abs(l2[idx2-1]-x[i])
        q=abs(l2[idx2]-x[i])
        if p>=q:
            po=l2[idx2]
            dis2=q
        else:
            po=l2[idx-1]
            dis2=p
    else:
        dis2=x[i]-l2[-1]
        po=l2[-1]
    idx3=bisect.bisect_left(l1,po)
    if idx3<a:
        dis=min(abs(l1[idx3-1]-po),abs(l1[idx3]-po))
    else:
        dis=po-l1[-1]
    dis2+=dis
    print(min(dis1,dis2))

### FIXED CODE ###

import bisect

a,b,n=map(int,input().split())
l1=[int(input()) for i in range(a)]
l2=[int(input()) for i in range(b)]
x=[int(input()) for i in range(n)]
l1.sort()
l2.sort()
for i in range(n):
    idx1=bisect.bisect_left(l1,x[i])
    if idx1<a:
        p=abs(l1[idx1-1]-x[i])
        q=abs(l1[idx1]-x[i])
        for j in range(2):
            if j==0:
                po=l1[idx1-1]
                idx3=bisect.bisect_left(l2,po)
                if idx3<b:
                    dis=min(abs(l2[idx3-1]-po),abs(l2[idx3]-po))
                else:
                    dis=po-l2[-1]
                dis1=p+dis
            else:
                po=l1[idx1]
                idx3=bisect.bisect_left(l2,po)
                if idx3<b:
                    dis=min(abs(l2[idx3-1]-po),abs(l2[idx3]-po))
                else:
                    dis=po-l2[-1]
                dis1=min(dis1,q+dis)
    else:
        p=x[i]-l1[-1]
        po=l1[-1]
        idx3=bisect.bisect_left(l2,po)
        if idx3<b:
            dis=min(abs(l2[idx3-1]-po),abs(l2[idx3]-po))
            dis1=dis+p
        else:
            dis1=po-l2[-1]+p
    idx2=bisect.bisect_left(l2,x[i])
    if idx2<b:
        p=abs(l2[idx2-1]-x[i])
        q=abs(l2[idx2]-x[i])
        for j in range(2):
            if j==0:
                po=l2[idx2-1]
                idx3=bisect.bisect_left(l1,po)
                if idx3<a:
                    dis=min(abs(l1[idx3-1]-po),abs(l1[idx3]-po))
                else:
                    dis=po-l1[-1]
                dis2=p+dis
            else:
                po=l2[idx2]
                idx3=bisect.bisect_left(l1,po)
                if idx3<a:
                    dis=min(abs(l1[idx3-1]-po),abs(l1[idx3]-po))
                else:
                    dis=po-l1[-1]
                dis2=min(dis2,q+dis)
    else:
        p=x[i]-l2[-1]
        po=l2[-1]
        idx3=bisect.bisect_left(l1,po)
        if idx3<a:
            dis=min(abs(l1[idx3-1]-po),abs(l1[idx3]-po))
            dis2=dis+p
        else:
            dis2=po-l1[-1]+p
    print(min(dis1,dis2))
D, G = map(int, input().split())
PC = [list(map(int,input().split())) for i in range(D)]

PC1 = [[0,0,0,0]]*D
for i in range(D):
  PC1[i] = [((i+1)*100*PC[i][0]+PC[i][1])/PC[i][0], PC[i][0], (i+1)*100, PC[i][1]]

count = 0
for j in range(D):
  count += PC[j][0]
  
PC1.sort()
accum = 0
ans = 0
for i in range(count):
  if G - accum < D * (PC[D-1][0]-1)
    for j in range(PC[D-1][0]-1):
      accum += D*100
      ans += 1
      if accum >= F:
        print(ans)
        exit()
  else:
    for j in range(PC1[i][1]):
      accum += PC1[i][2]
      ans += 1
      if j == PC1[i][1]-1:
        accum += PC1[i][3]
      if accum >= G:
        print(ans)
        exit()
print(ans)
          


### FIXED CODE ###

D, G = map(int, input().split())
PC = [list(map(int,input().split())) for i in range(D)]

l = []
for i in range(2 ** D):
  t = 0
  c = 0
  for j in range(D):
    if ((i >> j) & 1):
      t += (j+1)*100*PC[j][0]+PC[j][1]
      c += PC[j][0]
  if t >= G:
    l.append(c)
  else:
    ck = []
    for j in range(D):
      if ((i >> j) & 1):
        continue
      else:
        ck.append(j)
    if ck == []:
      continue
    ckm = max(ck)
    for k in range(PC[ckm][0]):
      t += (ckm+1)*100
      c += 1
      if t >= G:
        l.append(c)
        break
      
print(min(l))
import sys
sys.setrecursionlimit(2000)

def DFS(i):
    if i not in done:
        done.add(i)
        circle.add(i)
        for f in F[i]:
            DFS(f)
    else:
        return

N,M,K=map(int,input().split())
F=[[] for _ in range(N)]
B=[[] for _ in range(N)]

for f in range(M):
    f1,f2=map(int,input().split())
    F[f1-1].append(f2-1)
    F[f2-1].append(f1-1)
for b in range(K):
    b1,b2=map(int,input().split())
    B[b1-1].append(b2-1)
    B[b2-1].append(b1-1)

Group=[]
circle=set()
done=set()
for i in range(N):
    if i not in done:
        DFS(i)
        Group.append(circle)
        circle=set()

ans=[-1 for _ in range(N)]
for i in range(N):
    for j in range(len(Group)):
        if i in Group[j]:
            ans[i]+=len(Group[j])
            break
    for fr in F[i]:
        if fr in Group[j]:
            ans[i]-=1
    for bl in B[i]:
        if bl in Group[j]:
            ans[i]-=1

print(*ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)

def DFS(i,g):
    if i not in done:
        done.add(i)
        circle.add(i)
        g_list[i]=g
        for f in F[i]:
            DFS(f,g)
    else:
        return

N,M,K=map(int,input().split())
F=[[] for _ in range(N)]
B=[[] for _ in range(N)]

for f in range(M):
    f1,f2=map(int,input().split())
    F[f1-1].append(f2-1)
    F[f2-1].append(f1-1)
for b in range(K):
    b1,b2=map(int,input().split())
    B[b1-1].append(b2-1)
    B[b2-1].append(b1-1)

Group=[]
circle=set()
done=set()
g_list=[0 for _ in range(N)]
g=0
for i in range(N):
    if i not in done:
        DFS(i,g)
        Group.append(circle)
        circle=set()
        g+=1

ans=[-1 for _ in range(N)]
for i in range(N):
    G=g_list[i]
    ans[i]+=len(Group[G])
    for fr in F[i]:
        if fr in Group[G]:
            ans[i]-=1
    for bl in B[i]:
        if bl in Group[G]:
            ans[i]-=1

print(*ans)
A,B,C=map(int,input().split())

print(max(A,B,C)*9+A+B+C)  
  
  

### FIXED CODE ###

A,B= map(int,input().split())

if (A*B)%2!=0:
  print('Yes')
else:
  print('No')
=input()
L=["01","02","03","04","05","06","07","08","09","10","11","12"]

if S[:2] in L:
    if S[2:] in L:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if S[2:] in L:
        print("YYMM")
    else:
        print("NA")

### FIXED CODE ###

S=input()
L=["01","02","03","04","05","06","07","08","09","10","11","12"]

if S[:2] in L:
    if S[2:] in L:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if S[2:] in L:
        print("YYMM")
    else:
        print("NA")
N = int(input())
S = str(input())
print(S.count("ABC"))

### FIXED CODE ###

N = int(input())
S = input()
print(S.count("ABC"))
import sys
from functools import reduce
import itertools


input = sys.stdin.readline

N = int(input())
P = tuple(map(int, input().split(" ")))
Q = tuple(map(int, input().split(" ")))


res = list(filter(lambda t: t[1] == P or t[1] == Q, enumerate(itertools.permutations(range(1, N + 1)))))

print(abs(res[0][0] - res[1][0]))

### FIXED CODE ###

import sys
from functools import reduce
import itertools


input = sys.stdin.readline

N = int(input())
P = tuple(map(int, input().split(" ")))
Q = tuple(map(int, input().split(" ")))

if (P == Q):
    print(0)
else:
    res = list(filter(lambda t: t[1] == P or t[1] == Q, enumerate(itertools.permutations(range(1, N + 1)))))

    print(abs(res[0][0] - res[1][0]))
n = int(input())
edge = [[] for i in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edge[a].append(b)
    edge[b].append(a)

cost = list(map(int, input().split()))
c = sorted(cost, reverse=True)
w = [0] * n
w[0] = c.pop(0)
chk = [*edge[0]]

while chk != []:
    node = chk.pop(0)
    if w[node] == 0:
        w[node] = c.pop(0)
        chk.extend(edge[node])

print(sum(cost) - max(cost))
print(' '.join(map(str, w)))

### FIXED CODE ###

n = int(input())

edge = [[] for i in range(n)]

for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edge[a].append(b)
    edge[b].append(a)

cost = list(map(int, input().split()))

c = sorted(cost, reverse=True)

w = [0] * n

w[0] = c.pop(0)

chk = [i for i in edge[0]]

while chk != []:
    node = chk.pop(0)
    if w[node] == 0:
        w[node] = c.pop(0)
        chk.extend(edge[node])

print(sum(cost) - max(cost))

print(' '.join(map(str, w)))
import bisect
N, K, *A = [int(_) for _ in open(0).read().split()]
K -= 1
L = [[] for _ in range(10)]
for i, a in enumerate(A * 2):
    L[a] += [i]
before_next = [L[a][bisect.bisect(L[a], i)] for i, a in enumerate(A)]
first_cycle = [None] * N
now = 0
idx = 0
cycle = 0
while True:
    if first_cycle[now] is not None:
        break
    first_cycle[now] = cycle
    now = before_next[now] + 1
    dcycle, now = divmod(now, N)
    cycle += dcycle
exit()
cycle2 = cycle
cycle1 = first_cycle[now]
#K cycle目=cycle1+(K-cycle1)%(cycle2-cycle1) cycle目
K2 = cycle1 + (K - cycle1) % (cycle2 - cycle1)
if K2:
    f1 = f2 = 0
    for i in range(N - 1, -1, -1):
        if first_cycle[i] == K2 - 1:
            f1 = 1
            break
    for j in range(N - 1, -1, -1):
        if first_cycle[j] == K2:
            f2 = 1
            break
    if f2:
        B = A[j:]
    elif f1:
        B = A[i:] + A
    else:
        raise
else:
    B = A
ans = []
cnt = [0] * 10
for a in B:
    if cnt[a] > 0:
        while True:
            cnt[ans.pop()] -= 1
            if cnt[a] == 0:
                break
    else:
        ans += [a]
        cnt[a] += 1
print(' '.join(map(str, ans)))


### FIXED CODE ###

import bisect
N, K, *A = [int(_) for _ in open(0).read().split()]
K -= 1
L = [[] for _ in range(2 * 10**5 + 1)]
for i, a in enumerate(A * 2):
    L[a] += [i]
before_next = [L[a][bisect.bisect(L[a], i)] for i, a in enumerate(A)]
first_cycle = [None] * N
now = 0
idx = 0
cycle = 0
while True:
    if first_cycle[now] is not None:
        break
    first_cycle[now] = cycle
    now = before_next[now] + 1
    dcycle, now = divmod(now, N)
    cycle += dcycle
cycle2 = cycle
cycle1 = first_cycle[now]
#K cycle目=cycle1+(K-cycle1)%(cycle2-cycle1) cycle目
K2 = cycle1 + (K - cycle1) % (cycle2 - cycle1)
if K2:
    f1 = f2 = 0
    for i in range(N - 1, -1, -1):
        if first_cycle[i] == K2 - 1:
            f1 = 1
            break
    for j in range(N - 1, -1, -1):
        if first_cycle[j] == K2:
            f2 = 1
            break
    if f2:
        B = A[j:]
    elif f1:
        B = A[i:] + A
else:
    B = A
ans = []
cnt = [0] * (2 * 10**5 + 1)
for a in B:
    if cnt[a] > 0:
        while True:
            cnt[ans.pop()] -= 1
            if cnt[a] == 0:
                break
    else:
        ans += [a]
        cnt[a] += 1
print(' '.join(map(str, ans)))
n=int(input())
a=map(int,input().split())
sort_a=sorted(a)

alice = sum(sort_a[::2])
bob = sum(a[1::2])

print(alice - bob)  

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)

alice = sum(a[::2])
bob = sum(a[1::2])

print(alice - bob)
A, B, C = map(int,inpput()split())
K = int(input())
print(A + B + C - max(A,B,C) + max(A,B,C)*(2**K))

### FIXED CODE ###

A, B, C = map( int, input().split() )
K = int(input())
print(A + B + C - max(A,B,C) + max(A,B,C)*(2**K))
n=int(input())
l=list(map(int,input().split()))
l.sort()

import bisect

ans=0
for i in range(n-2):
  for j in range(i+1,n-1):
    ind=bisect.bisect_left(temp,l[i]+l[j])
    ans+=n-ind
print(ans)

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
l.sort()

import bisect

ans=0
for i in range(n-2):
  for j in range(i+1,n-1):
    ind=bisect.bisect_left(l,l[i]+l[j])
    ans+=ind-j-1
print(ans)
import math

# define
a = [0] * int(1e5 + 10)
# functions
# main
n, m = (int(s) for s in input().split())

inp = input()
for i in range(1, n + 1) :
    a[i] = int(inp.split()[i - 1])

flag = False
lcm = a[1]
for i in range(1, n + 1) : 
    gcd = math.gcd(lcm, a[i])
    lcm = int(lcm * a[i] / gcd)
    if(lcm > m):
        flag = True
        break

for i in range (1, n + 1):
    if lcm / a[i] % 2 == 0 : flag = True

if flag or lcm > m : print(0)
else : print(int( (m - int(lcm / 2)) / lcm ) + 1)




### FIXED CODE ###

# define
a = [0] * int(1e5 + 100)
# functions
def _gcd(a, b):
    if a % b == 0 : return b
    if b % a == 0 : return a
    while a != 1 and b != 1:
        if a > b: a %= b
        else : b %= a
        if a % b == 0: return b
        if b % a == 0: return a
# main

n, m = (int(s) for s in input().split())

inp = input().split()
for i in range(1, n + 1) :
    a[i] = int(inp[i - 1])

flag = False
lcm = a[1]

for i in range(2, n + 1) :
    gcd = _gcd(lcm, a[i])
    lcm = int(lcm * a[i] / gcd)
    if(lcm > 2 * m):
        flag = True
        break

for i in range (1, n + 1):
    if int(lcm / a[i]) % 2 == 0 : flag = True

if flag : print(0)
else : print(int( (m - int(lcm / 2)) / lcm ) + 1)
import sympy

x,y = map(int,input().split())

t = sympy.Symbol('t')
c = sympy.Symbol('c')

a = sympy.solve([t + c - x,4*t + 2*c - y],[t, c])

if a[t]<0 or a[c]<0:
    print("No")

elif a[t]%1 == 0 and a[c]%1 == 0:
    print("Yes")

else:
    print("No")

### FIXED CODE ###

x,y = map(int,input().split())

for i in range(x+1):
    c = i
    t = abs(x-i)
    if 2*c + 4*t == y:
        print("Yes")
        break
    if i == x:
        print("No")
        break
import sys
h,w=map(int,input().split())
lst=[[0 for i in range(w)]for j in range(h)]
for i in range(h):
  s=input().split()
  for j in len(s):
    if s[j]=='#':
      lst[i][j]=1

for j in range(h-2):
  for k in range(w-2):
    if lst[j][k]*lst[j][k+1]==0 and lst[j][k+1]*lst[j][k+2]==0:
      print('No')
      sys.exit()
    if lst[j][k]*lst[j+1][k]==0 and lst[j+1][k]*lst[j+2][k]==0:
      print('No')
      sys.exit()
    
print('Yes')

### FIXED CODE ###

h, w = map(int, input().split())

s = [input() for _ in range(h)]

ans = 'Yes'

for i in range(1, h-1):
    for j in range(1, w-1):
        if s[i][j] == '#' and s[i-1][j] == '.' and s[i+1][j] == '.' and s[i][j-1] == '.' and s[i][j+1] == '.':
            ans = 'No'

print(ans)
N=input()
a=list(N)
b=len(a)
sum=0
for i in range(b):
  a[i]=int(a[i])
  sum += a[i]
  print(a[i])
if(N%sum==0):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N=input()
a=list(N)
b=len(a)
sum=0
for i in range(b):
          a[i]=int(a[i])
          sum += a[i]
N=int(N)
if(N%sum==0):
              print("Yes")
else:
              print("No")
import fractions
n,m=map(int, input().split())
a=list(map(int, input().split()))
b=[]
for i in range(n):
    b.append(int(a[i]/2))

def lcm(x,y):
    return (x*y)//fractions.gcd(x,y)

c=[lcm(b[0],b[1])]
for i in range(1,n):
    x=lcm(c[i-2],b[i])
    c.append(x)

d=int(m//c[len(c)-1])
ans=int((d+1)//2)
print(ans)

### FIXED CODE ###

import math
import fractions
n,m=map(int, input().split())
a=list(map(int, input().split()))
b=[]
s=math.floor(math.log2(max(a)))
buf=0
for i in range(n): #aは偶数なので、1/2した値の配列を作った
    b.append(int(a[i]//2))

for i in range(s+1): #2のi乗ですべての数が割れるかどうか
    for j in b:
        if j%(2**i)==0:
            buf+=1
        else:
            continue
    if buf==n:
        buf=0
        continue
    else:
        break

def lcm(x,y): #最小公倍数を求める関数の定義
    return (x*y)//fractions.gcd(x,y)

if buf!=0 and buf!=n: #偶奇が入り混じってるとき
    print(0)
elif n==1: #配列の要素が1つしかないとき
    d=int(m//b[0])
    print(int((d+1)//2))
else:
    c=[lcm(b[0],b[1])] #以下のサイクルで求めた最小公倍数を入れる配列
    for i in range(1,n):
        x=lcm(c[i-1],b[i])
        c.append(x)
        if x<m:
            continue
        else:
            break
    d=int(m//c[len(c)-1]) #最後の値(c[len(c)-1])が配列bの最小公倍数
    ans=int((d+1)//2)
    print(ans)
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def lcm(a, b):
    return int(a * b / gcd(max(a, b), min(a, b)))


N = int(input())
T = [int(input()) for i in range(N)]

A = T[0]
for i in range(N):
    A = lcm(A, T[i])
print(A)


### FIXED CODE ###

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def lcm(a, b):
    return a * b // gcd(max(a, b), min(a, b))


N = int(input())
T = [int(input()) for i in range(N)]

A = T[0]
for i in range(N):
    A = lcm(A, T[i])
print(A)
N = int(input())
An = [int(_) for _ in input().split()]
An.sort()
An = list(set(An))
N = len(An)

ans = 0

# 割り切れるものの数を数える
def dfs(An):
    global ans
    if(len(An) == 0):
        return
    val = An.pop(-1)
    for i in An:
        # 割り切れる場合はansに数を足して今のループを抜ける
        if(val % i == 0):
            ans += 1
            break
    # どの数でも割り切れなかった場合は一度抜ける
    dfs(An)

dfs(An)
if(N == 1):
    last_ans = 0
else:
    last_ans = N - ans

print(last_ans)

### FIXED CODE ###

"""
考え方のポイント
・自分以外では割り切れないような数の個数を求める
　→ 数列の各項に対して〇（割り切れない）×がついていって、〇の個数を数える
・[2, 2]みたいな入力は、他の数で割り切れるようになるので、同じ数が入っていると絶対に×になる。

まずは入力が全部異なる前提で進める。
範囲内の整数からなる全て配列dを用意する。
→ 入力の数列を約数としてもつ数にチェックをしていく（Anに2が含まれていれば、2の倍数全てにチェック（+1)する）
→ チェック後にd[i]をみたとき、d[i]の約数がan中に何個存在するかが示されていることになる。（2∈Aiならd[5](=6)の値は必ず1以上になってる)
"""
N = int(input())
An = [int(i) for i in input().split()]
An.sort()
max_val = 10**6+1
d = [0] * max_val


# O(N) = O(2*10^5)
# d[i]のうち、配列の値の位置を+1しとく。
for i in An:
    d[i] += 1
    # O(MlogM) = 6*10^6
    # 始めてその倍数がきたときだけ
    if(d[i] == 1):
        # [2, 2]などの重複がない場合（既にカウントされているものではない場合)
        # 倍数の位置にも2としておいて以降はみないようにする
        for val in range(i*2, max_val, i):
            d[val] = 2

print(d.count(1))
n = int(input())
l=[]
for i in range(n):
  a,b = list(map(int,list(input().split())))
  l.append([a,b])
def fn(n,l):
  for i in range(n-2):
    if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] andl[i+2][0]==l[i+2][1]:
      return 'Yes'
  return 'No'  
print(fn(n,l))
  

### FIXED CODE ###

n = int(input())
l=[]
for i in range(n):
  a,b = list(map(int,list(input().split())))
  l.append([a,b])
def fn(n,l):
  for i in range(n-2):
    if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] and l[i+2][0]==l[i+2][1]:
      return 'Yes'
  return 'No'  
print(fn(n,l))
def lcs(x, y):
    lx = len(x)
    ly = len(y)
    pcsl = [[0 for j in range(ly + 1)] for i in range(lx + 1)]
    for i in range(lx):
        for j in range(ly):
            if x[i] == y[j]:
                pcsl[i][j] = pcsl[i - 1][j - 1] + 1
            else:
                pcsl[i][j] = max(pcsl[i - 1][j], pcsl[i][j - 1])
    print(pcsl[i][j])


import sys

q = sys.stdin.readline()

while True:
    ax = sys.stdin.readline()[:-1]
    ay = sys.stdin.readline()[:-1]
    lcs(ax, ay)

### FIXED CODE ###

def lcs_len(x, y):
    indices = [0]
    for y_i in y:
        t_index = 0
        for i, index in enumerate(indices, 1):
            c_index = x.find(y_i, t_index) + 1
            if c_index:
                if i < len(indices):
                    t_index = indices[i]
                    indices[i] = min(c_index, t_index)
                else:
                    indices.append(c_index)
                    break
    print(len(indices) - 1)


q = int(input())

for i in range(q):
    ax = input()
    ay = input()
    lcs_len(ax, ay)
a,b,k=map(int,input().split());n=[*range(a,b+1)]
n=sorted(set(n[:k]+n[-k:]));print(*n,sep='\n')

### FIXED CODE ###

A,B,K = map(int, input().split())
[print(i) for i in sorted(list(set([i for i in range(A,A+K)] + [i for i in reversed(range(B-K+1, B+1))]))) if A <= i <= B]
S = input()
S = S[::-1]
#print(S)

mod = 10**9+7

tblpow = [1]
for i in range(1,len(S)+1):
	tblpow.append(10*tblpow[i-1]%13)
print(tblpow)
1 10 9 12 3 4

dp = [0]*13
dp[0] = 1
for i in range(len(S)-1,-1,-1):
	ch = int(S[i]) if S[i]!='?' else -1
	temp = [0]*13
	for d in range(10):
		if ch!=-1 and ch!=d:
			continue
		for m in range(13):
			temp[(d*tblpow[i]+m)%13] += dp[m]
	for m in range(13):
		temp[m] %= mod
	dp = temp
print(dp[5])


### FIXED CODE ###

S = input()
S = S[::-1]
#print(S)

mod = 10**9+7

tblpow = [1]
for i in range(1,len(S)+1):
	tblpow.append(10*tblpow[i-1]%13)

dp = [0]*13
dp[0] = 1
for i in range(len(S)-1,-1,-1):
	ch = int(S[i]) if S[i]!='?' else -1
	temp = [0]*13
	for d in range(10):
		if ch!=-1 and ch!=d:
			continue
		for m in range(13):
			temp[(d*tblpow[i]+m)%13] += dp[m]
	for m in range(13):
		temp[m] %= mod
	dp = temp
print(dp[5])
n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A_ruiseki = []
if A[0]<=k:
    A_ruiseki.append(A[0])
    for i in range(1, n):
        if A_ruiseki[i-1]+A[i] <= k :
            A_ruiseki.append(A_ruiseki[i-1]+A[i])
        else:
            break

B_ruiseki = []
if B[0]<=k:

    B_ruiseki.append(B[0])
    for i in range(1, n):
        if B_ruiseki[i-1]+B[i] <= k :
            B_ruiseki.append(B_ruiseki[i-1]+B[i])
        else:
            break

ans = len(A_ruiseki)

for i in range(len(A_ruiseki)):
    time = A_ruiseki[i]
    expected = max(ans-i-2, 0)

    if len(B_ruiseki) < expected:
        continue
    if time + B_ruiseki[expected] > k:
        continue
    if expected > 0:
        time += B_ruiseki[expected-1]
    for j in range(expected, len(B)):

        if time + B[j] > k:
            break

        time += B[j]

        ans =i+2+j

print(ans)

### FIXED CODE ###

n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A_ruiseki = [0]
for i in range(n):
    if A_ruiseki[-1]+A[i] <= k :
        A_ruiseki.append(A_ruiseki[-1]+A[i])
    else:
        break

B_ruiseki = [0]
for i in range(m):
    if B_ruiseki[-1]+B[i] <= k :
        B_ruiseki.append(B_ruiseki[-1]+B[i])
    else:
        break

ans = len(A_ruiseki)-1

for i in range(len(A_ruiseki)):
    time = A_ruiseki[i]
    expected = max(ans-i, 0)

    if len(B_ruiseki) <= expected:
        continue

    if time + B_ruiseki[expected] > k:
        continue

    time += B_ruiseki[expected]

    for j in range(expected, len(B)):
        if time + B[j] > k:
            break

        time += B[j]
        ans =i+j+1

print(ans)
a,b = input().split()
if a > b:
 print "a > b"
elif a < b:
 print "a < b"
else:
 print "a == b"

### FIXED CODE ###

a,b = map(int, raw_input().split())
if a > b:
 print "a > b"
elif a < b:
 print "a < b"
else:
 print "a == b"