Harryxun/stf_run huggingface dataset:
def getResult(S, i, T):
    res = ""
    for k in range(0, len(S)):
        if k < i:
            res = res + S[k]
        elif k >= i and k < i+len(T):
            res = res + T[k-i]
        else:
            res = res + S[k]
    S = res.replace('?', 'a')
    return S

res_list = []

res = False
for i in range(0, len(S)):
    if S[i] != '?':
        if checkValid(S, i, T) == True:
            res_list.append(getResult(S, i, T))
            res = True
    else:
        if checkValid2(S, i, T) == True:
            res_list.append(getResult(S, i, T))
            res = True

if res == False:
    print("UNRESTORABLE")
else:
    print (len(res_list))
    smallest = res_list[0]
    for i in range(0, len(res_list)):
        if smallest > res_list[i]:
            smallest = res_list[i]
def getResult(S, i, T):
    res = ""
    for k in range(0, len(S)):
        if k < i:
            res = res + S[k]
        elif k >= i and k < i+len(T):
            res = res + T[k-i]
        else:
            res = res + S[k]
    S = res.replace('?', 'a')
    return S

res_list = []

res = False
for i in range(0, len(S)):
    if S[i] != '?':
        if checkValid(S, i, T) == True:
            res_list.append(getResult(S, i, T))
            res = True
    else:
        if checkValid2(S, i, T) == True:
            res_list.append(getResult(S, i, T))
            res = True

if res == False:
    print("UNRESTORABLE")
else:
    print (len(res_list))
    smallest = res_list[0]
    for i in range(0, len(res_list)):
        if smallest > res_list[i]:
            smallest = res_list[i]

### FIXED CODE ###

import sys
 
S = sys.stdin.readline().rstrip()
T = sys.stdin.readline().rstrip()
 
def checkValid(S, i, T):
    try:
        if S[i] == T[0]:
            for j in range(0, len(T)):
                if S[i+j] == T[j] or S[i+j] == '?':
                    pass
                else:
                    return False
        else:
            return False
        return True
    except Exception as e:
        return False
 
def checkValid2(S, i, T):
    try:
        for j in range(0, len(T)):
            if S[i+j] == T[j] or S[i+j] == '?':
                pass
            else:
                return False
        return True
    except Exception as e:
        return False
def getResult(S, i, T):
    res = ""
    for k in range(0, len(S)):
        if k < i:
            res = res + S[k]
        elif k >= i and k < i+len(T):
            res = res + T[k-i]
        else:
            res = res + S[k]
    S = res.replace('?', 'a')
    return S
 
res_list = []
 
res = False
for i in range(0, len(S)):
    if S[i] != '?':
        if checkValid(S, i, T) == True:
            res_list.append(getResult(S, i, T))
            res = True
    else:
        if checkValid2(S, i, T) == True:
            res_list.append(getResult(S, i, T))
            res = True
 
if res == False:
    print("UNRESTORABLE")
else:
    smallest = res_list[0]
    for i in range(0, len(res_list)):
        if smallest > res_list[i]:
            smallest = res_list[i]
    print (smallest)
l,n=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
 
sol=[]
for i in range(n-1):
  sol.append(a[i+1]-a[i])
sol.append(a[0]-a[n-1]+k)
sol.sort()
#unwanted segment of max length removed while printing
print(sum(sol[0:n-1]))

### FIXED CODE ###

k,n=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
 
sol=[]
for i in range(n-1):
  sol.append(a[i+1]-a[i])
sol.append(a[0]-a[n-1]+k)
 
sol.sort()
print(sum(sol[:n-1]))
a, b = map(int,input().split())
 
if 1<=a=<9 and 1<=b<=9:
    print(a*b)
else:
    print(-1)

### FIXED CODE ###

a, b = map(int,input().split())
if 1 <= a <= 9 and 1 <= b <= 9:
    print(a*b)
else:
    print(-1)
import sys
import math

