Harryxun/stf_run huggingface dataset:
n,k=map(int,input().split())
s=input()
s+="end"
if n>=2:
    uselist=[]
    for i in range(len(s)-1):
        if i==0 and s[i]=="0":
            uselist.append(0)
        if s[i]=="1" and s[i+1]=="0":
            uselist.append(i+1)
        if s[i+1]=="end":
            continue
    ans=0
    if uselist[0]>=1:
        uselist.insert(0,0)
        length=len(uselist)

        for i in range(length):
            if i+k+1<=length-1:
                ans=max(ans,uselist[i+k+1]-uselist[i]-1)

            else:
                ans=max(ans,n-uselist[i]-1)
    
                break
        print(ans)


    elif uselist[0]==0:
        uselist.insert(0,-1)

        length=len(uselist)
        for i in range(length):
            if i+k+1<=length-1:
                ans=max(ans,uselist[i+k+1]-uselist[i]-1)

            else:
                ans=max(ans,n-uselist[i]-1)

                break
        print(ans)
else:
    print(1)

### FIXED CODE ###

n,k=map(int,input().split())
s=input()
s=s+"w"
lists0=[]
lists1=[] 
count=0
for i in range(n):
    if s[i]!=s[i+1] and s[i]=="0":
        lists0.append(i-count)
        count=i
        
    elif s[i]!=s[i+1] and s[i]=="1":
        lists1.append(i-count)
        count=i

if s[0]=="1":
    lists1[0]+=1
elif s[0]=="0":
    lists0[0]+=1     
#下準備の完成
if s[0]=="1" and s[-2]=="1":
    #do nothing special
    if k>=len(lists0):
        print(n)
    elif k<len(lists0):
        big=0
        ans=sum(lists1[:k+1])+sum(lists0[:k])
        for i in range(len(lists0)-k):
            ans1=ans+lists1[k+1+i]+lists0[k+i]-lists1[i]-lists0[i]
            big=max(big,max(ans,ans1))
            ans=ans1
        print(big)
       
        
elif s[0]=="1" and s[-2]=="0":
    # 最後にlists1の方に0を挿入する
    lists1.append(0)

    if k>=len(lists0):
        print(n)
    elif k<len(lists0):
        big=0
        ans=sum(lists1[:k+1])+sum(lists0[:k])
        for i in range(len(lists0)-k):
            ans1=ans+lists1[k+1+i]+lists0[k+i]-lists1[i]-lists0[i]
            big=max(max(ans,ans1),big)
            ans=ans1
        print(big)
    
elif s[0]=="0" and s[-2]=="1":
    #さいしょのlist1の方に0を挿入する
    lists1.insert(0,0)

    if k>=len(lists0):
        print(n)
    elif k<len(lists0):
        big=0
        ans=sum(lists1[:k+1])+sum(lists0[:k])
        for i in range(len(lists0)-k):
            ans1=ans+lists1[k+1+i]+lists0[k+i]-lists1[i]-lists0[i]
            big=max(big,max(ans,ans1))
            ans=ans1
        print(big)    
elif s[0]=="0" and s[-2]=="0":
    #最初と最後にlist1の方に0を挿入する
    lists1.insert(0,0)
    lists1.append(0)

    if k>=len(lists0):
        print(n)
    elif k<len(lists0):            
        big=0
        ans=sum(lists1[:k+1])+sum(lists0[:k])
        for i in range(len(lists0)-k):
            ans1=ans+lists1[k+1+i]+lists0[k+i]-lists1[i]-lists0[i]
            big=max(big,max(ans,ans1))
            ans=ans1
        print(big)
score = input()
if (score < 1200):
  print("ABC")
else:
  print("ARC")

### FIXED CODE ###

score = int(input())
if (score < 1200):
   print("ABC")
else:
   print("ARC")
# -*- coding: utf-8 -*-

