peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n, k = map(int, readline().split())
    a = list(map(int, readline().split()))

    for i in range(k, n):
        if a[i - k] < a[i]:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    main()
# Judge status: Accepted
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(Q):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + a) > 0 else 'No')
# Judge status: Accepted
S = input()

for i in range(8):
    if S[0:i] + S[i+(len(S)-7):len(S)] == "keyence":
        print("YES")
        exit()
print("NO")
# Judge status: Wrong Answer
n = int(input())
a = [int(i) for i in input().split()]
myline = sum(a)//2
for i in range(1,n):
    if myline <= sum(a[:i]):
        print(abs(sum(a)-min(sum(a[:i]),sum(a[:i-1]),key=lambda x:abs(sum(a)-x))*2))
        break
# Judge status: Wrong Answer
s = input()

ans = 0
for l in range (len(s)-1):
  for r in range(l+1, len(s)):
    cnt = 0
    for str in s[l:r]:
      if str not in ['A','C','G','T']:
        cnt = 0 
        break
      else:
        cnt += 1
    ans = max(ans, cnt)
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())
print((A+B) % 24)
# Judge status: Accepted
P, Q, R = map(int,input().split())

ride_time = [P, Q, R]
ride_time.sort()
answer = ride_time[0] + ride_time[1]
print(answer)
# Judge status: Accepted
n = int(input())
s = {}
for i in range(n):
    temp = input()
    s.setdefault(temp, 0)
    s[temp] += 1
print(len(s))
# Judge status: Accepted
#A
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:
    A -= 1
else:
    B -= 1
print(A, B)
# Judge status: Accepted
N,M,X=map(int,input().split())
L=[]
ans=[0]*(M+1)
A=float("inf")
for i in range(N):
	L.append(list(map(int,input().split())))
for i in range(N):
	for j in range(1,M+1):
		ans[j]+=L[i][j]
if min(ans[1:M+1])<X:
	print(-1)
	exit()
for i in range(1,2**N+1):
	ans=[0]*(M+1)
	i+=8192
	for j in range(N):
		if ((i>>j)&1):
			for k in range(M+1):
				ans[k]+=L[j][k]
	if min(ans[1:M+1])>=X:
		A=min(ans[0],A)
print(A)
# Judge status: Accepted
n, k = map(int, input().split())
a = 0
for i in range(1, n+1):
    for j in range(100):
        if i*2**j>= k:
            a += 0.5**j
            break
print((1/n)*a)
# Judge status: Accepted
from collections import Counter
N, K = map(int, input().split())
A = Counter(list(map(int,input().split()))).most_common()
repeat = len(set(A))-K
ans = 0
num = 0

while num < repeat:
    ans += A.pop(-1)[1]
    num += 1

print(ans)
# Judge status: Wrong Answer
N = int(input())
pre = int(input())
ans = 0
for _ in range(N - 1):
    i = int(input())
    if pre <= i:
        ans += pre
        pre = i - pre
    else:
        ans += i + (pre - i) // 2             
        pre = 0

print(ans)
# Judge status: Wrong Answer
N = int(input())
cnt = 0
tmp = 0
for i in range(N):
    a = int(input())
    cnt += a//2
    tmp2 = a%2
    if tmp ==1 and tmp2==1:
        cnt +=1
        tmp = 0
    else:
        tmp = tmp2
print(cnt)
# Judge status: Wrong Answer
n, m = map(int, input().split())
if n % 2 == 1:
  for i in range(m):
    print(str(i+1)+" "+str(2*m - i))
else:
  for i in range(m):
    print(str(i+1)+" "+str(2*m - i + 1))
# Judge status: Accepted
def has_duplicates(seq):
    return len(seq) != len(set(seq))
N = input().rstrip().split(' ')[0]
print('NO') if has_duplicates([int(i) for i in input().rstrip().split(' ')]) else print('YES')
# Judge status: Wrong Answer
import fractions

