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

N = int(input())
numbers = [int(i) for i in input().split()]

c = collections.Counter(numbers)

output = 0

for k, v in c.items():
    if k > v:
        output += v
    elif v > k:
        diff = v - k
        output += diff

print(output)
# Judge status: Accepted
n=int(input())
X=[]
for i in range(n):
    x,l=[int(_) for _ in input().split()]
    X+=[(x-l,x+l)]
X.sort(key=lambda x:x[0])
ans=n
tmp=X[0][1]
for i in range(1,n):
    if tmp>X[i][0]:
        ans-=1
        tmp=min(tmp,X[i][1])
    else:
        tmp=X[i][1]
print(ans)
# Judge status: Accepted
A = list(map(int, input().split()))
B = set(A)
if len(B) == 2:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)

l2 = l
l2 = sorted(l2)
l2.reverse()
max = max(l)


ans = []
if l2[1] == max:
    for i in range(n):
        print(max)
else:
    for j in l:
        if j != max:
            print(max)
        else:
            print(l2[1])
# Judge status: Wrong Answer
A, B, C, X, Y = map(int, input().split())
faceAB = (A + B) / 2
if faceAB <= C:
    print(X * A + Y * B)
elif 2 * C <= A and 2 * C <= B:
    print(2 * C * max(X, Y))
else:
    if X <= Y:
        print(2 * C * min(X, Y) + ((Y - X) * B))
    else:
        print(2 * C * min(X, Y) + ((X - Y) * A))
# Judge status: Wrong Answer
n = int(input())
lst = list(map(int, input().split()))

c = 0
for i in range(n):
  if i % 2 == 1 and lst[i] % 2 == 1:
    c += 1
print(c)
# Judge status: Accepted
N, K=map(int,input().split())

n=N
count=0

while n>0:
    n=int(n/K)
    count+=1

print(count)
# Judge status: Wrong Answer
import sys
import numpy as np
def Ii():return int(sys.stdin.buffer.readline())
def Mi():return map(int,sys.stdin.buffer.readline().split())
def Li():return list(map(int,sys.stdin.buffer.readline().split()))

n = Ii()
a = Li()
b = [0]*(n+1)
bm = [0]*(n+1)
b[0] = 1
bm[-1] = a[-1]
for i in range(1,n+1):
  bm[-1-i] = bm[-i]+a[-i-1]
  b[i] = (b[i-1]-a[i-1])*2
b = np.array(b)
bm = np.array(bm)
c = np.amin([[b],[bm]], axis=0)

if np.any(c == 0):
  print(-1)
else:
  print(np.sum(c))
# Judge status: Wrong Answer
# D - RGB Triplets
from collections import defaultdict
from functools import reduce
from operator import mul


def main():
    _, S = open(0).read().split()
    indices, doubled_indices = defaultdict(list), defaultdict(set)
    for i, c in enumerate(S):
        indices[c].append(i)
        doubled_indices[c].add(2 * i)

    cnt = reduce(mul, [len(i) for i in indices.values()])
    for x, y, z in ("RGB", "RBG", "BGR"):
        cnt -= sum(i + j in doubled_indices[z] for i in indices[x] for j in indices[y])
    print(cnt)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n, x = map(int, input().split())
l = list(map(int, input().split()))
count = 0
d = 0
for i in range(1, n+1):
    d += l[i-1]
    if d <= x:
        count += 1
    else:
        break
print(count+1)
# Judge status: Accepted
n = input()
print('Yes' if n[0]==n[1]==n[2] or n[1]==n[2]==n[3] else 'No')
# Judge status: Accepted

data = list(map(int, input().split()))
k = data[0]
r = data[1]

if k >= 10:
    print(r)
else:
    inner_rate = r + (100*(10-k))
    print(inner_rate)
# Judge status: Accepted
import sys

S = input()

def check():
  for i in range(len(S)) :
    if i%2!=0 and S[i]=="R" :
      print("No")
      sys.exit(0)
    elif i%2==0 and S[i]=="L" :
      print("No")
      sys.exit(0)
check()
print("Yes")
sys.exit(0)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ret = sum(b)
for i in range(n-1):
    if a[i] != n:
        ret += c[a[i]-1]
print(ret)
# Judge status: Accepted
pqr = list(map(int, input().split()))
pqr = sorted(pqr)
print(pqr[0] + pqr[1])
# Judge status: Wrong Answer
s = input()
n = len(s)
mid = n//2