a, v = map(int, input().split())
b, w = map(int, input().split())
T = int(input()

k = b - a
l = bw + aw

if (k < l):
    flag = False

if (flag):
    print('YES')
else:
    print('NO')

### FIXED CODE ###

# -*- coding: utf-8 -*-

a, v = map(int, input().split())
b, w = map(int, input().split())
T = int(input())

k = b - a
flag = False

if k >= 0:
    l = T*v - T*w 
    if (k <= l):
        flag = True

if k < 0:
    k = a - b
    l = T*v - T*w
    if (k <= l):
        flag = True


if (flag == True):
    print('YES')
else:
    print('NO')
attack=list(map(int,input().split()))
damage=list(map(int,input().split()))
A=0

damage.sort(reverse=True)
#print(damage)
for i in range(attack[1]):
  del damage[i]

for i in range(attack[0]-attack[1]):
  A+=damage[i]

print(A)

### FIXED CODE ###

attack=list(map(int,input().split()))
damage=list(map(int,input().split()))
A=0

N=attack[0]
K=attack[1]
damage.sort(reverse=True)

if N>K:
  del damage[:K]
  print(sum(damage))

else:
  print(0)
from collections import defaultdict,deque
import bisect
from copy import deepcopy

N = int(input())
A = list(map(int,input().split()))
graph = defaultdict(deque)
for _ in range(0,N-1):
    u,v = map(int,input().split())
    graph[u].append(v)
    graph[v].append(u)

arrive = [False] * (N+1)
dp_dict = dict()
dp_dict[1] = [A[0]]

ans = [None] *(N+1)
def dfs(s):
    stack = deque([s])
    while stack:
        v = stack[-1]
        arrive[v] = True
        if graph[v]:
            w = graph[v].popleft()
            if arrive[w] == False:
                tar = A[w-1]
                dp = deepcopy(dp_dict[v])
                if tar > dp[-1]:
                    dp.append(tar)
                else:
                    dp[bisect.bisect_left(dp, tar)] = tar
                ans[w] = len(dp)
                dp_dict[w] = dp
                dfs(w)

        else:
            stack.pop()


dfs(1)
ans[1] = 1

for i in ans[1::]:
    print(i)

### FIXED CODE ###

import bisect
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
 
N = int(input())
A = tuple(map(int, input().split()))
graph = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    x, y = map(int, input().split())
    graph[x].append(y)
    graph[y].append(x)
 
ans = [-1] * (N + 1)
inf = 10**18
LIS = [inf] * (N + 1)
 
def DFS(s, parent=0):
    a = A[s - 1]
    i = bisect.bisect_left(LIS, a)
    v = LIS[i]
    LIS[i] = a
    ans[s] = bisect.bisect_left(LIS, inf)
    for t in graph[s]:
        if t == parent:
            continue
        DFS(t, s)
    LIS[i] = v
    return
 
DFS(1)
print(*ans[1:], sep="\n")
N = int(input())
ok = False

for i in range(1, 3501):
    for j in range(1, 3501):
        w = (4/N - 1/i - 1/j)**-1
        if w > 0 and abs(int(w) - w) < 10**-7:
            print(i, j, int(w))
            ok = True
            break
    if ok:
        break

### FIXED CODE ###

N = int(input())
ok = False

for i in range(1, 3501):
    for j in range(1, 3501):
        if N*(i+j) < 4*i*j:
            w = 1 / (4/N - 1/i - 1/j)
            if abs(int(w)-w) < 10**-7:
                print(i, j, int(w))
                ok = True
                break
    if ok:
        break
N, Q = map(int, input().split())
S = input()
lr = []
for i in range(Q):
    lr.append(list(map(int, input().split())))

for idx in lr:
    sub = S[idx[0] - 1:idx[1]]
    cnt = sub.count("AC")
    print("cnt = {}, sub = {}".format(cnt, sub))
    print(str(cnt))


### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
lr = []
for i in range(Q):
    lr.append(list(map(int, input().split())))

ACnum = [0]
for i in range(N - 1):
    ACnum.append(ACnum[-1])
    if("AC" == S[i:i + 2]):
        ACnum[i + 1] += 1
#print("ACnum = {}".format(ACnum))

for l, r in lr:
    print(str(ACnum[r - 1] - ACnum[l - 1]))
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list( map(int,input().split()))

ans = sum(B) 
for i in range(N-1):
    if A[i+1] - A[i] ==1:
        res += C[A[i]]
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
 
ans = sum(B) 
for i in range(N-1):
    if A[i+1] - A[i] ==1:
        ans += C[A[i]-1]
print(ans)
import sys
from collections import deque

input = sys.stdin.readline
digtmp = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    H, W = map(int, input().split())
    grid = []; cnt = 0
    grid.append(['#'] * (W+2))
    for _ in range(H):
        tmp = list(input())
        cnt += sum([1 for x in tmp if x == '#' ])
        grid.append(['#'] + tmp + ['#'])
    grid.append(['#'] * (W+2))

    que = deque([(1, 1)])
    grid[1][1] = 1
    for _ in range(10000):
        a, b = que.popleft()
        for dx, dy in digtmp:
            x, y = (a + dx, b + dy)
            if grid[x][y] == '.':
                grid[x][y] = grid[a][b] + 1
                que.append((x, y))
        if len(que) == 0:
            break
    if grid[H][W] == '#':
        print(-1)
        return
    ans = H*W - grid[H][W] - cnt
    print(ans)

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from collections import deque

input = sys.stdin.readline
digtmp = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    H, W = map(int, input().split())
    grid = []; cnt = 0
    grid.append(['#'] * (W+2))
    for _ in range(H):
        tmp = list(input())
        cnt += sum([1 for x in tmp if x == '#'])
        grid.append(['#'] + tmp + ['#'])
    grid.append(['#'] * (W+2))

    que = deque([(1, 1)])
    grid[1][1] = 1
    for _ in range(10000):
        a, b = que.popleft()
        for dx, dy in digtmp:
            x, y = (a + dx, b + dy)
            if grid[x][y] == '.':
                grid[x][y] = grid[a][b] + 1
                que.append((x, y))
        if len(que) == 0:
            break
    if grid[H][W] in ['#', '.']:
        print(-1)
        return
    ans = H*W - grid[H][W] - cnt
    print(ans)

if __name__ == "__main__":
    main()
input(a)
 print(a + a * 2 + a * 3)

### FIXED CODE ###

a = int(input())
print(a + a**2 + a**3)
from collections import deque
n = int(input())
i = 2
a = []
x = n
while(i * i <= n):
    if (n % i == 0):
        a.append(i)
        n //= i
        while(n % i == 0):
            n //= i
            a.append(a[-1] * i)
    i += 1
if (n != 1):
    a.append(i)
a.sort(reverse = True)
ans = 0
while(x != 1):
    while(x % a[-1]):
        a.pop()
    x /= a[-1]
    a.pop()
    ans += 1
print(ans)
    


### FIXED CODE ###

from collections import deque
n = int(input())
i = 2
a = []
x = n
while(i * i <= n):
    if (n % i == 0):
        a.append(i)
        n //= i
        while(n % i == 0):
            n //= i
            a.append(a[-1] * i)
    i += 1
if (n != 1):
    a.append(n)
a.sort(reverse = True)
ans = 0
while(x != 1 and len(a)):
    while(x % a[-1]):
        a.pop()
        if (len(a) == 0):
            break
    if (len(a) == 0):
        break
    x //= a[-1]
    a.pop()
    ans += 1
print(ans)
def abc157_d():
    N, M, K = map(int, input().split())
    fr = [set() for _ in range(N)]
    bl = [set() for _ in range(N)]
    for _ in range(M):
        a, b = map(int, input().split())
        a, b = a-1, b-1
        fr[a].add(b)
        fr[b].add(a)
    for _ in range(K):
        c, d = map(int, input().split())
        c, d = c-1, d-1
        bl[c].add(d)
        bl[d].add(c)

    def dfs(nd, lb):
        nonlocal label, gr
        label[nd] = lb
        gr[lb].add(nd)
        for ch in fr[nd]:
            if label[ch] != -1: continue
            dfs(ch, lb)

    label = [-1] * N
    lb = 0
    gr = []
    for i in range(N):
        if label[i] != -1: continue
        gr.append(set())
        dfs(i, lb)
        lb += 1

    ans = [0] * N
    for i in range(N):
        cand = gr[label[i]] - fr[i] - bl[i]
        ans[i] = len(cand) - 1
    print(*ans, sep=' ')

abc157_d()

### FIXED CODE ###

import sys
sys.setrecursionlimit(200100)

def abc157_d():
    N, M, K = map(int, input().split())
    fr = [set() for _ in range(N)]
    for _ in range(M):
        a, b = map(int, input().split())
        a, b = a-1, b-1
        fr[a].add(b)
        fr[b].add(a)
    bl = []
    for _ in range(K):
        c, d = map(int, input().split())
        c, d = c-1, d-1
        bl.append((c,d))

    def dfs(nd, lb):
        nonlocal label, gr
        label[nd] = lb
        gr[lb] += 1
        for ch in fr[nd]:
            if label[ch] != -1: continue
            dfs(ch, lb)

    ans = [0] * N
    label = [-1] * N
    lb = 0
    gr = []
    for i in range(N):
        if label[i] != -1:
            ans[i] = gr[label[i]]
            continue
        gr.append(0)
        dfs(i, lb)
        ans[i] = gr[label[i]]
        lb += 1

    for c, d in bl:
        if label[c] == label[d]:
            ans[c] -= 1
            ans[d] -= 1

    for i in range(N):
        ans[i] -= len(fr[i]) + 1

    print(*ans, sep=' ')

abc157_d()
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
A=[0]
for i in range(n):
  A.append(a[i])
B=[0]
for i in range(m):
  B.append(b[i])
ans=0
j=m
for i in range(n+1):
  while B[j]>(k-A[i]):
    j-=1
  ans=max(ans,i+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=[0]
for i in range(n):
  A.append(A[i]+a[i])
B=[0]
for i in range(m):
  B.append(B[i]+b[i])
ans=0
j=m
for i in range(n+1):
  if A[i]>k:
      break
  while B[j]>(k-A[i]):
    j-=1
  ans=max(ans,i+j)
print(ans)
def memo_rec(N):
    if N == 3:
        return 61
    L = ['A', 'T', 'G', 'C']
    MOD = 10 ** 9 + 7
    dic = {}
    def rec(l1, l2, l3, k):
        s = l1 + l2 + l3
        if s in ["AGC", "ACG", "GAC"]:
            return 0
        if k == 1:
            if (l1 == 'A' and l2 == 'C') or (l1 == 'C' and l2 == 'G') or (l1 == 'G' and l3 == 'C') or (l2 == 'G' and l3 == 'C') or (l1 == 'G' and l2 == 'C'):
                return 3
            else:
                return 4
        if s + str(k) in dic:
            return dic[s + str(k)]
        else:
            ret = 0
            for x in L:
                ret = (ret + rec(x, l1, l2, k - 1)) % MOD
            dic[s + str(k)] = ret
            return ret
    ret = 0
    for s in itertools.product(L, repeat = 3):
        ret = (ret + rec(s[0], s[1], s[2], N - 3)) % MOD
    return ret

N = int(input())
print(memo_rec(N))

### FIXED CODE ###

import itertools
def memo_rec(N):
    if N == 3:
        return 61
    if N == 4:
        return 230
    L = "ATGC"
    MOD = 10 ** 9 + 7
    dic = {}
    def rec(s, k):
        if s.count("AGC"):
            return 0
        for i in range(3):
            t1, t2 = s[i], s[i + 1]
            if (s[:i] + t2 + t1 + s[i+2:]).count("AGC"):
                return 0
        if k == 0:
            return 1
        if s + str(k) in dic:
            return dic[s + str(k)]
        else:
            ret = 0
            for x in L:
                ret = (ret + rec(str(x + s[:3]), k - 1)) % MOD
            dic[s + str(k)] = ret
            return ret
    ret = 0
    for s in itertools.product(L, repeat = 4):
        t = ''
        for x in s:
            t += x
        ret = (ret + rec(t, N - 4)) % MOD
    return ret

N = int(input())
print(memo_rec(N))
N,W = map(int, input().split())
ws = []
vs = []
for i in range(N):
    w,v = map(int, input().split())
    ws.append(w)
    vs.append(v)
ws_m = [w-ws[0] for w in ws]

"""
i番目まで見て、n個選んでいて、重さがwのときのvの最大値
ただし、wはN個選んだときにW-N*[w[0]]となっているので、そこをmaxとする
dp[i][n][w] 
"""
dp = [[[-1]*(3*N+1) for i in range(N+1)] for j in range(N+1)]
dp[0][0][0] = 0
for i,(w,v)  in enumerate(zip(ws_m,vs)):
    for n in range(i+1):
        for j in range(min(sum(ws_m,W-n*ws[0]))+1):
            if dp[i][n][j] == -1: continue
            if j + n*ws[0] > W: continue
            # print("check",i,n,j,v)
            dp[i+1][n+1][j+w] = max(dp[i][n][j+w], dp[i][n][j] + v)
            dp[i+1][n][j] = max(dp[i+1][n][j], dp[i][n][j])
ans= 0
for i,As in enumerate(dp[N]):
    w = W - i*ws[0]
    if w > 0:
        ans = max(ans,max(As[:w+1]))
print(ans)   

### FIXED CODE ###

N,W = map(int, input().split())
ws = []
vs = []
for i in range(N):
    w,v = map(int, input().split())
    ws.append(w)
    vs.append(v)
ws_m = [w-ws[0] for w in ws]

"""
i番目まで見て、n個選んでいて、重さがwのときのvの最大値
ただし、wはN個選んだときにW-N*[w[0]]となっているので、そこをmaxとする
dp[i][n][w] 
"""
dp = [[[-1]*(3*N+10) for i in range(N+1)] for j in range(N+1)]
dp[0][0][0] = 0
for i,(w,v)  in enumerate(zip(ws_m,vs)):
    for n in range(i+1):
        for j in range(3*N):
            dp[i+1][n][j] = max(dp[i+1][n][j], dp[i][n][j])
            # if dp[i][n][j] == -1: continue
            if j + (n+1)*ws[0] + w <= W:
                dp[i+1][n+1][j+w] = max(dp[i][n][j+w], dp[i][n][j] + v)

ans= 0
for i,As in enumerate(dp[N]):
    w = min(W - i*ws[0], sum(ws_m))
    if w >= 0:
        ans = max(ans,max(As[:w+1]))
print(ans)
S = input()
K = int(input())
lst = []

cnt = 1
for i in range(len(S)-1):
  if (S[i] == S[i+1]):
    cnt += 1
    if (i == len(S)-2):
      lst.append(cnt)
  else:
    lst.append(cnt)
    cnt = 1
if (S[0] == S[-1]):
  lst[-1] += 1

ans = 0
for i in lst:
  ans += i // 2
print(ans*K)

### FIXED CODE ###

S = input()
K = int(input())
lst = []

cnt = 1
ans = 0
if (len(S) != 1):
  for i in range(len(S)-1):
    if (S[i] == S[i+1]):
      cnt += 1
      if (i == len(S)-2):
        lst.append(cnt)
    else:
      lst.append(cnt)
      cnt = 1
      
  if (len(lst) == 1):
    ans = len(S)*K // 2
  else:
    for i in lst:
      ans += i // 2
    ans *= K
    
    if (S[0] == S[-1] and lst[0] % 2 != 0 and lst[-1] % 2 != 0):
      ans += K-1
else:
  ans = K // 2
print(ans)
n, y = map(int,input().split())

def f(n,y):
    for i in range(n):
        for j in range(n-i):
            s = 10000*i + 5000*j + 1000*(n-i-j)
            if s == y:
                return [i, j, k]

    return [-1, -1, -1]

print(f(n,y))

### FIXED CODE ###

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

def f(n,y):
    for i in range(n+1):
        for j in range(n-i+1):
            s = 10000*i + 5000*j + 1000*(n-i-j)
            if s == y:
                return '{0} {1} {2}'.format(i,j,n-i-j)

    return '-1 -1 -1'

print(f(n,y))
A,B,K = [int(i) for i in input().split()]
a = A - (K - (K -A))
b = B - (K - A)
print(f"{a} {b}")

### FIXED CODE ###

a,b = [i for i in input().split()]
print("".join([b,a]))
def root(x,rt):
    if rt[x] == x:
        return x
    else:
        while rt[x] != x:
            rt[x] = root(rt[x],rt)
            return rt[x]
def union(x,y,rt,rank):
    rootx = root(x,rt)
    rooty = root(y,rt)
    if rootx == rooty:
        return 0
    else:
        if rank[rootx] < rank[rooty]:
            rt[rooty] = rootx
        else:
            rt[rootx] = rooty
            if rank[rootx] == rank[rooty]:
                rank[rootx] += 1

def issame(x,y,rt):
    return root(x,rt) == root(y,rt)

length,query = (int(n) for n in input().split(" "))
rootlist = [n for n in range(length)]
rank = [0 for n in range(length)]

for q in range(query):
    #print(root)
    com,x,y = (int(n) for n in input().split(" "))
    if com == 0:
        union(x,y,rootlist,rank)
    else:
        print(1 if issame(x,y,rootlist) else 0)

### FIXED CODE ###

class UnionFind:
    import sys
    sys.setrecursionlimit(100000)

    def __init__(self, v_num):
        self.parent = [n for n in range(v_num)]
        self.rank = [0 for n in range(v_num)]

    def find(self, v):
        if v == self.parent[v]:
            return v
        else:
            root = self.find(self.parent[v])
            self.parent[v] = root
            return root

    def unite(self, a_v, other_v):
        a_root = self.find(a_v)
        other_root = self.find(other_v)
        if a_root == other_root:
            return
        if self.rank[a_root] < self.rank[other_root]:
            self.parent[a_root] = other_root
        else:
            self.parent[other_root] = a_root
            if self.rank[a_root] == self.rank[other_root]:
                self.rank[a_root] += 1

    def same(self, a_v, other_v):
        return self.find(a_v) == self.find(other_v)

v_num, query = (int(n) for n in input().split(" "))
uf = UnionFind(v_num)
for _ in range(query):
    com, a, b = (int(n) for n in input().split(" "))
    if com == 0:
        uf.unite(a, b)
    else:
        if uf.same(a, b):
            print(1)
        else:
            print(0)
a,b,n = map(int, input().split())

if b-1>n:
  x = n
else:
  x = (b-1)*(n//(b-1))

ans = max(a*x//b-a*(x//b), a*n//b-a*(n//b))

print(ans)

### FIXED CODE ###

a,b,n = map(int, input().split())

if b==1:
  print(0)
else:  
  if b-1>n:
    x = n
  else:
    x = (b-1)*(n//(b-1))

  ans = max(a*x//b-a*(x//b), a*n//b-a*(n//b))

  print(ans)
n=int(input())
m=int(input())

a=str(m)
for i in range(n):
  for j in range(n-i):
  	if a[i] ==a[i+j]:
      print("Yes")
      break
	print("No")

### FIXED CODE ###

n = int(input())
a = list(int(x) for x in input().split())
x = 0
 
a.sort()
for i in range(n-1):
    if a[-1] - a[-2] == 0:
        print("NO")
        x = 1
        break
    a.pop()
 
if x == 0:
    print("YES")
N, M = map(int, input().split())
AB = sorted([list(map(int, input().split())) for _ in range(N)])

res = M
n = 0
cnt = 0

if N == 1:
    cnt = res * AB[0][1]
else:
    while(AB[n][1] <= res):
        cnt += AB[n][0] * AB[n][1]
        res -= AB[n][1]
        n += 1

    cnt += res * AB[n][0]

print(cnt)


### FIXED CODE ###

N, M = map(int, input().split())
AB = sorted([list(map(int, input().split())) for _ in range(N)])

res = M
n = 0
cnt = 0


while(AB[n][1] < res):
    cnt += AB[n][0] * AB[n][1]
    res -= AB[n][1]
    n += 1

cnt += res * AB[n][0]

print(cnt)
a, b, k = map(int, input().split())
i, x = 0, 0

while a+i <= b and i < k:
    x = a + i
    print(x)
    i += 1

i = k - 1
while b-i <= b:
    y = b - i
    if y <= x:
        i -= 1
        continue
    print(y)
    i -= 1


### FIXED CODE ###

s = input()
a, b, c = 0, 0, 0

for i in s:
    if i == "a" and a == 0:
        a += 1
    elif i == "b" and b == 0:
        b += 1
    elif i == "c" and c == 0:
        c += 1
    else:
        print("No")
        break
else:
    print("Yes")
s=input()
n=len(s)

dp=[[0]*13 for i in range(n)]

if s[0]!='?':
    a=int(s[i])*10**(n-1)%13
    dp[0][a]=1
else:
    for k in range(10):
        a=k*10**(n-1)%13
        dp[0][a]=1

for i in range(1,n):
    if s[i]!='?':
        a=int(s[i])*10**(n-i-1)%13
        for j in range(13):
            dp[i][j]+=dp[i-1][(j-a)%13]
    else:
        for k in range(10):
            a=k*10**(n-i-1)%13
            for j in range(13):
                dp[i][j]+=dp[i-1][(j-a)%13]
print(dp[n-1][5]%(10**9+7))

### FIXED CODE ###

s=input()
n=len(s)
p=10**9+7
 
dp=[[0]*13 for i in range(n)]
m=[0]*(n-1)+[1]
for i in range(n-1):
    m[-i-2]=m[-i-1]*10%13
 
if s[0]!='?':
    a=int(s[0])*m[0]%13
    dp[0][a]=1
else:
    for k in range(10):
        a=k*m[0]%13
        dp[0][a]=1
 
for i in range(1,n):
    if s[i]!='?':
        for j in range(13):
            dp[i][j]=dp[i-1][(j-int(s[i])*m[i])%13]%p
    else:
        for k in range(10):
            for j in range(13):
                dp[i][j]+=dp[i-1][(j-k*m[i])%13]%p
print(dp[n-1][5]%p)
n,*a=map(int,open(0).read().split())
x=a[0]
y=a[1:]
ans=abs(x-y)
for i in a[1:-1]:
  x+=i
  y-=i
  ans=min(ans,abs(x-y))
print(ans)

### FIXED CODE ###

n,*a=map(int,open(0).read().split())
x=a[0]
y=sum(a[1:])
ans=abs(x-y)
for i in a[1:-1]:
  x+=i
  y-=i
  ans=min(ans,abs(x-y))
print(ans)
l = list(map(int,input().split())
print(sum(l)-max(l))
         

### FIXED CODE ###

l = list(map(int,input().split()))
print(sum(l)-max(l))
def countStep(n):
    global S, b
    if n<0:
        return 0
    elif n==0:
        return 1
    elif str(n) in b:
        count = S[n]
        return count
    else:
        count1 = countStep(n-1)
        count2 = countStep(n-2)
        count = count1 + count2
        b.append(str(n))
        S[n] = count
        return count

N,M = map(int,input().split())
b = []
for _ in range(M):
  b.append(input())
S = [0] * (N+1)

print(countStep(N) % 1000000007)

### FIXED CODE ###

N,M = map(int,input().split())
a = [True] * (N+1)

for _ in range(M):
  a[int(input())] = False

S = [0] * (N+1)
S[0] = 1
for n in range(1, N+1):
    if a[n]==False:
        S[n] = 0
    elif n==1:
        S[n] = 1
    else:
        S[n] = (S[n-1] + S[n-2])%1000000007

print(S[n])
xt = list(map(int, input().split()))

if xt[0]-xt[1]>=0:
    print(xt[0]-xt[1])
else:
    print(0)print(xt[0]-xt[1])

### FIXED CODE ###

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

if xt[0]-xt[1]>=0:
    print(xt[0]-xt[1])
else:
    print(0)