Harryxun/stf_run huggingface dataset:
a,b = map(int,input().split())
     
    t = b
     
    f = False
     
    for i in range(t//10+1):
        for j in range((t-i*10)//5+1):
            if a == t - i*9 - j*4 and b == i*10+j*5+(a-i-j) and a-i-j>=0:
                f = True
                break
        if f:
            break
     
    if f:
        print(i,j,a-i-j)
    else:
        print(-1,-1,-1)

### FIXED CODE ###

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

t = b//1000

f = False

for i in range(t//10+1):
    for j in range((t-i*10)//5+1):
        if a == t - i*9 - j*4 and b == i*10000+j*5000+(a-i-j)*1000 and a-i-j>=0:
            f = True
            break
    if f:
        break

if f:
    print(i,j,a-i-j)
else:
    print(-1,-1,-1)
n,a=map(int,input().split())
l=list(map(int,input().split()))
x=max(l)
dp=[[[0 for _ in range(n*x+1)] for _ in range(n+1)] for _ in range(n+1)]

for j in range(n+1):
  for k in range(n+1):
    for s in range(n*x+1):
      if j==0 and k==0 and s==0:
        dp[j][k][s]=1
      elif j>=1 and s<l[j-1]:
        dp[j][k][s]=dp[j-1][k][s]
      elif j>=1 and k>=1 and s>=l[j-1]:
        dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-l[j-1]]
      else:
        dp[j][k][s]=0

s=0
for k in range(1,n+1):
  s+=dp[n][k][k*a]

print(s)

### FIXED CODE ###

n,a=map(int,input().split())
l=list(map(int,input().split()))
x=max(l)
x=max(x,a)
dp=[[[0 for _ in range(n*x+1)] for _ in range(n+1)] for _ in range(n+1)]

for j in range(n+1):
  for k in range(n+1):
    for s in range(n*x+1):
      if j==0 and k==0 and s==0:
        dp[j][k][s]=1
      elif j>=1 and s<l[j-1]:
        dp[j][k][s]=dp[j-1][k][s]
      elif j>=1 and k>=1 and s>=l[j-1]:
        dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-l[j-1]]
      else:
        dp[j][k][s]=0

s=0
for k in range(1,n+1):
  s+=dp[n][k][k*a]

print(s)
import math

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

def cnt(x,y,z):
    if x%z==0:
        return (y//z)-(x//z)+1
    else:
        return (y//z)-(x//z)
        
a,b,c,d=map(int,input().split())
s=lcm(c,d)
d1=cnt(a,b,c)
d2=cnt(a,b,d)
d3=cnt(a,b,s)

ans=(b-a+1)-(d1+d2-d3)
print(ans)

### FIXED CODE ###

import fractions

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

a,b,c,d=map(int,input().split())
d1=b//c
d2=b//d
d3=b//lcm(c,d)

d4=(a-1)//c
d5=(a-1)//d
d6=(a-1)//lcm(c,d)

ansb=b-(d1+d2-d3)
ansa=a-1-(d4+d5-d6)
print(ansb-ansa)
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]
cnt = 0
t = [j for j in range(a,b+1) if j%c != 0 and j%d != 0]

for i in t:
    if (i//c-i/c != 0) and (i//d-i/d != 0):
        cnt += 1
    else:
        pass
print(cnt)

### FIXED CODE ###

s = str(input())
s = list(s)
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print("Bad")
else:
    print("Good")
N,A,B = map(int, input().split())
  
N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = distAB / 2
else:
    ans = distAB / 0
print(int(ans))


### FIXED CODE ###

from decimal import *
N,A,B = map(int, input().split())

N -= 1
A -= 1
B -= 1

ans = 0
distAB = B - A

if distAB % 2 == 0:
    ans = Decimal(distAB) / Decimal(2)
else:
    if (N-B) < A:
        ans = (N-B+1) + (Decimal(distAB-1)/Decimal(2))
    else:
        ans = A+1 + (Decimal(distAB-1)/Decimal(2))

print(int(ans))
MOD = 10 ** 9 + 7
N, M = list(map(int, input().split()))
A = sorted(map(int, input().split()), reverse=True) + [-1]
B = sorted(map(int, input().split()), reverse=True) + [-1]

if any(any(x1 == x2 for x1, x2 in zip(X, X[1:])) for X in [A, B]):
    import sys
    print(0)
    sys.exit()

#print(A)
#print()

def solve():
    su = 1
    h, w = 0, 0
    for i, n in enumerate(range(N*M, 0, -1)):
        #print("h={}, w={}, i={}, n={}, su={}".format(h, w, i, n, su))
        if A[h] >= n:
            nh = h + 1
        if B[w] >= n:
            nw = w + 1
        if A[h] == B[w] and B[w] == n:
            #print(1)
            pass
        elif A[h] == n:
            #print(2)
            su = (su * nw) % MOD
        elif B[w] == n:
            #print(3)
            su = (su * nh) % MOD
        else:
            #print(4)
            su = (su * (nh * nw - i)) % MOD
        h = nh
        w = nw
    return su
        
            
if __name__ == "__main__":
    print(solve())


### FIXED CODE ###

MOD = 10 ** 9 + 7
N, M = list(map(int, input().split()))
A = sorted(map(int, input().split()), reverse=True) + [-1]
B = sorted(map(int, input().split()), reverse=True) + [-1]

def solve():
    su = 1
    h, w = 0, 0
    for i, n in enumerate(range(N*M, 0, -1)):
        #print("h={}, w={}, i={}, n={}, su={}".format(h, w, i, n, su))
        if su == 0:
            return su
        nh, nw = h, w
        if A[h] >= n:
            nh = h + 1
        if B[w] >= n:
            nw = w + 1
        if A[h] == B[w] and B[w] == n:
            #print(1)
            pass
        elif A[h] == n:
            #print(2)
            su = (su * nw) % MOD
        elif B[w] == n:
            #print(3)
            su = (su * nh) % MOD
        else:
            #print(4)
            su = (su * ((nh * nw - i) % MOD)) % MOD
        h = nh
        w = nw
    return su
        
            
if any(any(x1 == x2 for x1, x2 in zip(X, X[1:])) for X in [A, B]):
    print(0)
else:
    print(solve())
N, K = map(int, input().rstrip().split())
sunuke = [int(i) for i in range(1,N + 1)]
d = []
A = []

for i in range(K):
  d.append(int(input()))
  A.append(list(map(int, input().split())))

for k in range(K):
  for i in range(d[k]):
    for j in A[i]:
      if j in sunuke:
        sunuke.remove(j)
    
print(len(sunuke))

### FIXED CODE ###

N, K = map(int, input().rstrip().split())
sunuke = [int(i) for i in range(1,N + 1)]
d = []
A = []

for i in range(K):
  d.append(int(input()))
  A.append(list(map(int, input().split())))

for k in range(K):
  for i in range(d[k]):
    if A[k][i] in sunuke:
      sunuke.remove(A[k][i])
  
    
print(len(sunuke))
n=int(input())
xyh = [list(map(int,input().split())) for i in range(n)]

ansh=-1
ans=[]
flag=True
for cx in range(0,101):
  if len(ans)>0:
    break
  for cy in range(0,101):
    if len(ans)>0:
      break
    ansh = -1
    for pira in xyh:
      
      if flag = True and pira[2] == 0 and ansh==-1 and pira[2]+abs(cx-pira[0])+abs(cy-pira[1])<=0:
        ansh = pira[2]+abs(cx-pira[0])+abs(cy-pira[1])
        ans.append([cx,cy,ansh])
      
      elif flag = True and pira[2] > 0 and ansh == -1:
        ansh = pira[2]+abs(cx-pira[0])+abs(cy-pira[1])
        ans.append([cx,cy,ansh])
        flag=False
        
      elif len(ans)>0 and pira[2] > 0 and ansh !=pira[2]+abs(cx-pira[0])+abs(cy-pira[1]):
        ans=[]
        break
        
      elif len(ans)>0 and pira[2]==0 and ansh-abs(cx-pira[0])-abs(cy-pira[1])>0:
        ans=[]
        break
print(*ans[0])


### FIXED CODE ###

n=int(input())
xyh = [list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda x:x[2], reverse=True)

ansh=-1
ans=[[]]
flag=True
for cx in range(0,101):
  if flag==False:
    break
    
  for cy in range(0,101):
    ansh = 0
    for pira in xyh:
      if ansh==0:
        ansh=pira[2]+(abs(cx-pira[0])+abs(cy-pira[1]))
        ans[0]=[cx,cy,ansh]
        
      elif len(ans[0])>0 and max(ansh -(abs(cx-pira[0])+abs(cy-pira[1])), 0) != pira[2]:
        ans[0]=[]
    if len(ans[0])>0:
      flag=False
      break
print(*ans[0])
N = int(input())
uvw = [list(map(int,input().split())) for _ in range(N-1)]

ans = [0] * N
adj_list = [[] for _ in range(N)]

for u,v,w in uvw:
    adj_list[u-1].append([v-1,w])
    adj_list[v-1].append([u-1,w])
    
memo = [True] * N
def dfs(s,cnt): 
    memo[s] = False
    if cnt % 2 == 1:
        ans[s] = 1
    nxt = adj_list[s]
    for v,w in nxt:
        if memo[v]:
            dfs(v,cnt+w)
    return
    
dfs(0,0)
for a in ans:
    print(a)
    

    


### FIXED CODE ###

N = int(input())
uvw = [list(map(int,input().split())) for _ in range(N-1)]
import sys
sys.setrecursionlimit(10000000)
#testcase = open('testcase_04','r')
#contents = testcase.read()
#contents = contents.split("\n")
#N = int(contents[0])
#uvw = [[0,0,0] for _ in range(N-1)]
#for i in range(N-1):
#    uvw[i] = [int(j) for j in contents[i+1].split()]
        


ans = [0] * N
adj_list = [[] for _ in range(N+1)]

for u,v,w in uvw:
    adj_list[u-1].append([v-1,w])
    adj_list[v-1].append([u-1,w])
    
memo = [True] * N
def dfs(s,cnt): 
    memo[s] = False
    if cnt % 2 == 1:
        ans[s] = 1
    nxt = adj_list[s]
    for v,w in nxt:
        if memo[v]:
            dfs(v,cnt+w)
    return
    
dfs(0,0)
for a in ans:
    print(a)
N = int(input())
A = [int(input()) for i in range(N)]
maxnum = max(A)
for i in range(N):
    if i == maxindex:
        tmp = A
        del tmp[tmp.index(max(tmp))]
        print(max(tmp))
    else:
        print(maxnum)

### FIXED CODE ###

N = int(input())
A = [int(input()) for i in range(N)]
maxind = A.index(max(A))
maxa = max(A)
A = sorted(A)
ans = [maxa]*maxind
ans.append(A[-2])
[ans.append(i) for i in [maxa]*(N-maxind-1)]
print(*ans,sep="\n")
N = int(input())
As = [int(input()) for _ in range(N)]

sunuke = 0
while all([a % 2 == 0 for a in As]):
    sunuke += 1
    As = [a / 2 for a in As]
print(sunuke)


### FIXED CODE ###

N = int(input())
As = [int(x) for x in input().split()]

sunuke = 0
while all([a % 2 == 0 for a in As]):
    sunuke += 1
    As = [a // 2 for a in As]
print(sunuke)
import sys
input = sys.stdin.readline
 
K,S=map(int,input().split())
 
z = list(range(K+1))
ans = []
 
for i in z:
  s_z = S - i
  if s_z < 0:
    pass
  elif K < s_z:
    if (K + 1) > (s_z - K):
      ans.extend(2*K - s_z + 1)
  else:
    ans.extend(s_z + 1)
 
print(sum(ans))

### FIXED CODE ###

K,S=map(int,input().split())

z = list(range(0,K+1))
answer = []

for i in z:
  s_z = S - i
  if s_z < 0:
    pass
  elif K < s_z:
    if (K + 1) > (s_z - K):
      answer.append(K + 1 - (s_z - K))
  else:
    answer.append(s_z + 1)

print(sum(answer))
xkd = input()

x,k,d = int(xkd.split())

if x >= k*d:
    print(x-(k*d))
else:
    if x <= -(k*d):
        print(x+(k*d))
    else:
        if x <= 0:
            lxl = -x
        else:
            lxl = x
        if x <= 0:
            now_x = x + (d * (int(lxl / d) + 1))
            left_x = -now_x
            right_x = now_x + d
        else:
            now_x = x - (d * (int(lxl / d) + 1))
            left_x = -(now_x - d)
            right_x = now_x
        now_k = k - int(lxl / d) - 1
        if now_x <= 0:
            if now_k % 2 == 0:
                print(left_x)
            else:
                print(right_x)
        else:
            if now_k % 2 == 0:
                print(right_x)
            else:
                print(left_x)
            
        
        


### FIXED CODE ###

sd = input()
ok = 0
if sd[0] == 'R':
    if sd[1] == 'R':
        if sd[2] == 'R':
            ok = 1
            print(3)
        else:
            ok = 1
            print(2)
    else:
        ok = 1
        print(1)
else:
    if sd[1] == 'R':
        if sd[2] == 'R':
            ok =1 
            print(2)
        else:
            ok = 1
            print(1)
    else:
        if sd[2] == 'R':
            print(1)
            ok = 1
if ok == 0:
    print(0)
n,m,x = map(int,input().split())
c_list = [list(map(int,input().split())) 
          for nesya in range(n)]
arugo = [0]*m
hoge = 0
while c in c_list:
  arugo[0] += c[1]
  arugo[1] += c[2]
  arugo[2] += c[3]
  hoge += c[0]
if arugo[0] < 10 or arugo[1] < 10 or arugo[2] < 10:
  print(-1)
else:
  print(hoge)

### FIXED CODE ###

def bit_set(num:int,n:int):
  if num & (1<<n):
    return True
  return False

n,m,x = map(int,input().split())
ca_list = [list(map(int,input().split())) 
           for nesya in range(n)]
c = -1
for i in range(2**n):
  skill = [0]*m
  cost = 0
  for k in range(n):
    if bit_set(i,k) == True:
      ca =  ca_list[k]
      cost += ca[0]
      a = ca[1:]
      skill = [j+l for (j,l) in zip(skill, a)]
  if all((hoge >= x) for hoge in skill):
    if c == -1:
      c = cost
    else:
      c = min(c,cost)
print(c)
import numpy as np

n,m,d = map(int,input().split())

"""
#kuso code
start = time.time()
a = [random.randrange(n) for i in range(m)]
a = np.array(a)
b = np.abs(a[1:]-a[:-1])
cnt = np.sum(b == d)
ave = cnt

i = 0
while(time.time() - start < 10):
    a = [random.randrange(n) for i in range(m)]
    a = np.array(a)
    b = np.abs(a[1:]-a[:-1])
    cnt = np.sum(b == d)
    ave = ((i+1)*ave + cnt)/(i+2)
    i += 1
print(ave)
"""

oks_times_n = 2*np.max(n-2*d,0) + 2*d)
ave = oks*(m-1)/n/n
print(ave)


### FIXED CODE ###

import numpy as np

n,m,d = map(int,input().split())

"""
#kuso code
start = time.time()
a = [random.randrange(n) for i in range(m)]
a = np.array(a)
b = np.abs(a[1:]-a[:-1])
cnt = np.sum(b == d)
ave = cnt

i = 0
while(time.time() - start < 10):
    a = [random.randrange(n) for i in range(m)]
    a = np.array(a)
    b = np.abs(a[1:]-a[:-1])
    cnt = np.sum(b == d)
    ave = ((i+1)*ave + cnt)/(i+2)
    i += 1
print(ave)
"""

oks_times_n = 2*np.max(n-2*d,0) + 2*d
ave = oks_times_n/n/n*(m-1)
if (d == 0):
    ave /= 2
print(ave)
from operator import mul
from functools import reduce

def com(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

def run():
  N = int(input())
  K = int(input())
  Nnum = len(str(N))
  #1
  all1 = com(Nnum, K)*9**K
  #2
  all2 = (9-int(str(N)[0]))*com(Nnum-1, K-1)*9**(K-1)
  if K == 1:
    print(all1-all2)
  #3
  elif K == 2:
    all3 = 0
    for n in range(1, Nnum):
      N2 = int(str(N)[n])
      if N2 != 0:
        all3 += 9-N2
        break
      all3 += 9
    else:
      all3 = (Nnum-1)*9
    print(all1-all2-all3)
  #4
  else:
    all3 = 0
    count = 0
    for n in range(1, Nnum):
      N2 = int(str(N)[n])
      if N2 != 0:
        if count == 0:
          all3 += (9-N2)*com(Nnum-n-1, 1)*9
        elif count == 1:
          all3 += 9-N2
        count += 1
        if count == 2:
          break
      elif count == 0:
        all3 += 9*(Nnum-n-1)*9
      else:
        all3 += 9
    else:
      if count == 0:
        all3 = com(Nnum-1, 2)*9*9
      else:
        all3 = (Nnum-1)*9
    print(all1-all2-all3)
    
  

if __name__ == '__main__':
    run()

### FIXED CODE ###

def run():
  N = list(map(int, list(input())))
  K = int(input())
  Nlen = len(N)
  dp = [[[0]*(K+2) for _ in range(2)] for n in range(Nlen+1)]
  dp[0][0][0] = 1
  for nlen in range(Nlen):
    dN = N[nlen]
    for d in range(10):
      for j in range(2):
        for k in range(K+2):
          flagj = j or d < dN
          if (flagj == 0) and (d > dN): continue
          flagk = min(K+1, k+(d != 0))
          dp[nlen+1][flagj][flagk] += dp[nlen][j][k]
  print(dp[-1][0][K]+dp[-1][1][K])
  
if __name__ == '__main__':
    run()
A, B, K = map(int, input().split())
if B-A+1 >= 2*K: 
    res_list = [i for i in range(A, A+K)] + [i for i in range(B-K+1, B+1)]
else: 
    res_list = [i for i in range(A, B+1)]
for i in res_list:
    print(i)

### FIXED CODE ###

S = input()
if (S=="abc") or (S=="acb") or (S=="bca") or (S=="cba") or (S=="bac") or (S=="cab"):
  print("Yes")
else:
  print("No")
x,a = map(int,input())
if x<a:
  print(0)
else:
  print(10)

### FIXED CODE ###

x,a = map(int,input().split())
if x<a:
  print(0)
else:
  print(10)
n=int(input())
s=input()
ans=[]
for i in range(n):
    num=ord(s[i])+2
    if num>90:
        num-=90
    ans.append(chr(num))
ans="".join(ans)
print(ans)

### FIXED CODE ###

n=int(input())
s=input()
ans=[]
for i in range(len(s)):
    num=ord(s[i])+n
    if num>90:
        num-=26
    ans.append(chr(num))
ans="".join(ans)
print(ans)
n=int(input())
dat=list(map(int, input().split()))

for e in dat:
       e = bin(e)[2:]
       e = list(e).reverse()

re=[]

for e in dat:
      try:
          w=e.index('1')
          re.append(w)
       except ValueError
          re.append(0)

print(min(re))

### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
def c(x):
    if sb[x] + S <= k: return True
    else: return False


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

sa = []
sb = []

if a[0] <= k:
    sa.append(a[0])
    for i in range(1, n):
        if sa[i-1]+a[i] > k:
            break
        sa.append(sa[i-1]+a[i])

if b[0] <= k:
    sb.append(b[0])
    for j in range(1, m):
        if sb[j-1]+b[j] > k:
            break
        sb.append(sb[j-1]+b[j])

if len(sa) == 0:
    print(len(sb))
    exit()

for i in range(len(sa))[::-1]:
    mb = 0
    lb = len(sb) - 1
    if len(sb) == 0 or sa[i] + sb[0] > k:
        print(len(sa))
        exit()
    
    while lb - mb > 1:
        mid = (mb+lb)//2
        if c(mid):
            mb = mid
        else:
            lb = mid
    ans = max(ans, i+1+lb)

print(ans)

### FIXED CODE ###

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

sa = [0]
sb = [0]

for i in range(n):
    sa.append(sa[i]+a[i])

for i in range(m):
    sb.append(sb[i]+b[i])

ans = 0
j = m

#しゃくとり
for i in range(n+1):
    if sa[i] > k:
        break
    while sa[i]+sb[j] > k:
        j -= 1
    ans = max(ans, i+j)

print(ans)
def my_turn(card_list):
    card_list.popleft
    if not card_list:
        cont_game = False
    else:
        your_turn = card_list[0]

card_a = [ _ for _ in input()]
card_b = [ _ for _ in input()]
card_c = [ _ for _ in input()]

your_turn = 'a'
cont_game = True

while cont_game:
    if your_turn == 'a':
        my_turn(card_a)
    if your_turn == 'b':
        my_turn(card_a)
    if your_turn == 'c':
        my_turn(card_a)

print(your_turn)

### FIXED CODE ###


def my_turn(card_list):
    global cont_game
    global your_turn
    if card_list:
        your_turn = card_list[0]
        card_list.pop(0)
    else:
        cont_game = False

card_a = [ _ for _ in input()]
card_b = [ _ for _ in input()]
card_c = [ _ for _ in input()]

your_turn = 'a'
cont_game = True

while cont_game:
    if your_turn == 'a':
        my_turn(card_a)
    if your_turn == 'b':
        my_turn(card_b)
    if your_turn == 'c':
        my_turn(card_c)

print(your_turn.upper())
a,b,c=map(int,input.split())
if a+b>=c:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c=map(int,input().split())
if a+b>=c:
  print('Yes')
else:
  print('No')
n=map(int,input().split())
color=[-1 for i in range(n)]
color[0]=0
G=[[] for i in range(n)]
for i in range(n-1):
  a,b,d=map(int,input().split())
  G[a-1].append([b-1,d])
  G[b-1].append([a-1,d])
  
def dfs(x):
  for i in G[x]:
    if color[i] != -1: return
    color[i]=1-color[x]
    dfs(i)
dfs(0)
print(*color)
      

### FIXED CODE ###

import copy ; import sys ; sys.setrecursionlimit(11451419)
n=int(input())
color=[-1 for i in range(n)]
color[0]=1
G=[[] for i in range(n)]
for i in range(n-1):
  a,b,d=map(int,input().split())
  G[a-1].append([b-1,d])
  G[b-1].append([a-1,d])
  
def dfs(x):
  
  for i,dis in G[x]:
    
    if color[i] != -1: continue
    if dis %2==1:
      color[i]=1-color[x]
    else:
      color[i]=color[x]
    dfs(i)
dfs(0)
for i in range(n):
  print(color[i])
n,k=[int(x) for x in input().split()]
arr=[int(x) for x in input().split()]
s=0
if(n>k):
	for i in range(n-k):
  		s+=arr[i]
    print(s)
else:
  print(0)

  

### FIXED CODE ###

n,k=[int(x) for x in input().split()]
arr=[int(x) for x in input().split()]
s=0
arr.sort()
if(n>k):
    for i in range(n-k):
        s+=arr[i]
    print(s)
else:
  print(0)
#!/usr/bin/env python3
import sys

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
S = input()
T = input()


idx = S.index(T[0])
ans = idx+1
lenT = len(T)
for i in range(1,lenT):
    S = S[idx+1:] + S[:idx+1]
    idx = S.index(T[i])
    ans += idx+1

print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
#ABC138 E

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
t = input()
n = len(s)
m = len(t)
f = [False]*26
f2 = [False]*26
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(n):
    f[alpha.index(s[i])] = True
for i in range(m):
    f2[alpha.index(t[i])] = True
for i in range(26):
    if not f[i] and f2[i]:
        print(-1)
        quit()
ans = 0
inde = s.index(t[0])
ans += inde+1
for i in range(1,m):
    s = s[inde+1:] + s[:inde+1]
    inde = s.index(t[i])
    ans += inde+1
print(ans)
s=input()
sl=list(s)
p=s[0]
ans=0
ans2=0
for i in range(4):
    if s[i]==p:
        ans+=1
    else:
        q=s[i]

for i in range(4):
    if s[i]==q:
        ans2+=1

if ans==2 and ans2==2:
    print("Yes")
else:
    print("No")



### FIXED CODE ###

s=input()
l=list(s)
import collections
c=collections.Counter(l)
ll=c.most_common()

for i,j in ll:
    if j!=2:
        print("No")
        import sys
        sys.exit()
print("Yes")
n,k=map(int,input().split())
print(int((n-1)/(k-1))

### FIXED CODE ###

n,k=map(int,input().split())
print((n+k-3)//(k-1))
#! /usr/bin/env python3
# -*- coding:utf-8 -*-

def attackSurvival(n, k, q, a):
    ans = []
    import collections
    c = collections.Counter(a)
    for i in range(n):
        if c[i+1] > q - k: ans.append('Yes')
        else: ans.append('No')
    return ans

def main():
    n, k, q = filter(int, input().split())
    a = []
    for _ in range(q):
        a.append(int(input()))
    attackSurvival(n, k, q, a)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding:utf-8 -*-

def attackSurvival(n, k, q, a):
    ans = []
    import collections
    c = collections.Counter(a)
    for i in range(n):
        if c[i+1] > q - k: ans.append('Yes')
        else: ans.append('No')
    return ans

def main():
    n, k, q = map(int, input().split())
    a = []
    for _ in range(q):
        a.append(int(input()))
    for ans in attackSurvival(n, k, q, a): print(ans)

if __name__ == '__main__':
    main()