ans = 'No'

if s[:mid] == s[mid+1:]:
    q = s[:mid]
    q_mid = len(q)//2

    t = s[mid+1:]
    t_mid = len(t)//2

    if q[:q_mid] == q[q_mid+1:] and t[:t_mid] == t[t_mid+1:]:
        ans = 'Yes'

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

n1 = 0
n2 = 0
n4 = 0

for ai in a:
    if ai % 2 == 0:
        if ai % 4 == 0:
            n4 += 1
        else:
            n2 += 1
    else:
        n1 += 1

if n1 > n4:
    if (n4 >= 1) and (n1 == (n4 + 1)) and n2 == 0:
        print("Yes")
    else:
        print("No")
else:
    print("Yes")
# Judge status: Accepted
n, m = map(int, input().split())
g = [[] for _ in range(n)]

for _ in range(m):
	a, b = map(int, input().split())
	a -= 1; b-=1;
	g[a].append(b)
	g[b].append(a)

dist = [-1]*n
dist[0] = 0
prev = [-1]*n

que = [0]
pos = 0
while pos < len(que) :
	v = que[pos]; pos += 1;
	for w in g[v]:
		if dist[w] == -1 :
			dist[w] = dist[v] + 1
			prev[w] = v;
			que.append(w)

if -1 in dist :
	print("No");
else :
	print("Yes");
	for i in range(1,n):
		print(prev[i]+1);
# Judge status: Accepted
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
nums = list(map(int,input().split()))
cnt =0
while True:
  if x-cnt not in nums:
    print(x-cnt)
    break
  if x+cnt not in nums:
    print(x+cnt)
    break
  cnt +=1
# Judge status: Accepted
n = int(input())
b = list(map(int, input().split()))
maxa = [0] * n
maxa[0], maxa[n - 1] = b[0], b[n - 2]
for i in range(1, n - 1):
  maxa[i] = min(b[i - 1], b[i])
print(sum(maxa))
# Judge status: Wrong Answer
answer = input()

count = 0
list = []
for i in answer:
    list.append(i)

if len(answer) != 6:
    print(False)
    
elif list[2] == list[3] and list[4] == list[5]:
    print(True)

else:
    print(False)
# Judge status: Wrong Answer
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


def main():
    n, s = map(int, input().split())
    xs = sorted(list(map(int, input().split())))

    for i, x in enumerate(xs):
        if i == 0:
            ans = x-s
        else:
            ans = gcd(ans, x-s)
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
N = int(input())
W=[]
ss=True
for i in range (N):
  W.append(input())


for t in range (N):
    if W[t-1][-1]==W[t][0]:
      ss=True
    else:
      ss=False 
if len(W)!=N:   
  ss=False
     
if ss==False:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
n,k = map(int, input().split())
a = list(map(int,input().split()))
ans = 1
c = [1]
d = [0]*(n+5)
d[1] = 1
for j in range(1,2*n):
    i = a[c[-1]-1]
    if d[i] == 1:
        g = i
        break
    # if i in set(c):
    #     g = i
    #     break
    d[i] = 1
    c.append(i)
s = c.index(g)
r = len(c)-s
if k <=s:
    print(c[k])
else:
    b = (k-s)%r
    print(c[s+b])