n = int(input())
for s in range(n):
    pos = list(map(float, input().split()))
    angle1 = abs(pos[3]-pos[1])/abs(pos[2]-pos[0])
    angle2 = abs(pos[7]-pos[5])/abs(pos[6]-pos[4])
    if angle1 == angle2:
        print("YES")
    else:
        print("NO")

### FIXED CODE ###

N = input()
 
for n in range(N):
    data = map(float,raw_input().split( ))
    slopes = []
    for i in range(2):
        _x1 = data.pop(0)
        _y1 = data.pop(0)
        _x2 = data.pop(0)
        _y2 = data.pop(0)
         
        if _x1 != _x2:
            slopes.append((_y1 - _y2)/(_x1 - _x2))
     
    if len(slopes) == 0:
        print "YES"
    elif len(slopes) == 1:
        print "NO"
    elif abs(slopes[0] - slopes[1]) < 1e-10:
        print "YES"
    else:
        print "NO"
l = map(int, input().split())
l.sort()
print("Yes" if l == [5, 5, 7] else "No")

### FIXED CODE ###

l = input().split()
print("YES" if sorted(l) == ['5', '5', '7'] else "NO")
a,b,c = map(int,unput().split())

if b-a == c-b:
    print("YES")
else:
    print("NO") 
  



### FIXED CODE ###

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

if b-a == c-b:
    print("YES")
else:
    print("NO")
he = input()
lista = []
counter1, counter2 = 0,0

while True:
    inp = tuple(map(int,input().split()))
    if not inp:
        break
    counter1 += 1
    print(inp)
    if (inp[1]+inp[2]+inp[0]) % 2 == 0: 
        counter2 += 1
    else:
        break

if counter1 == counter2:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = int(input())
t_ = 0
xy_ = [0,0]
for _ in range(n):
    t, *xy = map(int, input().split())
    ta = t - t_
    xya = [abs(xy[0]-xy_[0]), abs(xy[1]-xy_[1])]
    if sum(xya) > ta or (ta - sum(xya))%2 != 0:
        print("No")
        break
    t_ = t
    xy_ = xy
else:
    print("Yes")
s = list(input())
flag =True
for i in range(len(s)):
  if s[i] == 'h':
    if s[i+1] == 'i':
      flag =True
    else:
      flag =False
  else if s[i] == 'i':
    if s[i+1] == 'h':
      flag =True
    else:
      flag =False
  else:
    flag =False
if flag:
  print('Yes')
else:
  print('No')
    
    

### FIXED CODE ###

s = input()
ans = False
if len(s) < 1 or len(s) >10:
    ans = False
if len(s) >= 1 or len(s) <= 10:
    if s == 'hi' or s == 'hihi' or s == 'hihihi' or s == 'hihihihi' or s == 'hihihihihi':
        ans =True
    else:
        ans =False
if ans:
    print ('Yes')
else:
    print('No')
N = int(input())
A = list(map(int, input().split(" ")))
abs_list = list(map(abs, A))
abs_list.sort()
pos = list(filter(lambda x: x > 0, A))
neg = list(filter(lambda x: x < 0, A))
pos.sort()
neg.sort()

# A has 0
if abs_list[0] == 0:
	print(sum(abs_list))
elif len(neg) % 2 == 0:
	print(sum(abs_list))
elif len(pos) > 0 and abs(pos[0]) < abs(neg[-1]):
	print(sum(abs_list) - 2*pos[0])
else:
	print(sum(abs_list[1:]-abs_list[0]))



### FIXED CODE ###

N = int(input())
A = list(map(int, input().split(" ")))
abs_list = list(map(abs, A))
abs_list.sort()
pos = list(filter(lambda x: x > 0, A))
neg = list(filter(lambda x: x < 0, A))
pos.sort()
neg.sort()

# A has 0
if abs_list[0] == 0:
	print(sum(abs_list))
elif len(neg) % 2 == 0:
	print(sum(abs_list))
elif len(pos) > 0 and abs(pos[0]) < abs(neg[-1]):
	print(sum(abs_list) - 2*pos[0])
else:
	print(sum(abs_list[1:])-abs_list[0])
x,y = map(int,input().split())

if x < y:
  print('<')
elif x > y:
  print('>')
