Harryxun/stf_run huggingface dataset:
s_d = input()
t = input()
possible = True
for i in range(len(s_d) - len(t), -1, -1):
    for j in range(len(t)):
        if s_d[i + j] == t[j] or s_d[i + j] == "?":
            continue
        else:
            possible = False
            break
    if possible == False:
        continue
    else:
        s = s_d[:i] + t + s_d[i+len(t):]
        for k in range(len(s)):
            if s[k] == "?":
                s = s[:k] + "a" + s[k+1:]
        break
if possible == True:
    print(s)
else:
    print("UNRESTORABLE")

### FIXED CODE ###

s_d = input()
t = input()
if len(s_d) >= len(t):
    for i in range(len(s_d) - len(t), -1, -1):
        possible = True
        for j in range(len(t)):
            if s_d[i + j] == t[j] or s_d[i + j] == "?":
                continue
            else:
                possible = False
                break
        if possible == False:
            continue
        else:
            s = s_d[:i] + t + s_d[i+len(t):]
            for k in range(len(s)):
                if s[k] == "?":
                    s = s[:k] + "a" + s[k+1:]
            break
else:
    possible = False
if possible == True:
    print(s)
else:
    print("UNRESTORABLE")
iro = []
res = []
r = 0
cc = {}
N = int(input())
for i in range(N-1):
  a,b = input().split(" ")
  a = int(a)
  b = int(b)
  cr = 0
  for p in iro:
    if a in iro:
      cr += 1
      continue
    elif b in iro:
      cr += 1
      continue
    elif a not in p and b not in p:
      iro[cr].append(a)
      iro[cr].append(b)
      res.append(cr+1)
      else:
        if cc[a] > 

      break
    cr += 1
  else:
    r = cr
    iro.append([a,b])
    res.append(cr+1)
print(r+1)
for i in res:
  print(i)




### FIXED CODE ###

import sys
from collections import deque
read = sys.stdin.read

N, *ab = map(int, read().split())

graph = [[] for _ in range(N + 1)]
 
for a, b in zip(*[iter(ab)] * 2):
    graph[a].append(b)
 
color = [0] * (N + 1)
queue = deque([1])
 
while queue:
    V = queue.popleft()
    number = 1
    for v in graph[V]:
        if number == color[V]:
            number += 1
        color[v] = number
        queue.append(v)
        number += 1
 
print(max(color))
for a, b in zip(*[iter(ab)] * 2):
    print(color[b])
def get_par(x):
  if x == par_list[x]:
    return x
  else:
    return get_par(par_list[x])

N,M=map(int,input().split())
par_list = [i for i in range(N)]
for i in range(M):
  Xi,Yi,Zi=map(int,input().split())
  par_Xi = get_par(Xi-1)
  par_Yi = get_par(Yi-1)
  if par_Xi != par_Yi:
    par_list[par_Yi] = par_list[par_Xi]
    
set_uf = set()
for par in par_list:
  set_uf.add(par)
  
print(len(set_uf))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

def get_par(x):
  if x == par_list[x]:
    return x
  else:
    par_list[x] = get_par(par_list[x])
    return par_list[x]

N,M=map(int,input().split())
par_list = list(range(N))
for i in range(M):
  Xi,Yi,Zi=map(int,input().split())
  par_Xi = get_par(Xi-1)
  par_Yi = get_par(Yi-1)
  if par_Xi != par_Yi:
    par_list[par_Yi] = par_Xi
    
set_uf = set()
for par in par_list:
  set_uf.add(get_par(par))
  
print(len(set_uf))
tmpn,k=map(int,input().split())
a=[int(input()) for _ in range(tmpn)]
n=3*10**5+2

def init_max(init_max_val):
    #set_val
    for i in range(n):
        seg_max[i+num_max-1]=init_max_val[i]    
    #built
    for i in range(num_max-2,-1,-1) :
        seg_max[i]=max(seg_max[2*i+1],seg_max[2*i+2]) 
    
def update_max(k,x):
    k += num_max-1
    seg_max[k] = x
    while k:
        k = (k-1)//2
        seg_max[k] = max(seg_max[k*2+1],seg_max[k*2+2])
    