n = int(input())
t = [0]*n
for i in range(n):
    t[i] = int(input())
    
ans = t[0]
    
for i in range(n-1):
    ans = ans * t[i+1] / fractions.gcd(ans,t[i+1])
    
print(int(ans))
# Judge status: Accepted
from collections import defaultdict
n,m=map(int,input().split())
p,s=[],[]
for i in range(m):
    P,S=input().split()
    p.append(int(P))
    s.append(S)

pena=0
cnt_ac=defaultdict(lambda :0)
cnt_wa=defaultdict(lambda :0)
for x,y in zip(p,s):
    if cnt_ac[x]==0:
        if y=='AC':
            cnt_ac[x]=1
            pena+=cnt_wa[x]

        elif y=='WA':
            cnt_wa[x]+=1

print(sum(cnt_ac.values()),pena)
# Judge status: Accepted
n,m=map(int,input().split())
if 2*n>=m:
    print(m//2)
else:
    x=m-2*n
    print(n+x//4)
# Judge status: Wrong Answer
import heapq

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

A = list(map(int, input().split()))
A = list(map(lambda x:x*(-1), A))

heapq.heapify(A)

for i in range(M):
    x = heapq.heappop(A)
    heapq.heappush(A, x//2)

print(sum(A)*(-1))
# Judge status: Wrong Answer
S=input()
t=set()
ans='No'
for i in range(len(S)):
    t.add(S[i])
if len(t)==4:
    print('Yes')
    exit()
elif len(t)==3:
    print('No')
    exit()
elif len(t)==2:
    if 'N' and 'S' in t:
        print('Yes')
        exit()
    elif 'W' and 'E' in t:
        print('Yes')
        exit()
    else:
        print('No')
        exit()
else:
    print('No')
# Judge status: Accepted

N,M = list(map(int, input().split()))
P = []
Y = []
for _ in range(M):
    p,y = list(map(int, input().split()))
    P.append(p)
    Y.append(y)
count = [0]*(N+1)
ans = [0]*(M+1)
data = [[p,y,i] for p,y,i in zip(P,Y,range(1,M+1))]

data.sort(key=lambda x: x[1])

for i in range(M):
    count[data[i][0]] += 1
    ans[data[i][2]] = count[data[i][0]]


for j in range(1,M+1):
    a = P[j-1]
    b = ans[j]
    print(str(a*(10**6)+b).zfill(12))
# Judge status: Accepted
K, X = map(int, input().split())



if K * 500 >= X:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import math
a,b,c=map(int,input().split())
if c%(math.gcd(a,b))==0:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
N = int(input())
lis = []
for i in range(N):
    lis.append(int(input()))
max_value = max(lis)
max_index = lis.index(max_value)
max_count = lis.count(max_value)
next_max = sorted(lis)[-2]
if max_count ==1:
    for i in range(N):
        if i == max_index:
            print(next_max)
        else:
            print(max_value)
else:
    for i in range(N):
            print(max_value)
# Judge status: Accepted
n, m = map(int, input().split())
a = [ i  for i in map(int, input().split())]

# print(n, m)
# print(a)

a.sort(reverse=True)
# print(a)

last = a[m-1]
# print(last)
total = sum(a)

if (last >= (total / (4 * m))):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import math
N = int(input())
A = list(map(int, input().split()))

sum_a = sum(A)
x = 0
ans = 1000000000000000

for i in range(N-1):
        x += A[i]
        ans = min(ans, abs(2*x-sum_a))

print(ans)
# Judge status: Wrong Answer
X = int(input())
ans = 0
for b in range(1, X):
    for p in range(2, X):
        tmp = b ** p
        if ans < tmp and tmp <= X:
            ans = tmp
print(ans)
# Judge status: Wrong Answer
S=input()
if S=="SUN":
    print(7)
if S=="MON":
    print(6)
if S=="TUE":
    print(5)
if S=="WED":
    print(4)
if S=="THU":
    print(3)
if S=="FRI":
    print(2)
else:
    print(1)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())

def bs(ok, ng, cond):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if cond(mid):
            ok = mid
        else:
            ng = mid
    return ok

ans = bs(n, 0, lambda x: x * 1.08 >= n)
if n == int(ans * 1.08):
    print(ans)
else:
    print(':(')
# Judge status: Wrong Answer

import math
N = int(input())
for i in range(1, N+1):
    if i*i > N:
        print((i-1)**2)
        exit()
# Judge status: Accepted
from fractions import gcd
n=int(input())
A=list(map(int,input().split()))
a=1
for i in range(n):
  a=a*A[i]//gcd(a,A[i])
ans=0
for i in range(n):
  ans=ans+a//A[i]
print(ans%(10**9+7))
# Judge status: Accepted
import math
n, k = map( int, input().split() )
print( int( math.log( n, k ) ) + 1 )
# Judge status: Accepted
k,x=map(int, input().split())
if 500*k >=x:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N = int(input())
S = input()
left = 0
right = 0
cnt1 = 0
for i in S:
    if i == '(':
        left += 1
    else:
        right += 1
    cnt1 = max(cnt1, right - left)
cnt2 = 0
for i in S[::-1]:
    if i == ')':
        left += 1
    else:
        right += 1
    cnt2 = max(cnt2, right - left)
ans = '(' * max(0, cnt1) + S + ')' * max(0, cnt2)
print(ans)
# Judge status: Accepted
#!/bin/bash
''':'
docker run --rm -it -v $(cd $(dirname $0) && pwd):/vo:ro pypy:3-2.4.0 \
   /bin/bash -c "pypy3 /vo/$(basename $0) < /vo/g.inp"
exit $?
'''
import sys


def _i(): return int(sys.stdin.readline().strip())


h = _i()

n = 0
while h > 0:
    h //= 2
    n += 1

print(2**n - 1)
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = list(map(int, input().split()))
if n == k:
    print(1)
    exit()
pos_1 = a.index(1)
left = pos_1
right = n - pos_1 - 1
if left > right:
    left, right = right, left
if left < k - 1:
    right -= k - left - 1
print((left + k - 2) // (k - 1) + (right + k - 2) // (k - 1))
# Judge status: Wrong Answer
import itertools
import copy

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

for i in range(len(a)):
  aa = copy.copy(a)
  del aa[i]
  for av in aa:
    if av in matches:
      matches[av] += 1
    else:
      matches[av] = 1
  combi_cnt = 0
  for v in matches:
    combi_cnt += len(list(itertools.combinations(range(v), 2)))
  print(combi_cnt)
# Judge status: Wrong Answer
import numpy as np
n, k = map(int, input().split())
a = np.array(list(map(int, input().split())))

for i in range(k):
    next_a = np.array([0 for _ in range(n)])
    for j in range(n):
        next_a[max(j - a[j], 0):min(j + a[j] + 1, n)] += 1
    a = next_a
    print(' '.join(list(map(str, a.tolist()))))
# Judge status: Wrong Answer
a=int(input())
print('YES' if a=='5' or a=='3' or a=='7' else 'NO')
# Judge status: Wrong Answer
def check(n, list1): 
    new = [] 
    for i in range(n): 
        new.append(list1[i]) 
          
    new.sort()
    swaps = 0
    for i in range(n): 
        if list1[i] != new[i]: 
            swaps += 1
              
    if swaps == 0 or swaps == 2: 
        return True
    else: 
        return False
  
n = int(input())

numbers =list(map(int, input().split()[:n]))


print(numbers)



if check(n, numbers): 
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
csf = [list(map(int, readline().split())) for _ in range(n - 1)]
for i, (c, s, _) in enumerate(csf):
    s += c
    for j, (cc, ss, ff) in enumerate(csf[i + 1:]):
        if s <= ss:
            s = ss
        else:
            s += (s - ss) % ff
        s += cc
    print(s)
print(0)
# Judge status: Accepted
import collections
N =int(input())
A =list(map(int,input().split()))
col = (collections.Counter(A))
col_key = sorted(col.keys(),reverse = 1)
hen = []
counter  =0
for i in range(len(col_key)):
    if 2 <= col[col_key[i]] <4:
        hen.append(col_key[i])
        counter += 1
    elif col[col_key[i]] >= 4:
        hen.append(col_key[i])
        hen.append(col_key[i])
        counter +=2
    if counter>=2:
        break
if counter<2:
    print(0)
else:
    print(hen[0]*hen[1])
# Judge status: Accepted
import heapq

N, M = map(int, input().split())
ABs = [tuple(map(int, input().split())) for _ in range(N)]
ABs.sort(reverse = True)

works = []
reward = 0
for i in range(1, M+1):
	while ABs and ABs[-1][0] <= i:
		heapq.heappush(works, -ABs.pop()[1])
	if works:
		reward -= heapq.heappop(works)
        
print(reward)
# Judge status: Accepted
X = int(input())
i = 1
while True:
    if X * i % 360 == 0:
        break
    else:
        i += 1
print(i)
# Judge status: Accepted
S = str(input())

if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
    print("Bad")
else:
    print("Good")
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))

ans = 0
for i in range(1,n-1):
  tmp = sorted(p[i-1:i+2])
  if tmp.index(p[i]) == 1:
    ans += 1
print(ans)
# Judge status: Accepted
s = input()
t = input()
if len(s)+1 == len(t) and s == t[:-1]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
A = [0]*N
A = list(map(int, input().split()))

sum_step = 0

for n in range(1, N):
  max_ = max(A[0:n])
  sum_step += max_ - A[n]
  
print(sum_step)
# Judge status: Wrong Answer
N = int(input())
L = [1, 6, 9]

tmp = 6
while tmp < N:
    tmp *= 6
    L.append(tmp)
tmp = 9
while tmp < N:
    tmp *= 9
    L.append(tmp)

L.sort(reverse=True)


DP = [float('inf')] * 100001
DP[0]
for i in range(1, 6):
    DP[i] = i
DP[6] = 1

for i in range(7, N+1):
    for l in L:
        if l <= i:
            DP[i] = min(DP[i], DP[i-l] + 1)

print(DP[N])
# Judge status: Accepted
a=int(input())
b=int(input())
r=[1,2,3]
r.remove(a)
r.remove(b)
print(r[0])
# Judge status: Accepted
N=input()
mod=0
for c in N:
    mod+=int(c)%9

if mod%9==0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s=input()
if s[0]=='S':
    print('Cloudy')
elif s[0]=='C':
    print('Rainy')
else:
    print('Sunny')
# Judge status: Accepted
n = int(input())
a = [list(map(int,input().split())) for _ in range(2)]
s = 0
for i in range(n):
    s += a[0][i]
    a[0][i] = s
a[1][0] += a[0][0]
for i in range(1, n):
    a[1][i] += max(a[0][i], a[1][i - 1])
print(a[1][-1])
# Judge status: Wrong Answer
n = int(input())
v = list(map(int, input().split()))

vs = sorted(v)
ans = vs[0]
for i in range(1,n):
    ans = (ans + vs[i]) // 2

print(ans)
# Judge status: Accepted
from collections import Counter

n = int(input())
a = Counter(map(int, input().split()))
xy = []
a = sorted(a.items(), key=lambda x: x[0], reverse=True)
for i in a:
    if len(xy) == 2:
        break
    if i[1] >= 4:
        xy.append(i[0])
        xy.append(i[0])
        break
    if i[1] >= 2:
        xy.append(i[0])

    else:
        pass
print(xy[0] * xy[1]) if len(xy) >= 2 else print(0)
# Judge status: Wrong Answer
H = int(input())

_list = []

for i in range(H):
  set = input().split(" ")
  _list.append([int(set[0]), int(set[1])])

new_list = sorted(_list)

ans_list = [new_list[0]]
for i in new_list:
  arm_long = ans_list[-1][0] + ans_list[-1][1] -1
  arm_short = i[0] - i[1] +1
  if arm_long < arm_short:    
    ans_list.append(i)
  else:
    arm_long_new = i[0] + i[1] - 1
    if arm_long >= arm_long_new:
      ans_list[-1] = i
print(ans_list)

print(len(ans_list))
# Judge status: Accepted
import math

pages = int(input())
print(math.ceil(pages/2))
# Judge status: Wrong Answer
from sys import stdin, stdout

def main():
    line = stdin.readline()
    parts = line.split()
    parts.sort()

    stdout.write('Yes' if int(parts[0])==5 and int(parts[1])==5 and int(parts[2])==7 else 'No')

main()
# Judge status: Accepted
S=input()
a1=0
a2=0
p1='1'
p2='0'
for s in S:
  if s!=p1:
    a1+=1
  else:
    a2+=1
  p=p1
  p1=p2
  p2=p
print(min(a1,a2))
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))

