Harryxun/stf_run huggingface dataset:
S = input()
T = input()

cnt = 0
for i in range(len(S)-len(T)+1):
	if S[i] == T[0]:
		for j in 1 <= j <= len(T)+1:
			if S[i+j] != T[j]:
				cnt += 1

print(cnt)

			

### FIXED CODE ###

S = input()
T = input()
  
cnt = []
for i in range(len(S)-len(T)+1):
	mismatch = 0
	for j in range(len(T)):
		if S[i+j] != T[j]:
			mismatch += 1
	cnt.append(mismatch)
	
print(min(cnt))
Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(Number.sum())
else:
    print(Number[1]*2 -1)

### FIXED CODE ###

Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(sum(Number))
else:
    print(Number[1]*2 -1)
from sys import stdin

N, x = [int(x) for x in stdin.readline().rstrip().split()]
candys = [int(x) for x in stdin.readline().rstrip().split()]

count = 0

# xより多く入っている箱のキャンディは必ず食べる必要がある。
for i in range(N):
    if candys[i] > x:
        num = candys[i] - x
        candys[i] = x
        count += num
        print(candys)

print('count = ', count)
print('---------------------------')

# 隣り合った箱を見て、xを越えていれば食べる
for i in range(N-1):
    if candys[i] + candys[i+1] > x:
        num = candys[i] + candys[i+1] - x
        count += num
        candys[i+1] = candys[i+1] - num
        print(candys)
# 結果
print(count)


### FIXED CODE ###

from sys import stdin

N, x = [int(x) for x in stdin.readline().rstrip().split()]
candys = [int(x) for x in stdin.readline().rstrip().split()]

count = 0

# xより多く入っている箱のキャンディは必ず食べる必要がある。
for i in range(N):
    if candys[i] > x:
        num = candys[i] - x
        candys[i] = x
        count += num
        # print(candys)

# print('count = ', count)
# print('---------------------------')

# 隣り合った箱を見て、xを越えていれば食べる
for i in range(N-1):
    if candys[i] + candys[i+1] > x:
        num = candys[i] + candys[i+1] - x
        count += num
        candys[i+1] = candys[i+1] - num
        # print(candys)
# 結果
print(count)
s = list(input())
ans = 0

for c in s:
    ans += int(c)
print(ans)

if ans == 7:
    print(s[0]+"+"+s[1]+"+"+s[2]+"+"+s[3]+"=7")