else:
  print('=')

### FIXED CODE ###

x,y = input().split()

if x < y:
  print('<')
elif x > y:
  print('>')
else:
  print('=')
import math

N, M = [int(i) for i in input().split(" ")]
S = input()
T = input()

print(-1 if S[0] != T[0] else int(N * M / math.gcd(N, M)))

### FIXED CODE ###

import fractions
 
N, M = [int(i) for i in raw_input().split(" ")]
S = raw_input()
T = raw_input()
 
def solve():
    gcd = fractions.gcd(N, M)
    for i in range(1, gcd + 1):
        if S[-int(N / gcd) * i] != T[-int(M / gcd) * i]:
            return -1
    return int(N * M / gcd)
 
print(solve())
X = int(input())
dp = [False] * (X+100)
for i in range(6):
    dp[100+i] = True
for i in range(107, X+10):
    for k in range(6):
        dp[i] = dp[i] or dp[i-100-k]
print(1 if dp[X] else 0)


### FIXED CODE ###

X = int(input())
dp = [0] * (X+1000)
for i in range(6):
    dp[100+i] = 1
for i in range(X+10):
    for k in range(6):
        if i - 100 - k > 0:
            dp[i] = dp[i] | dp[i-100-k]
print(dp[X])
import math
A, B, H, M = map(int, input().split())
Longdegree = H * 30 + M * 0.5
Shortdegree =  M * 6
LSdegree = abs((Longdegree ** 2 - Shortdegree ** 2) / (Longdegree + Shortdegree))
if LSdegree >= 0 and  LSdegree < 180:
    print(math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(math.radians(LSdegree))))
elif  LSdegree >= 180 and  LSdegree <=360:
    LSdegree = LSdegree - 180
    print(math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(math.radians(LSdegree))))


### FIXED CODE ###

import math
A, B, H, M = map(int, input().split())
Longdegree = H * 30 + M * 0.5
Shortdegree =  M * 6
LSdegree = abs(Longdegree - Shortdegree)
print(math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(math.radians(LSdegree))))
N, A = map(int, input().split())
x= [int(i) for i in input().split()]
X = max(x)
dp = [[[0]*(X*N+1) for i in range(N+1)] for j in range(N+1)]
dp[0][0][0] = 1
ans = 0

for j in range(1,N+1):
  for k in range(j+1):
    for s in range(X*N+1):
      dp[j][k][s] = dp[j-1][k][s]
      if s >= x[j-1]:
        dp[j][k][s] += dp[j-1][k-1][s-x[j-1]]
      
for i in range(1,N+1):
  ans += dp[-1][i][i*A]
  if (i+1)*A >= X*N:
    break
print(ans)

### FIXED CODE ###

N, A = map(int, input().split())
x = [int(i) for i in input().split()]

table = [[[0]*(N*A+1) for i in range(N+1)] for j in range(N+1)]
table[0][0][0] = 1

for j in range(1,N+1):
  for k in range(N+1):
    for s in range(N*A+1):
      c = x[j-1]
      if s-c<0:
        table[j][k][s] = table[j-1][k][s]
      elif s-c>=0 and k>=1:
        table[j][k][s] = table[j-1][k][s] + table[j-1][k-1][s-c]
      
ans = 0
for i in range(1,N+1):
  ans += table[N][i][i*A]
print(ans)
import numpy as np

if __name__=="__main__":
    inputs_number  = lambda : [int(x) for x in input().split()]
    N, Ma, Mb = inputs_number()
    drugs = [inputs_number() for i in range(N)]
    inf = 100*N + 1
    dp = np.ones((N+1,N*10+1,N*10+1)) * inf
    dp[0,0,0] = 0.0

    for i in range(N):
	for ca in range(N*10+1):
            for cb in range(N*10+1):
		if(dp[i,ca,cb]==inf):
                    continue
                dp[i+1,ca,cb]=np.min([dp[i+1,ca,cb],dp[i,ca,cb]])
                dp[i+1,ca+drugs[i][0],cb+drugs[i][1]]=np.min([dp[i+1,ca+drugs[i][0],cb+drugs[i][1]],dp[i,ca,cb]+drugs[i][2]])