l=0
r=0

li=0
ri=0

for i in range(N):
    if l<=r:
        l+=A[li]
        li+=1
    else:
        r+=A[-1-ri]
        ri+=1
        
print(l-r)
# Judge status: Accepted
import math

def solve(y, z):
  res = 0
  for i in range(len(y)):
    res += (y[i]-z[i])**2
  return math.sqrt(res)

n, d = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in range(n-1):
  for j in range(i+1, n):
    dist = solve(x[i], x[j])
    if int(dist) == dist: ans += 1
print(ans)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
law = 10 ** 9 + 7

def fermat(n, r, law):
    x = 1
    y = 1
    for i in range(r):
        x = x * (n - i) % law
        y = y * (i + 1) % law

    ans = x * pow(y, law - 2, law)
    return ans

print((pow(2,n,law)- fermat(n,a,law)-fermat(n,b,law))%law)
# Judge status: Accepted
A, B = map(int, input().split())
if A <= 8 and B <= 8:
  print("Yay!")
else:
  print(":(")
# Judge status: Accepted
S = input()
T = input()

for s,t in zip(S,T):
    if s != t:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
w,a,b = map(int,input().split())
if a <= b <= a+w or a <= b <= a+w:
    print(0)
elif a+w < b:
    print(b-a-w)