else:
    x = str((ans-7)//2)
    a = s.index(x)
    
    for i in range(4):
        print(s[i], end="")
        if i == 3:
            print("=7")
        if i == a-1:
            print("-", end="")
            a = 100
        else:
            print("+", end="")

### FIXED CODE ###

import copy
import numpy as np

s = input()
n = 3
ans = 0

for i in range(1,3 ** n):
    x = copy.deepcopy(s)
    y = str(np.base_repr(i,3)).rjust(3,'0') #3進数に変換
    if (y[0] == "0" and s[0] == "0") or (y[1] == "0" and s[1] == "0") or (y[2] == "0" and s[2] == "0"):
        continue
    z = 1
    for j in range(3):
        if y[j] == "1": #フラグが立っていたら
            x = x[:j+z] + "+" + x[j+z:]
            z += 1
        if y[j] == "2": #フラグが立っていたら
            x = x[:j+z] + "-" + x[j+z:]
            z += 1
    if eval(x) == 7:
        print(x +"=7")
        exit()
import math
import sys

def prime_calc(n):
    rootN = math.floor(math.sqrt(n))
    prime = [2]
    data = [i + 1 for i in range(2,n,2)]
    while True:
        p = data[0]
        if rootN < p:
            return len(prime + data)
        prime.append(p)
        data = [e for e in data if e % p != 0]

def main():
    l = []

    for line in sys.stdin:
        l.append(line)        

    for line in l:
        print(prime_calc(line))

if __name__ == "__main__":
    main()


### FIXED CODE ###

import math
import sys

sup = 1000000

is_prime = [0] * sup

count = [0] * sup

def setup():
    is_prime[2] = 1
    for n in range(3,sup,2):
        flag = True
        for i in range(3, int(math.floor(math.sqrt(n) + 1)), 2):
            if n % i == 0:
                flag = False
                break
        if flag:
            is_prime[n] = 1

def precount():
    for n in range(2, sup):
        count[n] = count[n-1] + is_prime[n]

def main():
    setup()
    precount()

    l = []

    for line in sys.stdin:
        l.append(int(line))

    for line in l:
         print(count[line])

if __name__ == "__main__":
    main()
N =int(input())
k = 0
for i in range(1, N+1):
    if 1 =< i <10:
        k += 1
    if 100 =< i <1000:
        k += 1
    if 10000 =< i <100000:
        k += 1
print(k)

### FIXED CODE ###

N = int(input())
k = 0
for i in range(1, N+1):
    if 1 <= i <= 9:
        k += 1
    elif 100 <= i <= 999:
        k += 1
    elif 10000 <= i <= 99999:
        k += 1
print(k)
from math import gcd

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


def cnt_div(a, b, x):
    q, r = divmod(a, x)

    if r == 0:
        m = q - 1
    else:
        m = q

    n = b // x

    return n - m


num_c = cnt_div(a, b, c)
num_d = cnt_div(a, b, d)
lcm = int((c * d) / gcd(c, d))
num_c_d_gcd = cnt_div(a, b, lcm)

print((b - a + 1) - (num_c + num_d - num_c_d_gcd))


### FIXED CODE ###

from fractions import gcd

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


def cnt_div(a, b, x):
    q, r = divmod(a, x)

    if r == 0:
        m = q - 1
    else:
        m = q

    n = b // x

    return n - m


num_c = cnt_div(a, b, c)
num_d = cnt_div(a, b, d)
lcm = int((c * d) / gcd(c, d))
num_c_d_gcd = cnt_div(a, b, lcm)

print((b - a + 1) - (num_c + num_d - num_c_d_gcd))
b = input()
for i in b:
  if b[i] == "A":
    b[i] = "T"
  else if b[i] == "T":
    b[i] = "A"
  else if b[i] == "C":
    b[i] = "G"
  else if b[i] == "G":
    b[i] = "C"
print(b)

### FIXED CODE ###

b = input()
if b == "A":
  b = "T"
elif b == "T":
  b = "A"
elif b == "C":
  b = "G"
elif b == "G":
  b = "C"
print(b)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

n,k = map(int,readline().split())
mod = 10**9+7
g = [[] * n for i in range(n)]
for i in range(n-1):
    u, v = map(int,readline().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)

ans = 1
used = [False]*n
def dfs(now,prev,p):
    global ans
    if k <= p:
      return 0
    ans *= k-p
    ans %= mod
    used[now] == True
    if all(used):
      return ans
    cnt = 1
    new = []
    for next in g[now]:
      if next == prev:
        cnt += 1
      else:
        new.append(next)
    for i,next in enumerate(new):
      dfs(next,now,cnt+i)
      
dfs(0,-1,0)
print(ans)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
mod = 10**9+7
sys.setrecursionlimit(4100000)
n,k = map(int,readline().split())
if n == 1:
  print(k%mod)
  exit()

g = [[] * n for i in range(n)]
for i in range(n-1):
    u, v = map(int,readline().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)

ans = 1
used = [False]*n
def dfs(now,prev,p):
    global ans
    if k <= p:
      ans = 0
    ans *= k-p
    ans %= mod
    used[now] == True
    if all(used):
      return ans
    cnt = 1
    new = []
    for next in g[now]:
      if next == prev:
        cnt += 1
      else:
        new.append(next)
    for i,next in enumerate(new):
      dfs(next,now,cnt+i)
      
dfs(0,-1,0)
print(ans)
import collections
W,H,x,y = map(int,input().split())
tmp = []

if W==x*2:
    print(x*H,1)
elif H==y*2:
    print(W*y,1)
else:
    tmp.append(min(H*x,H*(W-x)))
    tmp.append(min(W*y,W*(H-y)))

tmp_cnt = collections.Counter(tmp)
tmp_sort = sorted(tmp_cnt.items(),reverse=True)
#print(tmp_sort)
if tmp_sort[0][1]==1:
    print(tmp_sort[0][0],0)
else:
    print(tmp_sort[0][0],1)


### FIXED CODE ###

import collections
W,H,x,y = map(int,input().split())

if 2 * x == W and 2 * y == H:
    tmp = 1
else:
    tmp = 0
print(W*H/2,tmp)
a, b, c = [int(x) for x in input().split()]

def foo(a, b, c):
    for i in range(1, b+1):
        if (a*i)%b == c:
            return "YES"
    return "NO"
    
print(foo(a, b, c))

### FIXED CODE ###

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

if a[-1] == b[0] and b[-1] == c[0]:
    print("YES")
else:
    print("NO")
n,m=map(int,input().split())
s=""
for i in range(m):
    a,b=input().split()
    s=s+a+b
for k in range(n)
    print(s.count(str(k+1)))

### FIXED CODE ###

n,m=map(int,input().split())
x=[0]*n
for i in range(m):
    a,b=map(int,input().split())
    x[a-1]+=1
    x[b-1]+=1
for k in range(n):
    print(x[k])
y,m,d=map(int,input().split(/))
if y<=2018 :
    print(Heisei)
else:
    if m<=4 :
        print(Heisei)
    else:
        print(TBD)        


### FIXED CODE ###

y,m,d=map(int,input().split("/"))
if y<=2018 :
    print("Heisei")
elif y==2019 :
    if m<=4 :
        print("Heisei")
    else:
        print("TBD")
else :
    print("TBD")
N,T = map(int,input().split())
l = [list(map(int,input().split())) for i in range(N)]
##print(l)
a = []
for i in range(N):
  if l[i][1] < T:
    a.append(l[i][0])
t = min(a)
print(t)

### FIXED CODE ###

N,T = map(int,input().split())
l = [list(map(int,input().split())) for i in range(N)]
##print(l)
a = []
for i in range(N):
  if l[i][1] <= T:
    a.append(l[i][0])
if a != []:
  t = min(a) 
  print(t)
else:
  print("TLE")
S, T = map(int,input().split())
print('{}{}'.format(T,S))

### FIXED CODE ###

S, T = map(str, input().split())
print('{}{}'.format(T, S))
a=input()
b=split(a)
d=list()
for c in b:
    d.append(int(c))
print(d[0]*d[1],2*d[0]+2*d[1])


### FIXED CODE ###

a=input()
b=a.split()
d=list()
for c in b:
    d.append(int(c))
print(d[0]*d[1],2*d[0]+2*d[1])
s = input()
print(700 + 100 * s.count())
         

### FIXED CODE ###

s = input()
print(700 + 100 * s.count('o'))
for i in range(10000)
  line = int(input())
  if line == 0:
    break
  print('Case {}: {}'.format(i+1, line))

### FIXED CODE ###

for i in range(10000):
  line = int(input())
  if line == 0:
    break
  print('Case {}: {}'.format(i+1, line))
import fractions
import itertools
n = int(input())
x = list(map(int,input().split()))
p = list(itertools.combinations(x,2))
ar = []
for n in range(0,len(p)):
	ar.append(fractions.gcd(p[n][0],p[n][1]))
print(max(ar))

### FIXED CODE ###

n = list(map(int,input().split()))
print(int((n[2]+0.5)/n[0])*n[1])
input()
def f(a):
  a = int(a)
  r = 0
  while a % 2 == 0:
    a /= 2
    r += 1
  return r
print(sum(map(f,input.split())))

### FIXED CODE ###

input()
def f(a):
  a = int(a)
  r = 0
  while a % 2 == 0:
    a /= 2
    r += 1
  return r
print(sum(map(f, input().split())))
A=int(input())
B=int(input())
T=int(input())
reward=0
time=0

for t in range(T):
    time += 1
    if time%A == 0:
        reward = reward + B
        
print(reward)

### FIXED CODE ###

A, B, T = map(int, input().split())
reward=0
time=0

for t in range(T):
    time += 1
    if time%A == 0:
        reward = reward + B
        
print(reward)
lis = [int(input()) for _ in range(6)]
if lis[0] % min(lis[1:]) == 0:
  print(5)
else:
  print(lis[0]//min(lis[1:])+5)

### FIXED CODE ###

From0 = ['0','1']*(10**6)
From1 = ['1','0']*(10**6)
s = list(input())
F0 = From0[:len(s)]
F1 = From1[:len(s)]
count_0 = 0
count_1 = 0
for i in range(len(s)):
  if s[i] != F0[i]:
    count_0 += 1
for i in range(len(s)):
  if s[i] != F1[i]:
    count_1 += 1
print(min(count_0,count_1))
X,Y = map(int,input().split())
mod = 10**9+7
if (2*X-Y) % 3 != 0 or (2*Y-X) % 3 != 0:
    print(0)
    exit(0)
x,y = (2*Y-X)//3,(2*X-Y)//3
N = x+y
K = x
def pow(x, n, mod):
    ret = 1
    while n>0:
        if (n&1):
            ret = (ret*x) % mod
        x = (x*x) % mod
        n >>= 1
    return ret
fact = [None]*(N+1)
fact[0] = 1
for i in range(1, N+1):
    fact[i] = (fact[i-1]*i) % mod
finv = [None]*(N+1)
finv[-1] = pow(fact[-1], mod-2, mod)
for i in range(N, 0, -1):
    finv[i-1] = (finv[i]*i) %mod
def comb(n, k):
    return (fact[n]*finv[n-k]*finv[k]) % mod
print(comb(N,K))

### FIXED CODE ###

X,Y = map(int,input().split())
mod = 10**9+7
if (2*X-Y) % 3 != 0 or (2*Y-X) % 3 != 0:
    print(0)
    exit(0)
x,y = (2*Y-X)//3,(2*X-Y)//3
if x < 0 or y < 0:
    print(0)
    exit(0)
N = x+y
K = min(x,y)
def pow(x, n, mod):
    ret = 1
    while n>0:
        if (n&1):
            ret = (ret*x) % mod
        x = (x*x) % mod
        n >>= 1
    return ret
fact = [0]*(N+1)
fact[0] = 1
for i in range(1, N+1):
    fact[i] = (fact[i-1]*i) % mod
finv = [0]*(N+1)
finv[N] = pow(fact[N], mod-2, mod)
for i in range(N, 0, -1):
    finv[i-1] = (finv[i]*i) %mod
print((fact[x+y]*finv[x]*finv[y]) % mod)
N = int(input())
A = list(map(int, input().split()))

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

A.sort()
print(A)
if N % 2 == 0:
    median = A[N//2]
else:
    median = A[(N + 1)//2]

for i in range(N):
    A[i] -= median
print(sum(A))

### FIXED CODE ###

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

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

A.sort()
median = A[N//2]

for i in range(N):
    A[i] -= median
    A[i] = abs(A[i])
print(sum(A))
import math

N,M = map(int,input().split())
A = [0]*N
A = list(map(int,input().split()))
if (N == 1):
    print(A[0]//(2**M))
else:
    while (M != 0):
        A.sort(reverse=True)
        y = min(math.floor(math.log2(A[0]/A[1])+1),M)
        A[0] //= 2**y
        M -= y

    print(sum(A))


### FIXED CODE ###

import math
import heapq

N,M = map(int,input().split())
A = [0]*N
A = list(map(lambda x: int(x)*(-1),input().split()))
if (N == 1):
    print((-1 * A[0])//(2**M))
else:
    """
    while (M != 0):
        A.sort(reverse=True)
        y = min(math.floor(log2(A[0]/A[1])+1),M)
        A[0] //= 2**y
        M -= y
    """
    """
    A.sort(reverse=True)
    for i in range(N):
        y = min(A[i] // 2,M)
        A[i] //= 2**y
        M -= y
        if (M <= 0):
            break
    """
    heapq.heapify(A)

    for i in range(M):
        m = heapq.heappop(A) * -1
        heapq.heappush(A,(m//2 * -1))

    print(-sum(A))
x,a,b = map(int, input().split())
print(int((x-a)/b))

### FIXED CODE ###

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

def get(n):
    if n%4 == 0:
        return x
    elif n%4 == 1:
        return 1
    elif n%4 == 2:
        return x+1
    else:
        return 0

print(get(b)^get(a-1))


### FIXED CODE ###

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

def count_bin(n, d):
    if n < 0:
        return 0
    div = (n+1)//2**(d+1)
    res = div*(2**d)
    remain = (n+1) - div*(2**(d+1))
    res += remain - 2**d if remain > 2**d else 0
    return res

ans = 0
for d in range(50):
    n_bin = count_bin(b, d) - count_bin(a-1, d)
    if n_bin%2 > 0:
        ans += 2**d
print(ans)
from collections import Counter

N = int(input())
c = Counter(list(map(int, input())))
ans = 0
for k in c:
  ans += d[k] - k if k <= d[k] else d[k]

print(ans)

### FIXED CODE ###

from collections import Counter

N = int(input())
c = Counter(list(map(int, input().split())))
ans = 0
for k in c:
  ans += c[k] - k if k <= c[k] else c[k]

print(ans)
_ = input()
S = input().lstrip('.').rstrip('#')
n = len(S)

x = 0
y = S.count('.')
c = min(n-y, y)
for i in range(n):
  t = S[i]=='#':
  x += t
  y -= ~t
  c = min(c, x+y)
print(c)

### FIXED CODE ###

_ = input()
S = input().lstrip('.').rstrip('#')
n = len(S)
A = list(S)

x = 0
y = S.count('.')
ans = min(n-y, y)
for i in range(n):
  if S[i] == '#':
    x += 1
  else:
    y -= 1
  ans = min(ans, x + y)
print(ans)
value = input()
answer = value**3
print("answer")

### FIXED CODE ###

value = int(input())
print(value ** 3)
a, b = map(int, input().split())
print("GREATER" if a > b else "LESS" if a < b else "EQUAL")


### FIXED CODE ###

a, b = [int(input()) for _ in range(2)]
print("GREATER" if a > b else "LESS" if a < b else "EQUAL")
n = int(input())
L = []
L.append(2)
L.append(1)

for i in range(2,84):
  L.append(L[i-2] + L[i-1])
  

print(L[n-1])

### FIXED CODE ###

n = int(input())
L = []
L.append(2)
L.append(1)

for i in range(2,87):
  L.append(L[i-2] + L[i-1])
  

print(L[n])
n, m = map(int, input().split())
l = [[] for i in range(n)]
for i in range(m + 1):
  a, b = map(int, input().split())
  l[a].append(b)
  l[b].append(a)
ans = [-1] * (n+1)
ans[0] = 0
x = [1]
y = []
count = 1
while x != []:
  for i in x:
    for j in l[i]:
      if ans[j] == -1:
        ans[j] = i
        y.append(j)
        count += 1
  x = y
  y = []
print('Yes')
for i in range(2, n+1):
    print(ans[i])


### FIXED CODE ###

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

#グラフをリストにする
#リストの第i番目の集合は、頂点iが繋がっている頂点の集合である
l = [[] for _ in range(n+1)]
for _ in range(m):
  a, b = map(int, input().split())
  l[a].append(b)
  l[b].append(a)
  
#解（道しるべとなる点）を保存するリストを作る
ans = [-1] * (n+1)
ans[1] = 0

#解（道しるべとなる点）を書き込んでいく
#深さdの点の集合をxに、d＋１の集合をyとする
#yの要素は、l[i]と一致する
x = [1]
y = []
while x != []:
  for i in x:
    for j in l[i]:
      if ans[j] == -1:
        ans[j] = i
        y.append(j)
  x = y
  y = []
print('Yes')
for i in range(2, n+1):
  print(ans[i])
N, M, Q=map(int, input().split())
abcd=[list(map(int, input().split())) for _ in range(Q)]

def f(nums):
  out=0
  for samp in abcd:
    if nums[samp[1]-1]-nums[samp[0]-1]==samp[2]:
      out+=samp[3]
  return out

def g(nums):
  if nums[-1]<M-1:
    nums[-1]+=1
    return nums, False
  
  i=N-1
  while i>=0 and nums[i]==M-1:
    i-=1
  if i<0:
    return None, True
  
  nums=nums[:i]+[nums[i]+1]*(M-i)
  return nums, False

nums=[0]*N
fi=False
ans=0

while fi==False:
  p=f(nums)
  if ans<p:
    ans=p
  nums, fi=g(nums)
  
print(ans)


  

### FIXED CODE ###

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

def f(nums):
  out=0
  for samp in abcd:
    if nums[samp[1]-1]-nums[samp[0]-1]==samp[2]:
      out+=samp[3]
  return out

def g(nums):
  if nums[-1]<M:
    nums[-1]+=1
    return nums, False
  
  i=N-1
  while i>=0 and nums[i]==M:
    i-=1
  if i<0:
    return None, True
  
  nums=nums[:i]+[nums[i]+1 for _ in range(N-i)]
  return nums, False

nums=[1]*N
fi=False
ans=0

while fi==False:
  p=f(nums)
  if ans<p:
    ans=p
  nums, fi=g(nums)
  
print(ans)
shio = string(raw_input())
counter = 0
for i in 2
	if shio[i] = "1":
    	counter+=1
print(counter)
  

### FIXED CODE ###

shio = str(raw_input())
counter = 0
i=0
while i < 3:
  if shio[i] == "1":
    counter +=1
  i +=1
print(counter)
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
nizi = [0] * (10**5)
for i in range(len(A)):
    # print(A[i], A)
    nizi[A[i]] += 1
sumall = sum(A)
for q in range(Q):
    # print(nizi)
    B, C = map(int, input().split())
    sumall += (C-B) * nizi[B]
    nizi[C] += nizi[B]
    nizi[B] = 0
    print(sumall)

### FIXED CODE ###



N = int(input())
A = list(map(int, input().split()))
Q = int(input())
nizi = [0] * (10**5+1)
for i in range(len(A)):
    # print(A[i], A)
    nizi[A[i]] += 1
sumall = sum(A)
for q in range(Q):
    # print(nizi)
    B, C = map(int, input().split())
    sumall += (C-B) * nizi[B]
    nizi[C] += nizi[B]
    nizi[B] = 0
    print(sumall)
def isCLKWISE(ph) : return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
      
def ConvexHullScan(P) :
 P = sorted(P)
 phU = []
 phU.append(P[0])
 phU.append(P[1])
 for p in P[2:] :
  phU.append(p)
  if isCLKWISE(phU) : continue
  while(True):
   del phU[-2]
   try:
    if isCLKWISE(phU) : break
   except IndexError : break
 phL = []
 phL.append(P[-1])
 phL.append(P[-2])
 for p in P[-3::-1] :
  phL.append(p)
  if isCLKWISE(phL) : continue
  while(True) :
   del phL[-2]
   try:
    if isCLKWISE(phL) : break
   except IndexError : break
 del phL[0]
 del phL[-1]
 ph = phU + phL
 return ph
  
n = range(int(input()))
P = [[int(x) for x in input().split()] for _ in n]
P = ConvexHullScan(P)
print(len(P.reverse()))
idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(P)])[2]
for p in P[idx:] + P[:idx] : print(p[0],p[1])

### FIXED CODE ###

def isCLKWISE(ph) : return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
      
def ConvexHullScan(P):
    P = sorted(P)
    phU = [P[0],P[1]]
    for p in P[2:]:
        phU.append(p)
        while(True):
            try :
                if isCLKWISE(phU) : break
                else : del phU[-2]
            except IndexError : break
    phL = [P[-1],P[-2]]
    for p in P[-3::-1]:
        phL.append(p)
        while(True):
            try :
                if isCLKWISE(phL) : break
                else : del phL[-2]
            except IndexError : break
    ph = phU + phL[1:-1]
    return ph
  
P = [[int(x) for x in input().split()] for _ in range(int(input()))]
P = ConvexHullScan(P)
P.reverse()
print(len(P))
idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(P)])[2]
for p in P[idx:] + P[:idx] : print(p[0],p[1])
n=int(input())
alist=[int(input()) for in range(n)]
max = 0
for i,a in enumerate(alist):
    max_a = max(alist[0:i])
    max_b = max(alist[i+1:])
    print(max([max_a, max_b]))

### FIXED CODE ###

n=int(input())
alist=[int(input()) for i in range(n)]
b=sorted(alist, reverse=True)
for a in alist:
    if a < b[0]:
        print(b[0])
    elif b[0] <= a:
        print(b[1])
[A,B,C]=list(map(int,input().sprit))

print(min(C,B//A))

### FIXED CODE ###

[A,B,C] = list(map(int,input().split()))
print(min(C,B//A))
import sys
import math

input = sys.stdin.readline

def can(arr, m, K):
  need = 0
  for x in arr:
    if x > m:
      need += int(x // m)
  return need <= K

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

lo = 0
hi = int(1e9) + 1

while (lo < hi):
  m = int((lo + hi) // 2)
  if (can(arr, m, K)):
    hi = m
  else:
    lo = m + 1
print(lo)


### FIXED CODE ###

import sys
import math

input = sys.stdin.readline

def can(arr, m, K):
  need = 0
  for x in arr:
    if x > m:
      need += int(x // m)
  return need <= K

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

lo = 1
hi = int(1e9) + 1

while (lo < hi):
  m = int((lo + hi) // 2)
  if (can(arr, m, K)):
    hi = m
  else:
    lo = m + 1
print(lo)
s = input()
bad = False
for i in range(len(s))[1:]:
  if s[i] == s[i-1]:
    bad = True
    break:

if bad:
  print(Bad)
else:
  print(Good)
  
  

### FIXED CODE ###

s = input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print("Bad")
else:
  print("Good")
i = input().split()
a = int(i[0])
b = int(i[1])
k = int(i[2])

if k >= a+b:
  c = d = 0

elif k == a:
  c = 0

elif k > a:
  c = 0
  d = b - (k - a)

else:
  c = a - k
  
print(c,d)

### FIXED CODE ###

i = input().split()
a = int(i[0])
b = int(i[1])
k = int(i[2])
c = a 
d = b

if k >= a+b:
  c = d = 0

elif k == a:
  c = 0

elif k > a:
  c = 0
  d = b - (k - a)

else:
  c = a - k
  
print(c,d)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
a, b = map(int,read().split())

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x==a) and (y==b)

answer = -1
for n in range(20000):
    if test(n):
        ans = n
        break
print(ans)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
A,B = map(int,read().split())
 
def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x == A) and (y == B)
 
answer = -1
for n in range(20000):
    if test(n):
        answer = n
        break
print(answer)
N, K = map(int, input().split())
A = [int(i)-1 for i in input().split()]
l = []
d = {}
p = 0
while p not in d:
    d[p] = len(l)
    l.append(p)
    p = A[p]
if K <= len(l):
    print(l[K] + 1)
    exit()
K -= d[p]
K %= len(l) - d[p]
print(l[K + d[p]] + 1)

### FIXED CODE ###

N, K = map(int, input().split())
A = [int(i)-1 for i in input().split()]
l = []
d = {}
p = 0
while p not in d:
    d[p] = len(l)
    l.append(p)
    p = A[p]
if K < len(l):
    print(l[K % len(l)] + 1)
    exit()
elif K == len(l):
    print(p + 1)
    exit()
K -= d[p]
K %= len(l) - d[p]
print(l[K + d[p]] + 1)
N = input()
A = input()
print("YES" if N / 500 <= A else "NO")

### FIXED CODE ###

N = int(input())
A = int(input())
print("Yes" if N % 500 <= A else "No")
import sys
a=[1]*500000
[a[(i*i)//2::i]=[0]*len(a[(i*i)//2::i])for i in range(3,999,2)if a[i//2]]
[print([e-1,sum(a[:(e+1)//2])][e>3])for e in map(int,sys.stdin)]


### FIXED CODE ###

import sys
m=500000;a=[1]*m
for i in range(3,999,2):
 if a[i//2]:a[i*i//2::i]=[0]*len(a[i*i//2::i])
p=[]
for i in range(m*2):p+=[i-1 if i<4 else p[i-1]+[0,a[i//2]][i%2]]
for e in sys.stdin:print(p[int(e)])