### FIXED CODE ###

import numpy as np
import copy

if __name__=="__main__":
    inputs_number  = lambda : [int(x) for x in input().split()]
    N, Ma, Mb = inputs_number()
    drugs = [inputs_number() for i in range(N)]
    inf = 100*N + 1
    dp = np.ones((2,N*10+1,N*10+1)).astype(np.int32) * inf
    dp = dp.tolist()
    dp[0][0][0] = 0.0

    for i in range(N):
        for ca in range(10*i+1):
            for cb in range(10*i+1):
                if(dp[0][ca][cb]==inf):
                    continue
                dp[1][ca][cb]=min([dp[1][ca][cb], dp[0][ca][cb]])
                dp[1][ca+drugs[i][0]][cb+drugs[i][1]]=min([dp[1][ca+drugs[i][0]][cb+drugs[i][1]], dp[0][ca][cb]+drugs[i][2]])
        dp[0] = copy.copy(dp[1])
        dp[1] = (np.ones((N*10+1,N*10+1)).astype(np.int32) * inf).tolist()
    ans = inf
    for ca in range(1, N*10+1):
        for cb in range(1, N*10+1):
            if(Ma*cb==Mb*ca and dp[0][ca][cb]<ans):
                ans = dp[0][ca][cb]
    if(ans==inf):
        ans = -1
    print(int(ans))
n=int(input())
l=list(map(int,input().split()))
l1=[0 for i in range(n)]
l1[0]=l[0]
l1[1]=l[1]
for i in range(1,n-2):
  if l[i]>l[i+1]:
    l1[i]=l[i+1]
  l1[i+1]=l[i+1]
sum=0
for i in l1:
  sum+=i
print(sum)

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
l1=[0 for i in range(n)]
l1[0]=l[0]
l1[1]=l[0]
for i in range(0,n-2):
  if l[i]>l[i+1]:
    l1[i+1]=l[i+1]
  l1[i+2]=l[i+1]
sum=0
for i in l1:
  sum+=i
print(sum)
n,m = map(int,input().split())
al = list(map(int,input().split()))

#a,bの最大公約数
def gcd(a, b):
   while b:
       a, b = b, a % b
   return a

#a,bの最小公倍数
def lcm(a, b):
   return a * b // gcd (a, b)