def query_max(p,q):
    if q<=p:
        return ide_ele_max
    p += num_max-1
    q += num_max-2
    res=ide_ele_max
    while q-p>1:
        if p&1 == 0:
            res = max(res,seg_max[p])
        if q&1 == 1:
            res = max(res,seg_max[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = max(res,seg_max[p])
    else:
        res = max(max(res,seg_max[p]),seg_max[q])
    return res

#####単位元######
ide_ele_max = 0

#num_max:n以上の最小の2のべき乗
num_max =2**(n-1).bit_length()
seg_max=[ide_ele_max]*2*num_max

init_max([0]*n)

for aa in a:
    aa+=1
    maxlen=query_max(aa-k,aa+k+1)
    update_max(aa,maxlen+1)

print(query_max(0,n+1))

### FIXED CODE ###

tmpn,k=map(int,input().split())
a=[int(input()) for _ in range(tmpn)]
n=3*10**5+1

def init_max(init_max_val):
    #set_val
    for i in range(n):
        seg_max[i+num_max-1]=init_max_val[i]    
    #built
    for i in range(num_max-2,-1,-1) :
        seg_max[i]=max(seg_max[2*i+1],seg_max[2*i+2]) 
    
def update_max(k,x):
    k += num_max-1
    seg_max[k] = x
    while k:
        k = (k-1)//2
        seg_max[k] = max(seg_max[k*2+1],seg_max[k*2+2])
    
def query_max(p,q):
    if q<=p:
        return ide_ele_max
    p += num_max-1
    q += num_max-2
    res=ide_ele_max
    while q-p>1:
        if p&1 == 0:
            res = max(res,seg_max[p])
        if q&1 == 1:
            res = max(res,seg_max[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = max(res,seg_max[p])
    else:
        res = max(max(res,seg_max[p]),seg_max[q])
    return res

#####単位元######
ide_ele_max = 0

#num_max:n以上の最小の2のべき乗
num_max =2**(n-1).bit_length()
seg_max=[ide_ele_max]*2*num_max

init_max([0]*n)

for aa in a:
    maxlen=query_max(max(0,aa-k),min(aa+k,n-1)+1)
    update_max(aa,maxlen+1)

print(query_max(0,n+1))
# from itertools import product
def product(a, repeat=3):
    for i in a:
        for j in a:
            for k in a:
                yield [i, j, k]

INF = 10**18

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

# i番目までのケーキの内、j個食べた時のpointの最大値
# (ただしpointの計算時には、8通りのmaskを乗算する)

def mul_mask(l, mask):
    return [a*b for a, b in zip(l, mask)]

dp_std = [[-INF for _ in range(M+1)] for _ in range(N+1)]
for i in range(N+1):
    dp_std[i][0] = 0
# print(dp_std)

max_p = -INF
for mask in product([-1, 1], repeat=3):
    dp = dp_std.copy()
    for i in range(1, N+1):
        score = sum(mul_mask(XYZ[i-1], mask))
        for j in range(1, M+1):
            # print(i, j, XYZ[i-1], mask)
            dp[i][j] = max(
                dp[i-1][j],
                dp[i-1][j-1] + score
            )
            # for dp_i in dp:
            #     print(dp_i)
    p = dp[N][M]
    max_p = max(max_p, p)
    # print(p)

print(max_p)

### FIXED CODE ###

# from itertools import product

INF = 10**18

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

# i番目までのケーキの内、j個食べた時のpointの最大値
# (ただしpointの計算時には、8通りのmaskを乗算する)

def mul_mask(l, mask):
    p = []
    for i, m in enumerate(l):
        p.append(m*mask[i])
        # print(p)
    return p
    # return [a*b for a, b in zip(l, mask)]

dp_std = [[-INF for _ in range(M+1)] for _ in range(N+1)]
for i in range(N+1):
    dp_std[i][0] = 0
# print(dp_std)

max_p = -INF
# masks = product([-1, 1], repeat=3)
masks = []
for i in [1, -1]:
    for j in [1, -1]:
        for k in [1, -1]:
            masks.append([i, j, k])
# print(masks)
for mask in masks:
    dp = dp_std[:]
    for i in range(1, N+1):
        score = sum(mul_mask(XYZ[i-1], mask))
        for j in range(1, M+1):
            # print(i, j, XYZ[i-1], mask)
            dp[i][j] = max(
                dp[i-1][j],
                dp[i-1][j-1] + score
            )
            # for dp_i in dp:
            #     print(dp_i)
    p = dp[N][M]
    max_p = max(max_p, p)
    # print(p)

print(max_p)
def handPop(hand):
    min_val = hand.pop(hand.index(min(hand)))
    return hand, min_val

N, K = map(int, input().split())
V = list(map(int, input().split()))
hand = []
ps = []
def func(V, hand, K):
    if K < 1:
        ps.append(hand)
        return
    if len(hand) > 0 and min(hand) < 0:
        hand_ = hand[:]
        hand_, min_val = handPop(hand_)
        C = func([min_val] + V, hand_, K-1)
        D = func(V + [min_val], hand_, K-1)
        A = func(V[1:], hand+[V[0]], K-1)
        B = func(V[:-1], hand+[V[-1]], K-1)
    else:
        A = func(V[1:], hand+[V[0]], K-1)
        B = func(V[:-1], hand+[V[-1]], K-1)

    
func(V, hand, K)
v_max = max([sum(x) for x in ps])
print(v_max if v_max > 0 else 0)

### FIXED CODE ###

N, K = map(int, input().split())
V = list(map(int, input().split()))
ans = 0
for L in range(min(N, K+1)):
    for R in range(min(N-L, K-L)+1):
        js = V[:L] + V[-R:] if R > 0 else V[:L]
        t = K - L - R
        s = 0
        for i in sorted(js):
            if i < 0 and t > 0:
                s += -i
                t -= 1
        ans = max(ans, sum(js) + s)
print(ans)
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt, gcd
from copy import deepcopy


def main():
    n = int(input())
    a_list = tuple(map(int, input().split()))
    num = 1000000000000000000
    ans = 1
    for i in range(n):
        ans *= a_list[i]
    
    if ans <= num:
        print(ans)
    else:
        print(-1)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil, floor, sqrt, gcd
from copy import deepcopy

def main():
    a,b = map(int, input().split())
    print(a*b)
if __name__ == "__main__":
    main()
# 12/25 AC日記
# GCDについて,2,3を追加しておくと全体のgcdは必ず1
# つまり残りは2の倍数または3の倍数を入れることにする?
# 2,3,a ではaは素数ではない.また3,(2+a)=3なのでa = 4?と思うが(3+a)は偶数なので7とする?
# 2,3,7に加えるとしたら？->この方法だと20000個数も取れないでしょ
# ちょっと難しいので休憩

# 12/27 再開
# 素因数は必ず2種類あるべきなのではないか
# それを2,3とする
# 0(mod2) ∧ !0(mod3) -> 総和は3の倍数
# 全部入れると丁度2万個なのでこれが想定されていそう
n = int(input())
nn = n
if n == 3:
    print("2 5 63")
else:
    res = [2, 4, 3, 9]
    n -= 4
    for i in range(2, 5001):
        if n < 2:
            break
        else:
            n -= 2
            res.append(6 * i - 4)
            res.append(6 * i - 2)
    for i in range(3, 5000, 2):
        if n < 2:
            break
        else:
            n -= 2
            res.append(6 * i - 3)
            res.append(6 * i + 3)
    for i in range(1, 5001):
        if n == 0:
            break
        else:
            n -= 1
            res.append(6 * i)

for i in range(len(res)):
    print(str(res[i]) + " ", end="")

### FIXED CODE ###

# 12/25 AC日記
# GCDについて,2,3を追加しておくと全体のgcdは必ず1
# つまり残りは2の倍数または3の倍数を入れることにする?
# 2,3,a ではaは素数ではない.また3,(2+a)=3なのでa = 4?と思うが(3+a)は偶数なので7とする?
# 2,3,7に加えるとしたら？->この方法だと20000個数も取れないでしょ
# ちょっと難しいので休憩

# 12/27 再開
# 素因数は必ず2種類あるべきなのではないか
# それを2,3とする
# 0(mod2) ∧ !0(mod3) -> 総和は3の倍数
# 全部入れると丁度2万個なのでこれが想定されていそう
n = int(input())
nn = n
if n == 3:
    print("2 5 63")
else:
    res = [2, 4, 3, 9]
    n -= 4
    for i in range(2, 5001):
        if n < 2:
            break
        else:
            n -= 2
            res.append(6 * i - 4)
            res.append(6 * i - 2)
    for i in range(3, 5000, 2):
        if n < 2:
            break
        else:
            n -= 2
            res.append(6 * i - 3)
            res.append(6 * i + 3)
    for i in range(1, 5001):
        if n == 0:
            break
        else:
            n -= 1
            res.append(6 * i)
    for i in range(len(res)):
        print(str(res[i]) + " ", end="")
n,a,b,c,d = map(int,input().split())
S = list(input())
S = ['#'].expand(S)
print(S)

flg = 1
for i in range(a-1,c-2):
    if S[i:i+2] == ['#','#']:
        flg *= 0

for i in range(b-1,d-2):
    if S[i:i+2] == ['#','#']:
        flg *= 0

if c>d:
    flg2 = 0
    for i in range(b-1,d):
        if S[i-1:i+2] == ['.','.','.']:
            flg2 = 1
    flg *= flg2

if flg == 0:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

n,a,b,c,d = map(int,input().split())
S = list(input())

flg = 1
for i in range(a-1,c-2):
    if S[i:i+2] == ['#','#']:
        flg *= 0

for i in range(b-1,d-2):
    if S[i:i+2] == ['#','#']:
        flg *= 0

if c>d:
    flg2 = 0
    for i in range(b-1,d):
        if S[i-1:i+2] == ['.','.','.']:
            flg2 = 1
    flg *= flg2

if flg == 0:
    print('No')
else:
    print('Yes')
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count=0
    for i,j in zip(range(len(a)/2),range(len(b)/2)):
        for k,l in zip(a[2*i+1],b[2*j+1]):
            if(k!=l):
                count+=1
    if count==0:
        results.append(0)
    elif count==1:
        results.append(1)
    else:
        results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")
    



### FIXED CODE ###

results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count1=0
    count2=0
    if len(a) != len(b):
        results.append(2)
    else:
        for i in range(len(a)):
            if(i%2==1):
                if len(a[i]) != len(b[i]):
                    count1+=1
                else:
                    for k,l in zip(a[i],b[i]):
                        if(k!=l):
                            count1+=1
            else:
                if len(a[i]) != len(b[i]):
                    count2+=1
                else:
                    for k,l in zip(a[i],b[i]):
                        if(k!=l):
                            count2+=1           
        if count1==0 and count2==0:
            results.append(0)
        elif count1==1 and count2==0:
            results.append(1)
        else:
            results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")
a,b=int(input().split())
if a < 10 :
  c = int(b-1000+100*a)
else:
  c = b
ptint(c)

### FIXED CODE ###

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

if a >=10:
  c=int(b)
  print(c)
else:
  c=int(b+1000-100*a)
  print(c)
a = int(input())
l = list(str(a))
for s in l:
  if s == '7':
    print('Yes')
    break
  else if l[2] != '7':
    print('No')

### FIXED CODE ###

a = str(input())
if '7' in a:
  print('Yes')
else:
  print('No')
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cou = Counter(A) 

A = list(set(A))
A.sort()

C = [0]*(10**6+1)
for a in A:
    if C[a] == 0 and C[a] == 0:
        ans += 1

    i = 1
    while True:
        if a*i > 10**6+1:
            break
        C[a*i] = 1
        i += 1

print(ans)

### FIXED CODE ###

from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cnt = Counter(A) 

A = list(set(A))
A.sort()


C = [0]*(10**6+1)
ans = 0

for a in A:
    if C[a] == 0:
        i = 1
        while True:
            if a*i > 10**6:
                break
            C[a*i] = 1
            i += 1
        if cnt[a] == 1:
            ans += 1

print(ans)
a, b, c = map(int, input().split())
if sum(a, b, c) >= 22:
  print("bust")
else:
  print("win")

### FIXED CODE ###

a, b, c = map(int, input().split())
if a + b + c >= 22:
  print("bust")
else:
  print("win")
N, K = map(int, input().split())
h_s = list(map(int, input().split()))
# print(h_s)
dp = [float("inf")]*(N+K)
dp[0] = 0

for i in range(N):
    for j in range(K):
        dp[i+j] = min(dp[i+j], dp[i]+abs(h_s[i]-h_s[i+j]))

print(dp[N-1])

### FIXED CODE ###

N, K = map(int, input().split())
h_s = list(map(int, input().split()))+[0]*K
# print(h_s)
dp = [float("inf")]*(N+K)
dp[0] = 0
 
for i in range(N):
    for j in range(1, K+1):
        dp[i+j] = min(dp[i+j], dp[i]+abs(h_s[i]-h_s[i+j]))
 
print(dp[N-1])
n,k = map(int,input().split())
s = [int(input()) for i in range(n)]
s.sort()
c = 10 ** 12
for i in range(n-k+1):
    t = s[i+n-k] - s[i]
    if s[i+n-k] - s[i] < c:
        c = t

print(c)

### FIXED CODE ###

n,k = map(int,input().split())
s = [int(input()) for i in range(n)]
s.sort()
c = s[k-1] - s[0]
for i in range(1,n-k+1):
    if s[i+k-1] - s[i] < c:
        c = s[i+k-1] - s[i]

print(c)
import numpy as np
import math
while True:
    n= int(input())
    if n == 0:
        break
    a=list(map(int,input().split()))
    m=np.mean(a)
    s=0
    for i in a:
        s+=(i-m)**2
    s/=n
    print("{0:.8f}".format(math.sqrt(s)))

### FIXED CODE ###

while True:
    n = int( input() )
    if n==0:
        break
    a=list(map(int, input().split()))
    m=sum(a)/n
    s=0
    for i in a:
        s+=(i-m)**2
    print( ( s/n)**0.5 )
N = int(input())
A = [int(input()) for _ in range(N)]
m1,m2,_ = sorted(A)[::-1]

for i in A:
    if m1 == i:
        print(m2)
    else:
        print(m1)

### FIXED CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]
m1,m2,*_ = sorted(A)[::-1]

for i in A:
    if m1 == i:
        print(m2)
    else:
        print(m1)
from string import ascii_lowercase
N = int(input())

k = [0, 26]
for i in range(1, 13):
    k.append(26 * (k[i] + 1))

    for i in range(13):
        if k[i] + 1 <= N <= k[i+1]:
            n = N - (k[i] + 1)
            for j in range(i, -1, -1):
                print(ascii_lowercase[(n//26**j) % 26], end="")


### FIXED CODE ###

N = int(input())
L = list("abcdefghijklmnopqrstuvwxyz")
a = 1
while N > 26**a:
    N = N - 26**a
    a += 1
 
pre = []
for i in reversed(range(1,a)):
    r = (N-1) // 26**i
    pre.append(r)
    N = int(N%(26**i))
 
ans = ''
for i in pre:
    ans += L[i]
print(ans+L[N-1])
s=input().split()
place=[]
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    place.append(i)
ans=[0 for i in range(len(s))]
cur_p=place[0]
cur_p_i=0
for i in range(len(s)):
  if i>=cur_p:
    cur_p_i+=1
    cur_p=place[cur_p_i]
  if (i-cur_p)%2==0:
    ans[cur_p]+=1
  else:
    ans[cur_p+1]+=1
print(" ".join(ans))

### FIXED CODE ###

s=input()
place=[]
for i in range(1,len(s)):
  if s[i]!=s[i-1]:
    place.append(i)
ans=[0 for i in range(len(s))]
cur_p=place[0]
cur_p_i=0
is_l=False
set_place=set(place)
for i in range(len(s)):
  if i in set_place:
    if is_l:
      cur_p_i+=2
      cur_p=place[cur_p_i]
    is_l=not is_l
  if (i-cur_p)%2==0:
    ans[cur_p]+=1
  else:
    ans[cur_p-1]+=1
print(" ".join(map(str,ans)))
ans = 0
for i, a in enumerate(A):
    ans += B[a-1]
    if a - A[i-1] == 1 and i-1 > 0:
        ans += C[i-2]
print(ans)

### FIXED CODE ###

import numpy as np

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

ans = 0
for i, a in enumerate(A):    
    ans += B[a-1]
    
A_ = [-100] + A[:-1]
A_ = np.array(A_)
A = np.array(A)

A_diff = A - A_

for j in A[A_diff == 1] -1:
    ans += C[j-1]
print(ans)
if __name__ == "__main__":
    N = int(input())
    K = int(input())
    x = list(map(int, input().split()))
    ans = 0
    for i in range(N):
        r = min(x[i],abs(K-x[i]))
        ans += 2*r
    print(ans)

### FIXED CODE ###

if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)
N = int(input())

V = [[] for _ in range(N)]
C = [-1 for _ in range(N - 1)]


# v:頂点, c:色, p:親
def dfs(v, c, p):
    k = 1
    for _v, _id  in V[v]:
        if _v == p:
            continue
        if k == c:
            k += 1
        C[_id] = k
        dfs(_v, k, v)
        k += 1

for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    V[a].append([b, i])
    V[b].append([a, i])
print(V)
dfs(0, -1, -1)
print(max(C))
for i in C:
    print(i)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
N = int(input())

V = [[] for _ in range(N)]
C = [-1 for _ in range(N - 1)]


# v:頂点, c:色, p:親
def dfs(v, c, p):
    k = 1
    for _v, _id  in V[v]:
        if _v == p:
            continue
        if k == c:
            k += 1
        C[_id] = k
        dfs(_v, k, v)
        k += 1

for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    V[a].append([b, i])
    V[b].append([a, i])
#print(V)
dfs(0, -1, -1)
print(max(C))
for i in C:
    print(i)
= input()
A = list(map(int, input().split()))
print(max(A) - min(A))

### FIXED CODE ###

_ = input()
A = list(map(int, input().split()))
print(max(A) - min(A))
n,m = map(int,input().split())
a = list(map(int,input().split()))
sum_a = sum(a)
border = sum_a / (4*m)
kosu = 0
for i in a:
  if i >= border:
  kosu += 1
if kosu >= m:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n,m = map(int,input().split())
a = list(map(int,input().split()))
sum_a = sum(a)
border = sum_a / (4*m)
kosu = 0
for i in a:
  if i >= border:
  	kosu += 1
if kosu >= m:
  print('Yes')
else:
  print('No')
for i in range(len(S)-len(T)+1):
  sub_S = S[i:i+len(T)]
  cnt = 0
  for j in range(len(T)):
    if sub_S[j] != T[j]:
      cnt += 1
  cnt_list.append(cnt)
print(min(cnt_list))

### FIXED CODE ###

S = input()
T = input()
cnt_list = []

for i in range(len(S)-len(T)+1):
  sub_S = S[i:i+len(T)]
  cnt = 0
  for j in range(len(T)):
    if sub_S[j] != T[j]:
      cnt += 1
  cnt_list.append(cnt)
print(min(cnt_list))
n=int(input())
z=[]
for i in range(n):
     z.append(list(map(int,input().split())))
for cx in range(101):
    for cy in range(101):
        ans=set()
        for i in range(n):
            x,y,h=z[i][0],z[i][1],z[i][2]
            if h!=0:
                tmp=h+abs(x-cx)+abs(y-cy)
                ans.add(tmp)
        if len(ans)==1:
            for i in range(n):
                x,y,h=z[i][0],z[i][1],z[i][2]
                if h==0:
                    if ans[0]-abs(x-cx)-abs(y-cy)>=0:
                        break
            print(cx,cy,*ans)
            exit()

### FIXED CODE ###

n=int(input())
z=[]
aa=[]
for i in range(n):
     z.append(list(map(int,input().split())))
for cx in range(101):
    for cy in range(101):
        ans=set()
        for i in range(n):
            x,y,h=z[i][0],z[i][1],z[i][2]
            if h!=0:
                tmp=h+abs(x-cx)+abs(y-cy)
                ans.add(tmp)
        if len(ans)==1:
            ans=list(ans)
            aa.append((ans[0],cx,cy))

for a,cx,cy in aa:
    flg=True
    for i in range(n):
        x,y,h=z[i][0],z[i][1],z[i][2]
        if h!=max(a-abs(x-cx)-abs(y-cy),0):
                flg=False
    if flg:
        print(cx,cy,a)
        exit()
n = input()
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
 
def DFS_v(u):
    color[u] = 1
    t += 1
    d[u] = t
    for v in range(n):
        if M[u][v] == 1 and st[v] == 0:
            DFS_visit(v)
    color[u] == 2
    t += 1
    f[u] = t
 
def DFS():
    for u in range(n):
        if st[u] == 0:
            DFS_v(u)
    for u in range(n):
        print u+1, d[u], f[u])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()
    

### FIXED CODE ###

n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
 
def DFS_visit(u):
    col[u] = 1
    t[0] += 1
    d[u] = t[0]
    for v in range(n):
        if M[u][v] == 1 and col[v] == 0:
            DFS_visit(v)
    col[u] = 2
    t[0] += 1
    f[u] = t[0]
 
def DFS():
    for u in range(n):
        if col[u] == 0:
            DFS_visit(u)
    for u in range(n):
        print'{0} {1} {2}'.format(u+1, d[u], f[u])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()
n = input()
if n < 1000:
  print("ABC")
else:
  print("ABD")

### FIXED CODE ###

n = int(input())
if n < 1000:
  print("ABC")
else:
  print("ABD")
a, b = map(int, input().split())
c = math.ceil(((b - 1) / a) + 1)
print(c)


### FIXED CODE ###

a, b = map(int, input().split())
c = 0
while a * c - c + 1 < b:
    c += 1
print(c)
# -*- coding:shift-jis -*-
x=input()
def f(n):
 if n==0:return 1
 return f(n-1)*n
print(f(int(n)))

### FIXED CODE ###

# -*- coding:shift-jis -*-
x=input()
def f(n):
 if n==0:return 1
 return f(n-1)*n
print(f(int(x)))