# Judge status: Accepted
o=input()
e=input()
s=""
for i in range(len(o)+len(e)):
  if i%2==0:
    s+=o[i//2]
  else:
    s+=e[i//2]
print(s)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
X, Y, Z = [int(x) for x in input().split()]
ans = 1
X -= Y
ans += (X // (Y + Z))
print(ans)
# Judge status: Accepted
import itertools
import sys
input = sys.stdin.readline

n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

s = list(range(1,n+1))
s_list = list(itertools.permutations(s))
print (abs(s_list.index(p) -  s_list.index(q)))
# Judge status: Wrong Answer
s = input()
q = int(input())
inv = 1
for i in range(q):
  t = input()
  if t[0] == '1':
    inv *= -1 #s = s[::-1]
  else:
    _, f, c = map(str, t.split())
    if f =='1' and inv == 1:
      s = c+s
    else:
      s = s+c

print(s[::inv])
# Judge status: Accepted
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 _ in range(M):
    tmp = heapq.heappop(A) * (-1)
    tmp //= 2
    heapq.heappush(A, tmp * (-1))

print(-sum(A))
# Judge status: Accepted
import math
import sys
n=int(input())
ans=[]
syo=n
if n==0:
    print(0)
    sys.exit(0)
while syo!=0:
    zan=syo%-2
    if zan==-1:
        zan=1
    ans.insert(0,zan)
    syo=math.ceil(syo/-2)
for i in range(len(ans)):
    print(ans[i],end="")
# Judge status: Accepted
from math import factorial
N,M=map(int,input().split())
ans=0
if abs(N-M)>1:
    ans=0
else:
    if N==M:
        a=N
        b=M
        ans=factorial(a)*factorial(b)*2
    else:
        a=max(N,M)
        b=min(N,M)
        ans=factorial(a)*factorial(b)
print(ans%(10**9+7))
# Judge status: Accepted
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7


a, b = rm()
print(math.ceil((a+b)/2))
# Judge status: Accepted
N,M = map(int,input().split())
A = set([int(input()) for i in range(M)])
MOD = 10**9+7



dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print(dp[-1]%MOD)
# Judge status: Accepted
n,k=[int(x) for x in input().split(" ")]
l=[int(x) for x in input().split(" ")]
l.sort()
s=0
for i in range(k):
   s=s+l[i] 
print(s)
# Judge status: Accepted
n,l=map(int,input().split())
li=[]
while n>0:
    a=input()
    li.append(a)
    n-=1
kk=sorted(li)
moji=''
for x in kk:
    moji+=x
print(moji)
# Judge status: Wrong Answer
import sys
 
x, n = map(int, input().split())
 
if n == 0:
  print(x)
  sys.exit()
  
if n == 1:
  print(abs(x - int(input())))
  sys.exit()
 
p = list(map(int, input().split()))
 
p.sort()
min = [100, 100]
 
for i in range(101):
  if i in p:
    continue
  hoge = abs(x - i)
  if min[0] > hoge:
    min[0] = hoge
    min[1] = i
 
print(min[1])
# Judge status: Wrong Answer
n,k = map(int,input().split())

d = []
a = []

for _ in range(k):
  d.append(int(input()))
  a.append(list(map(int,input().split())))
  
ans = [1] * n
for i in range(k):
  for ai in range(d[i]):
    if ans[ai] == 1:
      ans[ai] = 0
      
      
print(sum(ans))
# Judge status: Accepted
#!/usr/bin/env python3
input()
(*a, ) = map(int, input().split())
d = (-1, 0, 1)
ans = [0] * (10**5 + 1)
for i in a:
    for j in d:
        if 0 <= i + j <= 10**5:
            ans[i + j] += 1
print(max(ans))
# Judge status: Accepted
A, B , C = map(int, input().split())
x = A - B
if (x <= C):
  print(C - x)
else:
  print(0)
# Judge status: Wrong Answer
a,b=input().split()
a=int(a)
b=int(b)
c=b/a
i=1
x=0
while i<=c:
  i=2*i
  x=x+1
print(x)
# Judge status: Wrong Answer
N, M = map(int, input().split())

pairs = []
for i in range(M):
    pairs.append(list(map(int, input().split())))
    
for i in range(1,N+1):
    s = set([])
    for pair in pairs:
        if i in pair:
            s |= set(pair)
    print(len(s)-1)
# Judge status: Wrong Answer
d,t,s=map(int,input().split())
if d//s<=t:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
lst = []
pair = 0
for i in range(n):
	st = ''.join(sorted(list(input())))
	lst.append(st)
lst = sorted(lst)
lst += ['end']
pre = ''
tmp_cnt = 0
cnt = 0
for i in lst:
	if i == pre:
		tmp_cnt += 1
	else:
		cnt += sum([j for j in range(tmp_cnt + 1)])
		tmp_cnt = 0
	pre = i
print (cnt)
# Judge status: Accepted
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A,B = map(int,input().split())
A = prime_factorize(A)
B = prime_factorize(B)
C = []
for i in A:
    if i in B:
        C += i,
print(1+len(set(C)))
# Judge status: Wrong Answer
a = input()
print('A' if a.islower() else 'a')
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
N = int(input())
mn = 10 ** 10
mx = 0
for _ in range(N):
  x, y = map(int, input().split())
  mn = min(mn, x + y)
  mx = max(mx, x + y)
print(abs(mx - mn))
# Judge status: Accepted
S = int(input())

# (X1, Y1) は原点
# (X2, Y2) = (10 ** 9, 1)
# S = 10 ** 9 * Y3 - X3

Y3 = (S + 10 ** 9 - 1) // (10 ** 9)
X3 = Y3 * (10 ** 9) - S

print(0, 0, 10 ** 9, 1, X3, Y3)
# Judge status: Accepted
x = int(input())
count = 0

if 6 < x <= 11:
	print(2)
elif x <= 6:
	print(1)
else:
	initcount = x // 11
	if initcount:
		count += initcount*2
		x -= initcount * 11
		mod = x % 11
		if 6 < mod <= 11:
			count += 2
		elif 0 < mod <= 6:
			count += 1
		else:
			pass
		print(count)
# Judge status: Accepted
import fractions
from functools import reduce


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

def MinB_list(numbers):
    return reduce(MinB, numbers, 1)

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

tmp = MinB_list(AList)
result = 0
for i in range(0, N):
    result += tmp // AList[i]
    
print(result % (10 ** 9 + 7))
# Judge status: Wrong Answer
c=raw_input().split()
if c=="a,e,i,o,u":
  print "vowel"
else:
  print "consonant"
# Judge status: Accepted
x,a,b = map(int,input().split())
if a >= b:
  print("delicious")
elif a+x >= b:
  print("safe")
else:
  print("dangerous")
# Judge status: Accepted
N = int(input())
D = [list(map(int, input().split())) for _ in range(N)]

for i in range(2, N):
  if D[i - 2][0] == D[i - 2][1] and D[i - 1][0] == D[i - 1][1] and D[i][0] == D[i][1]:
      print('Yes')
      exit()
      
print('No')
# Judge status: Wrong Answer
N=int(input())
ans=0

for i in range(0,N+1):
    ans+=1
print(ans)
# Judge status: Accepted
import bisect
import sys
input = sys.stdin.readline
N = int(input())
A = [int(input()) for _ in range(N)]

dp = [float('inf')]*(N+1)
for a in A[::-1]:
  idx = bisect.bisect_right(dp, a)
  dp[idx] = a

ans = 0
for n in dp:
  if n != float('inf'):
    ans += 1
print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
for i in range(n):
    n = n // k
    if n == 0:
        print(i + 1)
        exit()
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
Alist=[]
for i in range(N):
  Alist.append((A[i],i+1))
Alist=sorted(Alist,key=lambda x: x[0])
for i in range(N):
  print(Alist[i][1],end=" ")
# Judge status: Accepted
N = input()

if "BBB" == N or "AAA"==N:
  print("No")

else:
  print("Yes")
# Judge status: Wrong Answer
n = int(input())

ans = 0
f = 0
for i in range(1,n+1):
    ans += i
    if ans-i+1 >= n:
        c = i
        f = c-1
    if ans >= n:
        c = i
        break

for i in range(1,c+1):
    if i == f:
        pass
    else:
        print(i)
# Judge status: Accepted
N = int(input())

robots = []

# ロボットを設定する
for _ in range(N):
    x, l = map(int, input().split())
    robots.append([x-l, x+l])
    
# 手の届く最大値でソートする
robots = sorted(robots, key=lambda x: x[1])

# Maxが小さいもの優先で選択する
pos = robots[0][1]
cnt = 1
for i in range(1, len(robots)):
    robo = robots[i]
    if robo[0] >= pos:
        pos = robo[1]
        cnt += 1

print(cnt)
# Judge status: Wrong Answer
a = list(map(int,input().split()))
if sum(a) % 2 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

ans = 0 if a*b*c%2 == 0 else int(a*b*c/max(a, b, c))
print(ans)
# Judge status: Wrong Answer
import sys

n, m = map(int, sys.stdin.readline().split())

line = sys.stdin.readline().split()
nums = list(map(int, line))

print(n - sum(nums))
# Judge status: Accepted
a, b, k = map(int, input().split())

ans = []
for i in range(a, min(b, a + k)):
    if i in ans:
        continue
    else:
        ans.append(i)
for i in range(max(a, b - k + 1), b + 1):
    if i in ans:
        continue
    else:
        ans.append(i)

for i in range(len(ans)):
    print(ans[i])
# Judge status: Accepted
import sys
s = input()
l = len(s)
k = 'keyence' # len(k)==7
if l < 7:
    print('NO')
    sys.exit()
diff = l - 7
flag = False
for i,kk in enumerate(k):
    #print(s[:i+1],k[:i+1],s[i+diff+1:],k[i+1:])
    if s[:i+1] == k[:i+1] and s[i+diff+1:] == k[i+1:]:
        flag = True
if flag:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
water1_limit, water1, water2 = map(int, input().split())

in_water2 = water2 - (water1_limit - water1)
in_water2 = max(0, in_water2)
print(in_water2)
# Judge status: Wrong Answer
d, n = map(int,input().split())

i = 0
count = 0

while not count == n:
    i += 1
    if i % 100 == 0:
        continue
    else:
        count += 1

print(i)
# Judge status: Accepted
k, s = list(map(int, input().split(' ')))

count = 0

for i in range(k + 1):
    for j in range(k + 1):
        if 0 <= s - (i + j) <= k:
            count += 1
print(count)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)

a, b = 0, 0
for i in range(N):
    if i % 2 == 0:
        a += A.pop(0)
    else:
        b += A.pop(0)

print(a-b)
# Judge status: Wrong Answer
K,X=map(int,input().split())
a=[]
for i in range(0,K):
  a.append(X-i)
for i in range(1,K):
  a.append(X+i)
s=a.sort()
print(s)
# Judge status: Accepted
S = input()
if 'N' in S and 'W' in S and 'S' in S and 'E' in S:
    print('Yes')
elif 'N' in S and 'S' in S and not 'W' in S and not 'E' in S:
    print('Yes')
elif 'E' in S and 'W' in S and not 'N' in S and not 'S' in S:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b, c = M()
l = [a, b, c]
l.sort()
if l[1] == c:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def main():
  K,X=map(int,input().split())
  if K*500 >= X:
    print("Yes")
  else:
    print("No")
if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
A_j = {}
for i, a in enumerate(A):
    if A_j.get(i - a):
        A_j[i - a] += 1
    else:
        A_j[i - a] = 1

r = 0
for i, a in enumerate(A):
    t = A_j.get(a + i)
    if t:
        r += t

print(r)
# Judge status: Accepted
N,M=map(int,input().split())

if N==1 and M==1:
    print(1)
elif N==1:
    print(M-2)
elif M==1:
    print(N-2)
else:
    print((N-2)*(M-2))
# Judge status: Accepted
from itertools import permutations
def resolve():
    N = int(input())
    P = tuple(map(int, input().split()))
    Q = tuple(map(int, input().split()))

    ls = list(permutations(range(1, N+1)))
    ans = abs(ls.index(P) - ls.index(Q))
    print(ans)
    return

resolve()
# Judge status: Accepted
S = input()

if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print(1)
# Judge status: Accepted
s = input()

dif = []

for i in range(len(s)-2):
    x = int(s[i:i+3])
    dif.append(abs(753-x))
print(min(dif))
# Judge status: Accepted
N = int(input())
ans = "hon"
a = N % 10
if a in [0, 1, 6, 8]:
  ans = "pon"
if a == 3:
  ans = "bon"

print(ans)
# Judge status: Accepted
N = int(input())
N_List = list(map(int,input().split()))
ct = 0
for i in range(1,N):
    if N_List[i] < N_List[i-1]:
        ct += N_List[i-1] - N_List[i]
        N_List[i] = N_List[i-1]
    

print(ct)
# Judge status: Accepted
S,T = list(map(str,input().split()))
A,B = list(map(int,input().split()))
u = input()

if u == S:
  print(str(A-1) + " " +str(B))
else:
  print(str(A) + " " +str(B-1))
# Judge status: Accepted
n = int(input())
l = list(input().split())

target_num = 1
for i in range(n):
  if target_num == int(l[i]):
    target_num += 1
  else:
    target_num = target_num

if target_num == 1:
  print("-1")
else:
  print(n - target_num +1)
# Judge status: Accepted
a,b,k = map(int,input().split())

if a>=k:
    a-=k
    print(a,b)
else:
    k -=a
    a =0
    b =max(0,b-k)
    print(a,b)
# Judge status: Accepted
N=int(input())
n=int(N**0.5)
print(n**2)
# Judge status: Accepted
n=int(input())
c=input()
c1=c.count("R")
c2=c[:c1].count("W")
print(c2)
# Judge status: Accepted
s=input()
t=input()
ans=0
for i in range(len(s)):
    if  s[i] != t[i]:
        ans+=1
print(ans)
# Judge status: Wrong Answer
X,K = map(int, input().split())
max = X + K 
min = X - K + 1
for i in range(min,max):
    print(i,end=" ")
# Judge status: Accepted
import sys
input = sys.stdin.readline


def main():
    N, K = map(int, input().split())
    answer = 1
    while N >= K:
        N //= K
        answer += 1
    print(answer)


if __name__ == '__main__':
    main()
# Judge status: Accepted
def match(s,t):
  for i in range(m):
    if s[i]==t[i] or s[i]=='?':
      continue
    return False
  return True
s = list(input())
t = list(input())
n = len(s)
m = len(t)
i = n-m
found = False
while i >= 0:
  if match(s[i:i+m],t):
    found = True
    for j in range(i,i+m):
      s[j] = t[j-i]
    break
  i-=1
if found:
  for i in s:
    if i=='?':
      print('a',end='')
    else:
      print(i,end='')
  print()
else:
  print("UNRESTORABLE")
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=-1
temp=1
for i in range(n):
  if a[i]==temp:
    temp=temp+1
  elif ans==-1:
    ans=ans+2
  else:
    ans=ans+1
print(ans)
# Judge status: Accepted
N = int(input())
ans = 0

for n in range(1,N):
  ans+=(N-1)//n

print(ans)
# Judge status: Accepted
MOD = 10**9+7

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

A = [0]*(n+1)
for i in range(m):
    a = int(input())
    A[a] = 1

dp = [0]*(n+1)
dp[0] = 1
if not A[1]:
    dp[1] = 1

for i in range(2,n+1):
    if A[i]:
        continue
    dp[i] = (dp[i-1]+dp[i-2])%MOD

print(dp[n])
# Judge status: Accepted
N,A,B,C,D = map(int,input().split())
A -= 1
B -= 1
C -= 1
D -= 1
S = input()
if C < D or C < B:
    if '##' in S[A:C+1] or '##' in S[B:D+1]:
        print('No')
    else:
        print('Yes')
else:
    if '##' in S[A:C+1]:
        print('No')
    else:
        if '...' not in S[B-1:D+2]:
            print('No')
        else:
            print('Yes')
# Judge status: Accepted
a, b, c, d = map(int, input().split())
while a > 0 and c > 0:
  c -= b
  a -= d
if c <= 0:
  print('Yes')
else:
  print('No')
# Judge status: Accepted

n = int(input())

s = []
for i in range(n):
    s.append( input())

x = set(s)

dic = {}
for i in x:
    dic[i] = 0


for i in s:
    dic[i] +=1

max_dic = max(dic.values())

ans = []
for i in x:
    if dic[i] == max_dic:
        ans.append(i)


for i in sorted(ans):
    print(i)
# Judge status: Accepted
n = int(input())
b = list(map(int,input().split()))
a = [10**6]*n

for i in range(n-1):
    a[i] = min(a[i],b[i])
    a[i+1] = b[i]

print(sum(a))
# Judge status: Accepted
n = int(input())
 
str = input()

r = str.count('R')
g = str.count('G')
b = str.count('B')
sum = r * g * b
for i in range(n-2):
  for j in range(i+1, n-1):
    k = 2 * j - i
    if k < n:
      if str[i] != str[j] and str[i] != str[k] and str[j] != str[k] :
        sum -= 1
    
print(sum)
# Judge status: Wrong Answer
t = int(input())

if t > 30:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    s = [0] * N
    for i in range(N):
        s[i] = int(input())

    s.sort()
    ans = sum(s)
    if ans % 10 == 0:
        for i in range(N):
            if s[i] % 10 != 0:
                ans -= s[i]
                break
        if i == N - 1:
            ans = 0
    
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
s = input()
K = int(input())
alh = [chr(i) for i in range(97, 97 + 26)]
ans = ""
d = {}
for n,i in enumerate(alh):
    d[i] = (26-n)%26
for i in s[:-1]:
    if K >= d[i]:
        K -=d[i]
        ans += "a"
    else:
        ans += i
ans += chr(97+(ord(s[-1])+K-97)%26)
print(ans)
# Judge status: Wrong Answer
A, B = map(int, input().split())

kuti = 0
i = 0
while kuti < B:
    kuti = A * i - 1
    i += 1
print(i-1)
# Judge status: Accepted
if int(input())%9 == 0:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
# import sys
r = input()
# print(r)
ans = sum(list(map(int, r)))

if r[0] == 1:
    print(max(ans, (len(r)-1)*9))
else:
    print(max(ans, int(r[0])-1+(len(r)-1)*9))