bl = [i//2 for i in al]

ans = 1
for b in bl:
   ans = lcm(ans, b)

for a in al:
   if ans // a == ans / a:
      print(0)
      import sys
      sys.exit()

def ceil(a, b):
   return a // b + (a % b > 0)

print(ceil(m // ans, 2))

### FIXED CODE ###

import sys #追加
sys.setrecursionlimit(10**9)
import time
s = time.time()

n,m = map(int,input().split())
al = list(map(int,input().split()))

bl = [i//2 for i in al]
from fractions import gcd
ans = 1
for b in bl:
   if time.time() - s > 1.9:
      print(0)
      import sys
      sys.exit()
   ans = (ans * b) // gcd(ans, b)

for a in al:
   if time.time() - s > 1.9:
      print(0)
      import sys
      sys.exit()
   if ans % a == 0:
      print(0)
      import sys
      sys.exit()

def ceil(a, b):
   return a // b + (a % b > 0)

print(ceil(m // ans, 2))
a,b,k = map(int,input().split())
c=1
d=0
while d<k:
  if a%c==0 and b%c==0:
	d+=1
  else:
	c+=1
print(c)

### FIXED CODE ###

temp = []
a,b,k = map(int,input().split())
for i in range (1, min(a,b)+1):
  if a%i==0 and b%i==0:
    temp.append(i)
print(temp[-k])
a, b = [int(i) for i in input().split()]

d = a // b
r = a % b
f = a / b

print("{0} {1} {2:.5f}".format(d.r.f))

### FIXED CODE ###

a, b = [int(i) for i in input().split()]

d = a // b
r = a % b
f = a / b

print("{0} {1} {2:.5f}".format(d, r, f))
N = int(input())
A = list(map(int, input().split()))

def func(b):
    return sum([abs(val - b) for val in I])

#y seppen wo motomeru
import statistics
import math

I=[A[i]-i-1 for i in range(N)]

m=min(I)
M=max(I)

if N % 2 ==1:
    print(func(statistics.median(I)))
else:
    print(func(math.floor(statistics.median(I))))

'''
    for i in range(m, M+1):
        #print(i)
        temp=sum([abs(val-i) for val in I])
        if temp<opp:
            opp=temp
    print(opp)
'''

### FIXED CODE ###

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

def func(b):
    return sum([abs(val - b) for val in I])

#y seppen wo motomeru

I=[A[i]-i-1 for i in range(N)]
I.sort()

if N % 2 ==1:
    print(func(I[N//2]))
else:
    print(func(I[N//2]))
A, B = input().split()
print(int(A) * int(B[0] + B[1] + B[2] + B[3]) // 100)

### FIXED CODE ###

A, B = input().split()
print(int(A) * int(B[0] + B[2] + B[3]) // 100)
a = int(raw_input())
b = int(raw_input())
c = int(raw_input())
x = int(raw_input())

def dfs(x, i, m, v):
  	if x < 0: return 0
  	if x == 0 or i == 3: 
  		return 1 if x == 0 else 0   	
  	r = 0
  	for k in range(0, m[i] + 1): r += dfs(x - k * v[i], i + 1, m, v)
  	return r
m,v = {0:a,1:b,2:c}, {0:500,1:100,2:50}
print dfs(x,0,m,v)


### FIXED CODE ###

n,mat = raw_input(),[ map(int,raw_input().split()) for i in range(2)]
def f(mat,i,j):
	if i<0 or j <0:
		return -float('inf')
	if i == 0 and j == 0:
		return mat[i][j] 
	return mat[i][j] + max(f(mat,i-1,j),f(mat,i,j-1))
print f(mat,1,len(mat[0])-1)
a,b  = ma()
x = lma()
ans = 10 **18
for i in range(a-b+1):
    a0 = x[i]
    ab = x[i+b-1]
    if ab< 0 :
        ans = min(ans,ab)
    elif a0 <=0 and 0 <= ab:
        ans = min(ans, ab-2*a0, 2*ab-a0)
    else:
        ans = min(ans,ab)
print(ans)

### FIXED CODE ###

def a():return input()#s
def ai():return int(input())#a,n or k
def ma():return map(int, input().split())#a,b,c,d or n,k
def ms():return map(str, input().split())#,a,b,c,d
def lma():return list(map(int, input().split()))#x or y
def lms():return list(map(str, input().split()))#x or y
a,b  = ma()
x = lma()
ans = 10 **18
for i in range(a-b+1):
    a0 = x[i]
    ab = x[i+b-1]
    if ab< 0 :
        ans = min(ans,abs(a0))
    elif a0 <=0 and 0 <= ab:
        ans = min(ans, ab-2*a0, 2*ab-a0)
    else:
        ans = min(ans,ab)
print(ans)
import sys
import math

N, M = map(int, input().split())
a = list(map(lambda x: int(x) >> 1, input().split()))

alcm = 1
for i in range(N):
	alcm = alcm * a[i] // math.gcd(alcm, a[i])

print(math.ceil((M // alcm) / 2))

### FIXED CODE ###

import sys
import math
import fractions

N, M = map(int, input().split())
a = list(map(lambda x: int(x) >> 1, input().split()))
set(a)

fdigit = 0
while True:
	c = 1 << fdigit
	if a[0] & c != 0:
		break
	fdigit += 1

alcm = 1
for i in range(N):
	digit = 0
	while True:
		c = 1 << digit
		if a[i] & c != 0:
			break
		digit += 1
	if digit != fdigit:
		print(0)
		sys.exit(0)

	alcm = (alcm * a[i]) // fractions.gcd(alcm, a[i])

print(math.ceil((M // alcm) / 2))
a,b,c = map(int(input().split()))
if 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=int(input())
n=n%26
s=input()
out=""
for i in s:
  no=ord(i)+n
  if no>ord("Z"):
    no=no-ord("Z")+ord("A")-1
  out+=ord(no)
print(out)
  

### FIXED CODE ###

n=int(input())
s=input()
c=""
w=0
for i in s:
  w=ord(i)+n
  if w>ord("Z"):
    w=w-ord("Z")-1+ord("A")
  c+=chr(w)
  #print(chr(w))
print(c)
def op_print(data,a,b):
    print(data[a:b])
def op_reverse(data,a,b):
    return data[:a] + data[::-1][-b:-a] + data[:b]
def op_replace(data,a,b,q):
    return data.replace(data[a:b],q) 

data = input()
q = int(input())
for _ in range(q):
    op = list(map(str,input().split()))
    op[2]+=1
    if(op[0] == "print"):
        op_print(data,int(op[1]),int(op[2]))
    elif(op[0] == "reverse"):
        data = op_reverse(data,int(op[1]),int(op[2]))
    elif(op[0] == "replace"):
        data = op_replace(data,int(op[1]),int(op[2]),op[3])


### FIXED CODE ###

s=input()
for _ in range(int(input())):
    o=input().split()
    a,b=map(int,o[1:3]);b+=1
    c=o[0][2]
    if c=='p':s=s[:a]+o[3]+s[b:]
    elif c=='i':print(s[a:b])
    elif c=='v':s=s[:a]+s[a:b][::-1]+s[b:]
# -*- coding: utf-8 -*-

import math

N, K = map(int, input().split())
A = np.array(list(map(int, input().split())), dtype=np.int)

print(math.ceil(N-1//K-1))

### FIXED CODE ###

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

import math

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

print(math.ceil((N-1)/(K-1)))
list = list(map(int,input().split()))

if list == [5,5,7]:
    print(YES)
elif list == [5,7,5]:
    print(YES)
elif list == [7,5,7]:
    print(YES)
else:
    print(NO)

### FIXED CODE ###

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

if list == [5,5,7]:
    print("YES")
elif list == [5,7,5]:
    print("YES")
elif list == [7,5,5]:
    print("YES")
else:
    print("NO")
a,b,c,d=[int(s) for s in input().split()]
print(min([a+c,a+d,b+c,c+d]))

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(min([a+c,a+d,b+c,b+d]))
import math

inp = input().split()
n = inp[0]
k = inp[1]
proba = 0

for i in range(1, k):
  n_coin = int(math.log(k/i,2)) + 1
  print(i, n_coin)
  proba += float(1)/n*((0.5)**n_coin)

if n >= k:
	proba += float(n-k+1)/n

### FIXED CODE ###

N, K = list(map(int, input().split()))
 
ans = 0
for i in range(1, N+1):
    p = 1
    x = i
    while x < K:
        p *= 0.5
        x *= 2
    
    ans += p/N
 
print(ans)
import sys
def input():
    return sys.stdin.readline()[:-1]

N, K, Q = map(int, input().split())

points = [K for _ in range(N)]

for q in range(Q):
    A = int(input()) - 1
    points = [p if i == A else p-1 for i, p in enumerate(points)]
for p in points:
    if p < 1:
        print('No')
    else:
        print('Yes')


### FIXED CODE ###

S = input()

weather = ['Sunny', 'Cloudy', 'Rainy']

if S == weather[0]:
    print(weather[1])
elif S == weather[1]:
    print(weather[2])
elif S == weather[2]:
    print(weather[0])
N = input(int())
ans = 1
i = []
a = int()
 
list = [i for i in input().split()]
 
for a in range(N-1):
  ans = ans * i[a]
 
if ans > 10**18:
    ans = "-1"
 
print(str(ans))

### FIXED CODE ###

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

ans = 1

if 0 in a:
    print("0")
    exit()

for i in a:
    ans *= i

    if ans > 10**18:
        print("-1")
        exit()
        
print(ans)
s = input()
t = input()
ans = 1001
if len(s)-len(t)==0:
    temp = 0
    for j in range(len(t)):
        if s[i+j]!=t[j]:
            temp+=1
    ans = min(ans, temp)
else:
    for i in range(len(s)-len(t)):
        temp = 0
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                temp+=1
        ans = min(ans, temp)
print(ans)

### FIXED CODE ###

s = input()
t = input()
ans = 1001
if len(s)-len(t)==0:
    temp = 0
    for j in range(len(t)):
        if s[j]!=t[j]:
            temp+=1
    ans = min(ans, temp)
else:
    for i in range(len(s)-len(t)):
        temp = 0
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                temp+=1
        ans = min(ans, temp)
print(ans)
N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M

while v[0]:
  if v.pop(0) >= v_min:
    m += 1
  else:
    break

if M <= m:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N,M = map(int,input().split())
m = 0
v = input().split()
for i in range(N): v[i] = int(v[i])
  
v.sort(reverse=True)
v_min = sum(v)/4/M

while len(v):
  if v.pop(0) >= v_min:
    m += 1
  else:
    break

if M <= m:
  print("Yes")
else:
  print("No")
print(int(input()+1//2)

### FIXED CODE ###

print((int(input())+1)//2)
def solve():
  X = int(input())

  for i in range(abs(X)):
    ii = i**5
    b = (X - ii)**(0.5**5)
    bb = b **5
    # print("A   " + str(i) +"   "+  str(i ** 5))
    # print("B   " + str(b) +"   "+str(b**5))
    # print(i+b)
    if bb.is_integer():
      if ii - bb== X:
        return str(i) +" " + str(bb)
      else:
        return str(i) +' ' + str(int(-1*bb))


def main():
  print(solve())

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
X = int(input())
for i in range(-120,120):
  for j in range(-120,120):
    if i**5 - j **5 == X:
      print(str(i)+" "+str(j))
      sys.exit()
N = int(input())
K = int(input())
 
ans = int(N-K+1)
 
print(ans)

### FIXED CODE ###

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

ans = int(N-K+1)

print(ans)
#include <iostream>
using namespace std;
int main(void){
   int H,W;
   int i,j;
   while(1){
    cin >> H;
    cin >> W;
    i=0;
    j=0;
    for(i=0;i<H;i++){
        for(j=0;j<W;j++){
            cout << '#';
            }
        cout << endl;
       }
       cout << endl;
       if(H==0&&W==0)
       break;
    }
   return 0;
}



### FIXED CODE ###

lines = []
colums = []

while True:
  H,W = map(int,input().split())
  if H == 0 and W == 0:
    break
  lines.append(H)
  colums.append(W)

for H,W in zip(lines,colums):
  for i in range(H):
    for j in range(W):
      print("#",end="")
    print("\n",end="")
  print("\n",end="")
sss = input()
s1 = int(sss[0])
s2 = int(sss[1])
s3 = int(sss[2])
print(%d, s1+s2+s3)

### FIXED CODE ###

sss = input()
s1 = int(sss[0])
s2 = int(sss[1])
s3 = int(sss[2])
print(s1+s2+s3)
a,b,k = map(int ,input().split())
if a>=k:
    a=a-k
elif a<k:
    i=abs(a-k)
    a=0
b=max(0,(b-i))
print(a,b)

### FIXED CODE ###

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


i=a-k
if i<=0:
    j=b+i
    if j<=0:
        j=0
    i=0
    print(i,j)
else:
    print(i,b)
n = int(input())

L = list(int,input().split())

mountain = int(1)
for i in range(1,n):
    for j in range(i):
            if int(L[j]) >= int(L[i]):
          			break
            else:
                    mountain += 1
                
print(mountain)


### FIXED CODE ###

n = int(input())

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

mountain = int(1)
for i in range(1, n):
    for j in range(i):
        if int(L[j]) > int(L[i]):
            break
        if int(L[j]) <= int(L[i]) and j == i-1:
            mountain += 1
            break
        if int(L[j]) <= int(L[i]):
            continue

print(mountain)
a,b=map(int,input().split)
print(a%b)

### FIXED CODE ###

a,b=map(int,input().split())
if a%b==0:print(0)
else:print(1)