else:
    print(a-b-w)
# Judge status: Wrong Answer
from fractions import gcd
A,B,C,D = map(int,input().split())
N=B-A+1
CD = (C * D) // gcd(C,D)
print(N - (N//C) - (N//D) + (N//CD) )
# Judge status: Accepted
import math

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

h = h*30 + 0.5*m
m = m*6

rad = abs(h-m)
cosrad = math.cos(math.radians(rad))
c2 = a**2 + b**2 - 2*b*a*cosrad
c2 = c2 ** 0.5

print(c2)
# Judge status: Wrong Answer
# 大きくなるように取る
# 1 -> 5 -> 6 -> 5かな
# 1 6 12 17 23
N = int(input())
# N -= 1
cnt = 0
a = N // 11
amari = N % 11
cnt += a*2
# print(a, amari)
if amari == 0:
    cnt += 0
elif amari <= 5:
    cnt += 1
else:
    cnt += 2
print(cnt)
# Judge status: Accepted
from math import gcd
g = gcd(int(input()), 360)
print(360 // g)
# Judge status: Accepted
n = int(input())
A = [input() for i in range(n)]
m = int(input())
B = [input() for i in range(m)]
T = [""] * n
ans = 0

for i in range(n):
    if A[i] not in T:
        T[i] = A[i]
        ans = max(ans, A.count(A[i]) - B.count(A[i]), 0)

print(ans)
# Judge status: Accepted
n = int(input())
s = input()
x = 0
ans = x
for i in range(n):
    if s[i] == 'I':
        x += 1
    else:
        x -= 1
    ans = max(ans,x)
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
for i in range(1, b+1):
    if a*i % b == c:
        print("YES")
        break
else:
    print("NO")
# Judge status: Wrong Answer
n=int(input())
a_list=list(map(int,input().split()))
ans=0
tmp=a_list[0]
for i in range(n-1):
    if a_list[i]>a_list[i+1]:
        print(tmp,ans)
        ans+=tmp-a_list[i+1]
    else:
        tmp=a_list[i+1]
print(ans)
# Judge status: Accepted
s = input()
k = int(input())
first = len(s)
for i in range(len(s)):
  if s[i] != '1': first = i; break
if s[0] != '1': print(s[0]); exit(0)
print(1) if k <= first else print(s[first])
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))

for _ in range(K):
    tmp = [0] * (N+1)
    for i in range(N):
        tmp[max(0, i-A[i])] += 1
        tmp[min(N-1, i+A[i]) + 1] -= 1

    ans = [0]*N
    A[0] = tmp[0]
    for i in range(1, N):
        A[i] = A[i-1] + tmp[i]

    # print(*A)
    if sum(A) == N*N:
        break
print(*A)
# Judge status: Wrong Answer
n = int(input())

for i in range(n):
    if (i + 1) ** 2 > n:
        break
print(i ** 2)
# Judge status: Accepted
n,m=map(int,input().split())
x=list(map(int, input().split()))

if n >= m:
  print('0')
  exit(0)

x_sorted = sorted(x)
dx = [abs(x_sorted[i+1]-x_sorted[i]) for i in range(m-1)]
dx_sorted = sorted(dx,reverse=True)

result = sum(dx_sorted)
for i in range(n-1):
  result -= dx_sorted[i]
print(result)
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
q=[i for i in p]
p.sort()
ans=0
for i in range(n):
  if p[i]!=q[i]:
    ans+=1
print("YES" if ans==0 or ans==2 else "NO")
# Judge status: Wrong Answer

def main():
    n = int(input())
    if n % 2 == 1:
        print(n // 2 + 1)
    else:
        print(n / 2)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
X = list(map(int, input().split()))

ans = float('inf')
for p in range(101):
    temp = 0
    for x in X:
        temp += (x-p)**2
    ans = min(ans, temp)
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=[]
c=[]
s=sum(a)
t=0
for i in range(n-1):
    b.append(t+a[i])
    t=b[i]
for i in range(n-1):
    c.append(abs(2*b[i]-s))
c.sort()
print(c[0])
# Judge status: Accepted
import itertools

N, M, Q = map(int, raw_input().split())
data = [None] * Q
for i in range(Q):
    data[i] = map(int, raw_input().split())

def calc_score(data, A):
    score = 0
    for a, b, c, d in data:
        if A[b-1] - A[a-1] == c:
            score += d
    return score

print max(calc_score(data, A) for A in itertools.combinations_with_replacement(range(1, M+1), N))
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read#全部読み込むやつ
readline = sys.stdin.buffer.readline#1行読み込むやつ
readlines = sys.stdin.buffer.readlines#リストで読み込むらしい

S = read().rstrip()
length = len(S)
ans = "x" * length
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3


def solve(N: int):
    if N % 2 == 0:
        N = N // 2
        answer = 0
        div = 5
        while N >= div:
            answer += N // div
            div *= 5
        return answer

    else:
        return 0

    return answer


def main():
    N = int(input())
    answer = solve(N)
    print(answer)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a = list(map(int, input().split()))
if a[0]+a[1] <= a[2] + a[3]:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
N = input()
hN = str(N)[0:1]
dN = str(N)[1:2]
mN = str(N)[2:3]
#print(str(N)+hN+dN+mN)

bool = 0

if hN == '7':
    bool = bool + 1
elif dN == '7':
    bool = bool + 1
elif mN == '7':
    bool = bool + 1

if bool == 1:
    print('Yes')
elif bool == 0:
    print('No')
# Judge status: Accepted
from collections import deque
k = int(input())
q = deque(range(1,10))
while k:
    k-=1
    t=q.popleft()
    if t%10 !=0 : q.append(10*t+t%10-1)
    q.append(10*t+t%10)
    if t%10 !=9 : q.append(10*t+t%10+1)

print(t)
# Judge status: Wrong Answer
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

n = int(readline())

p = [list(map(int,readline().split())) for i in range(n)]

xmin = INF
ymin = INF

for (x,y) in p:
    xmin = min(x,xmin)
    ymin = min(y,ymin)

for i in range(n):
    p[i][0] -= xmin
    p[i][1] -= ymin

dmax = 0
dmin = INF

for (x,y) in p:
    dmax = max(dmax, x+y)
    dmin = min(dmin, x+y)

print(dmax-dmin)
# Judge status: Accepted
N = input()

ans1 = sum([int(c) for c in N]) 
ans2 = int(N[0]) - 1 + 9 * (len(N) - 1)
print(max(ans1, ans2))
# Judge status: Wrong Answer
n,m = map(int,input().split())
if m < 2*n:
	print(0)
else:
	m -= 2*n
	print(n+(m//4))
# Judge status: Wrong Answer
N=int(input())
A=sorted(list(map(int,input().split(' '))))
ans = A[0]
for i in A[1:]:
    if i%ans>0:
        ans = i%ans
    else:
        print(ans)
        break
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
print(sum(A[:n-1]))
# Judge status: Wrong Answer
a, b = map(int, input().split())

ans = 0
for i in range(a, b+1):
    s = str(i)
    sl = len(s) // 2
    
    if s[:sl] == s[-sl:]: ans += 1
print(ans)
# Judge status: Wrong Answer
import numpy as np

n = int(input())

a = input().split(' ')

a = np.array(a).astype(int)


while a[a>0].shape[0] > 1:
  not_0_a = a[a!=0]
  min_ = not_0_a.min()
  min_i = np.where(not_0_a == min_)
  a = a % min_

  if a[a>0].shape[0] == 1:
    not_0_a = a[a!=0]
    min_ = not_0_a.min()
    break
    
  if len(min_i[0]) == 1:
    a[min_i] = min_
  
print(min_)
# Judge status: Accepted
C=[]
for i in range(1,100):
    if 6**i<=10**5:
        C.append(6**i)
for i in range(1,100):
    if 9**i<=10**5:
        C.append(9**i)
        
N=int(input())
dp=[i for i in range(N+1)]
for c in C:
    for i in range(N+1):
        if i-c>=0:
            dp[i]=min(dp[i],dp[i-c]+1)
print(dp[N])
# Judge status: Wrong Answer
m, t, s = input().split()
if float(m) / float(s) <= float(t):
  print('YES')
else:
  print('No')
# Judge status: Wrong Answer
A, B = map(int, input().split())

if 13 <= A:
  ans = B
elif A < 6:
  ans = 0
else:
  ans = B / 2
  
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split(" ")))
answer = 0
for i in range(1,n):
    if a[i] < a[i - 1]:
        answer += a[i-1] - a[i]
        a[i]= a[i - 1]

print(answer)
# Judge status: Accepted
N, R = map(int,input().split())
print(R + 100 * (10 - N) if N < 10 else R)
# Judge status: Accepted
# x2y3 - y2x3 = S
s = int(input())
if s == 10**18:
	print(0, 0, 10**9, 10**9, 0, 10**9)
	exit()
x_2 = 10**9
x_3 = 10**9 - s%(10**9)
y_2 = 1
y_3 = s//(10**9) + 1
print(0, 0, x_2, x_3, y_2, y_3)
# Judge status: Wrong Answer
from collections import Counter

N = Counter([input() for _ in range(int(input()))])
M = Counter([input() for _ in range(int(input()))])
print(max(N[key]-M[key] for key in N.keys()))