peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a = int(input())
count = 0
for i in range(1,a):
  if len(str(i))%2 != 0:
    count += 1
print(count)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if a==b==c or (a!=b and b!=c and c !=a):
  print('No')
else:
  print('No')
# Judge status: Accepted
N, *W = map(int, open(0).read().split())
m = 100
for i in range(N-1):
    a = sum(W[:i+1])
    b = sum(W[i+1:])
    n = abs(a-b)
    if m > n:
        m = n 
print(m)
# Judge status: Accepted
N=int(input())
xp=yp=0
xn=yn=10**9
zs=[0]*N
ws=[0]*N
for i in range(N):
    xi,yi=map(int,input().split())
    zs[i]=xi+yi
    ws[i]=xi-yi
zs.sort()
ws.sort()
ans=max(zs[-1]-zs[0],ws[-1]-ws[0])
print(ans)
# Judge status: Accepted
import math
n, *a = map(int, open(0).read().split())

y1 = math.ceil(sum(a)/n)
y2 = sum(a)//n
ans1 = 0
ans2 = 0

for i in range(n):
    ans1 += (a[i] - y1) ** 2
    ans2 += (a[i] - y2) ** 2

print(min(ans1,ans2))
# Judge status: Accepted
S = int(input())
p = 10 ** 9
if S > p:
    r = S % p
    r = 0 if r == 0 else p - r 
    print(p, 1, r, (S + r) // p,  0, 0)
else:
    print(1, 0, 0, S, 0, 0)
# Judge status: Accepted
N,M=map(int,input().split())
if M<=2*N:
  print(M//2)
else:
  print(N+(M-2*N)//4)
# Judge status: Accepted
s = input()
l = s[0::2]
m = s[1::2]
if set(l) == {'h'} and set(m) == {'i'} and len(s)%2==0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = input()
B = list(map(int,input().split()))
A = [B[0]]
for i,b in enumerate(B):
    A[i] = min(A[i],B[i])
    A.append(max(B[i],A[i]))

print(sum(A))
# Judge status: Accepted
ABC = list(map(int,input().split()))
ABC.sort()
mid = ABC[-1] // 2
print(abs(ABC[0] * ABC[1] * mid - ABC[0] * ABC[1] * (ABC[2]-mid)))
# Judge status: Accepted
n = int(input())

def dfs(s, cn):
    if len(s) == n:
        print(s)
    else:
        for i in range(0, cn + 1):
            c = chr(ord('a') + i)
            if i == cn: dfs(s+c, cn+1)
            else: dfs(s+c, cn)

dfs('', 0)
# Judge status: Accepted
a, b = map(int, input().split())
ans = 0
for _ in range(2):
    if a > b:
        ans += a
        a -= 1
    else:
        ans += b
        b -= 1
print(ans)
# Judge status: Accepted
A, B, C, D = map(int, input().split())

print('Yes' if abs(A-C)<=D or (abs(A-B)<=D and abs(B-C)<=D) else 'No')
# Judge status: Accepted
n=[input() for i in range(int(input()))]
m=[input() for i in range(int(input()))]
l=list(set(n))
x=0
for i in l:
    y=max(0,n.count(i)-m.count(i))
    if y > x:
        x=y
print(x)
# Judge status: Accepted
import sys
s = input()
t = input()
dic = {'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7,'i':8,'j':9,'k':10,'l':11,'m':12,'n':13,'o':14,'p':15,'q':16,'r':17,'s':18,'t':19,'u':20,'v':21,'w':22,'x':23,'y':24,'z':25}
sl = [0]*26
tl = [0]*26
for i in s: sl[dic[i]] += 1
for i in t: tl[dic[i]] += 1
sl.sort()
tl.sort()
for i in range(26):
    if sl[i] != tl[i]:
        print("No")
        sys.exit()
print("Yes")
# Judge status: Accepted
N, K = map(int, input().split())
h = list(map(int, input().split()))

#dp[i]:i番目に到達するまでにはらうコストの最小値
INF = float('inf')
dp = [INF for i in range(N)]
dp[0] = 0

for i in range(0,N):
    for k in range(1, K+1):
        if i+k > N-1:
            break
        dp[i+k] = min(dp[i+k], dp[i]+abs(h[i+k]-h[i]))


print(dp[N-1])
# Judge status: Accepted
li = list(input())
ans = []
for i in range(len(li)):
    if (li[i] == '0') or (li[i] == '1'):
        ans.append(li[i])
    elif len(ans) > 0:
        ans.pop()
    else:
        pass

print(''.join(ans))
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().split())
S = []
S += "U"*(ty - sy),
S += "R"*(tx - sx),
S += "D"*(ty - sy),
S += "L"*(tx - sx + 1),
S += "U"*(ty - sy + 1),
S += "R"*(tx - sx + 1),
S += "D",
S += "R",
S += "D"*(ty - sy + 1),
S += "L"*(tx - sx + 1),
S += "U"
print(*S, sep = "")
# Judge status: Accepted
n, k  = list(map(int, input().split()))
#n, m = list(map(int, input().split()))
h = []
for i in range(n):
    h.append(int(input()))

h.sort()
dif_min =max(h)
for i in range(n-k+1):
    dif = h[i+k-1]-h[i]
    #print(str(h[i])+" "+str(h[i+k-1]))
    if dif < dif_min:
        dif_min = dif

print(dif_min)
# Judge status: Accepted
A,B,C=map(int,input().split())
if C <= A+B:
    ans="Yes"
else:
    ans="No"
print(ans)
# Judge status: Accepted
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]

xzy = []
for _ in range(4):
  xzy.append([])

for x, y in xy:
  xzy[0].append(x + y)
  xzy[1].append(x - y)
  xzy[2].append(-x + y)
  xzy[3].append(-x - y)


anses = []
for z in xzy:
  anses.append(max(z) - min(z))
print(max(anses))
# Judge status: Accepted
n,k = map(int, input().split())
p = list(map(int, input().split()))
from itertools import accumulate
cum = [0] + list(accumulate(p))
ans = 0
for i in range(n-k+1):
    ans = max(ans, cum[i+k]-cum[i])
print((ans+k)/2)
# Judge status: Wrong Answer
n = int(input())
a = sorted(map(int, input().split()))

from bisect import bisect_left
ans_n = a[-1]

p = bisect_left(a, (ans_n+1)//2)
ans_r = a[p]
if abs(a[p] - ans_n/2) > abs(a[p-1] - ans_n/2):
  ans_r = a[p-1]

print(ans_n, ans_r)
# Judge status: Accepted
n = int(input())
s = input()
cnt = 0
max_num = 0
for c in s:
    if c == 'I':
        cnt += 1
    else:
        cnt -= 1
    if max_num < cnt:
        max_num = cnt
print(max(max_num, 0))
# Judge status: Wrong Answer
N=input()
number=0
for a in N:
    if int(a)==9:
        print('Yes')
    else:
        number+=1
if number==2:
    print('No')
# Judge status: Wrong Answer
S=input()
if S[0]==S[1]:
    if S[2]==S[3] and S[0]!=S[2]:
        print("Yes")
elif S[0]==S[2]:
    if S[1]==S[3]:
        print("Yes")
elif S[0]==S[3]:
    if S[1]==S[2]:
        print("Yes")
else:
    print("No")
# Judge status: Accepted
a = [int(input()) for _ in range(5)]
z,ans = 123,0
for i in a:
    if i%10!=0:z = min(z,i%10)
    ans += 10*((i+10-1)//10)
print(ans+z-10 if (z!=123) or (z==0) else ans)
# Judge status: Accepted
if __name__ == "__main__":
    S = input()
    S = S[:3]
    print(S)
# Judge status: Wrong Answer
import queue
from collections import defaultdict
n,m = map(int,input().split())
g = defaultdict(set)
ans = [0]*n
for _ in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    g[a].add(b)
    g[b].add(a)

visited = [False]*n
visited[0] = True
q = queue.Queue()
q.put(0)
while not q.empty():
    v = q.get()
    for p in g[v]:
        if not visited[p]:
            ans[p] = v
            q.put(p)
            visited[p] = True
for x in ans[1:]:
    print(x+1)
# Judge status: Accepted
from fractions import gcd
def lcm(p,q):
    return p*q//gcd(p,q)
n,m = map(int, input().split())
a = list(map(int, input().split()))
x = 1
for i in range(n):
    a[i] = a[i]//2
    x = lcm(x,a[i])
for i in range(n):
    if (x//a[i])%2==0:
        print(0)
        exit()
p = m//x
print(p//2 if p%2==0 else p//2+1)
# Judge status: Accepted
n, W = map(int, input().split())
w, v = [], []
for _ in range(n):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)

dp = [[0 for _ in range(W+1)] for _ in range(n+1)]
for i in range(1, n+1):
    for j in range(0, W+1):
        if j - w[i-1] >= 0:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-w[i-1]] + v[i-1])
        else:
            dp[i][j] = dp[i-1][j]

print(dp[n][W])
# Judge status: Accepted
K, N = map(int, input().split())
A =  list(map(int, input().split()))

mini = K
right = left = K
for i in range(N):
	l_begin = i-1
	r_begin = i+1
	if i == 0:
		l_begin = N-1
		right = A[l_begin] - A[i]
		left = K - (A[r_begin]-A[i])
	elif i == N-1:
		r_begin = 0
		right = K - (A[i]-A[l_begin])
		left = A[i] - A[r_begin]
	else:
		right = K - (A[i]-A[l_begin])
		left = K - (A[r_begin]-A[i])
	local = min(right, left)
	if local < mini:
		mini = local
		

print(mini)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
cnt = [0] * n
for i in a:
    cnt[i-1] += 1
total = [0] * n
for i in range(n):
    total[i] = cnt[i] * (cnt[i] - 1) // 2
total_sum = sum(total)
for i in a:
    ans = total_sum
    ans -= total[i-1]
    ans += (cnt[i-1] - 1) * (cnt[i-1] - 2) // 2
    print(ans)
# Judge status: Accepted
def resolve():
    d, n = map(int, input().split())
    if n == 100:
        n = 101
    print((100 ** d) * n)
resolve()
# Judge status: Accepted
# input
n, a, b = map(int, input().split())
mod = 10 ** 9 + 7
al = (pow(2, n, mod) - 1)


# 参考：https://qiita.com/MyOden/items/b669bfbf6dbf83242bdf =>フェルマーの小定理を基に演算関数を用意
def fur(n, r):
    p, q = 1, 1
    for i in range(r):
        p = p * (n - i) % mod
        q = q * (i + 1) % mod
    return p * pow(q, mod - 2, mod) % mod


nca = fur(n, a)
ncb = fur(n, b)
ans = (al - nca - ncb) % mod

print(ans)
# Judge status: Wrong Answer
import sys
s = list(input())
t = list(input())
s.sort()
t.sort()
for x, y in zip(s, t[::-1]):
    if x > y:
        print('No')
        sys.exit()
    elif x == y:
        continue
    else:
        print('Yes')
        sys.exit()
if len(s) <= len(t):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
ab,bc,ca = map(int, input().split())
print(ab*bc//2)
# Judge status: Accepted
def main():

    S = input()
    return 'x' * len(S)
if __name__ == '__main__':
    print(main())
# Judge status: Accepted
import sys
from math import gcd

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, C, D = map(int, readline().split())

    L = C // gcd(C, D) * D
    c1, c2 = (A + C - 1) // C, B // C
    d1, d2 = (A + D - 1) // D, B // D
    l1, l2 = (A + L - 1) // L, B // L

    ans = (B - A + 1) - ((c2 - c1 + 1) + (d2 - d1 + 1) - (l2 - l1 + 1))
    print(ans)
    return


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))

amin=min(a)
amax=max(a)
if amin==amax:
    print(0)
    exit()
c=10000000000
r=0
for x in range(amin,amax+1):
    i=0
    for y in a:
        i+=(y-x)**2
    if c<i:
        c=i
        r=x
print(x)
# Judge status: Accepted
A, B, X = map(int, input().split())
print('YES' if A <= X <= A + B else 'NO')
# Judge status: Accepted
n,k = map(int , raw_input().split())
ais = map(int, raw_input().split())
for ii in range(k, n):
	print 'Yes' if ais[ii] > ais[ii - k] else 'No'
# Judge status: Accepted
s = sorted(input())
t = sorted(input(), reverse=True)

print("YNeos"[t <= s::2])
# Judge status: Accepted
def main():
    line = input()
    n, T = [int(x) for x in line.split()]
    lista_tempos = []
    lista_custos = []
    for i in range(n):
        line = input()
        c, t = [int(x) for x in line.split()]
        if t <= T:
            lista_tempos.append(t)
            lista_custos.append(c)
    if lista_tempos:
        print(min(lista_custos))
    else:
        print('TLE')
main()
# Judge status: Accepted
def main():
    N,Y = map(int,input().split())
    for i in range(Y//10000+1):
        for j in range(N-i+1):
            if Y == i *10000 + j * 5000 + (N-i-j) * 1000:
                print(*[i,j,N-i-j])
                return
    print(*[-1,-1,-1])
main()
# Judge status: Accepted
N=int(input())
xy=[list(map(int,input().split())) for _ in range(N)]
ans=0
for i in range(N):
    for j in range(i+1,N):
        d=((xy[i][0]-xy[j][0])**2+(xy[i][1]-xy[j][1])**2)**0.5
        ans+=2*d
print(ans/N)
# Judge status: Accepted
l = [int(input()) for i in range(5)]
k = int(input())
ans = 'Yay!'
if l[-1] - l[0] > k:
    ans = ':('
print(ans)
# Judge status: Wrong Answer
n = int(input())

ans = 0
for i in range(n):
    if i%3 !=0 and i%5!=0:
        ans += i
print(ans)
# Judge status: Accepted
N = int(input())
H = [int(i) for i in input().split()]

dp = [0]*N
dp[1] = abs(H[0] - H[1])

if N == 2:
    print(dp[-1])

else:
    for i in range(2, N):
        dp[i] = min(dp[i-2] + abs(H[i]-H[i-2]), dp[i-1] + abs(H[i]-H[i-1]))
    print(dp[-1])
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    s = input()
    t = input()
    ans = 0

    for i in range(len(s)):
        if s[i] != t[i]:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
s2 = ""
t2 = ""
for i in range(len(s)):
    s2+=s[i]
for i in range(len(t)):
    t2+=t[i]
dic = [s2,t2]
dic.sort() 
if s2 == t2:
    print("No")
    sys.exit()   
if dic[0] == s2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
a = []
b = []

for i in range(n):
    aa,bb = map(int, input().split())
    a.append(aa)
    b.append(bb)

a.sort()
b.sort()

if n%2 == 1:
    p = a[n//2]
    q = b[n//2]
    ans = q - p + 1

else:
    p1 = a[n//2 -1]
    p2 = a[n//2]
    q1 = b[n//2]
    q2 = b[n//2 - 1]
    p = (p1+p2)*5
    q = (q1+q2)*5 
    ans = (q-p)//5 + 1

print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
print(int(N%K==0))
# Judge status: Wrong Answer
s=input()
t=input()

if t[-2]==s:
    print('Yes')
    
else:
    print('No')
# Judge status: Wrong Answer
k=int(input())
i=1
seven='7'
if k%2==0:
    print(-1)
else:
    while int(seven)%k!=0:
        seven+='7'
        i+=1
    print(i)
# Judge status: Accepted
n = int(input())

l = [2,1]
for i in range(n):
    l.append(l[-1]+l[-2])

print(l[n])
# Judge status: Wrong Answer
from collections import defaultdict
n = int(input())
d = defaultdict(int)
for i in range(n):
    d[input()] += 1
for i in ['AC', 'WA', 'TLE', 'RE']:
    print(i+' X '+str(d[i]))
# Judge status: Wrong Answer
a,b,c = input().split()

if int(eval(a+b+c)) >= 22:
  print('bust')
else:
  print('win')
# Judge status: Wrong Answer
x,y=map(int, input().split())
if x==2 or y==2:
  print('No')

a=[4,6,9,11]
if x in a and y in a:
  print('Yes')
elif x not in a and y not in a:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
x, y, z = list(map(int, input().split()))

print(1 + (x - y) // (y + z))
# Judge status: Wrong Answer
n, m = map(int, input().split())
C = []
for i in range(n):
  a, b = map(int, input().split())
  C.append([a, b])
C.sort(reverse=True, key=lambda x:(x[1], x[0]))
ans = 0
for i in range(n):
  if m < C[i][0]: continue
  else: 
    ans += C[i][1]
    m -= i
print(ans)
# Judge status: Accepted
x,y=map(int,input().split());print(int(x+y/2))
# Judge status: Wrong Answer
s = sorted(list(str(input())))
t = reversed(list(str(input())))
#s.sorted()
#t.reverse()
S = str()
T = str()
for i in s:
    S += i
for k in t:
    T += k
print('Yes' if S<T else 'No')
# Judge status: Accepted
int_n, int_x, int_t = map(int, input().split()) 

#print(int_n, int_x, int_t)

if int_n % int_x == 0:
  print(int_n // int_x *int_t)
else:
  print(((int_n // int_x) + 1)*int_t)
# Judge status: Wrong Answer
h,n=map(int, input().split())
a=list(map(int, input().split()))
print("Yes" if h<sum(a) else "No")
# Judge status: Wrong Answer
n, m, a, b = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
x.sort()
y.sort()

if x[-1] < y[0]:
  for i in range(x[-1],y[0]+1):
    if a < i <= b:
      print("No War")
      exit()

print("War")
# Judge status: Wrong Answer
l=[int(input()) for i in range(5)]
k=int(input())

if (max(l)-min(l)) > 0:
    print(":(")
else:
    print("Yay!")
# Judge status: Accepted
N = int(input())
S = input()
ans = 0
for i in range(1, N):
  l = set(S[:i]); r = set(S[i:]);
  ans = max(ans, len(l & r))
print(ans)
# Judge status: Accepted
S = list(input())
S[3] = '8'
a = ''.join(S)
print(a)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
count=1
sign=0
for i in range(N-1):
    diff=A[i+1]-A[i]
    if sign*diff<0:
        count+=1
        sign=0
    elif sign==0:
        sign=diff
print(count)
# Judge status: Wrong Answer
# A - STring

N = 100000
X = input()
T_head = S_tail = 0

for i in range(N):
    if X[i]=='S':
        break
    T_head += 1

for i in range(N):
    if X[len(X)-i-1]=='T':
        break
    S_tail += 1

print(2*max(T_head, S_tail))
# Judge status: Accepted
n = int(input())
s = input()
while True:
  c = 0
  for i in range(len(s)):
    if s[i] == "(":
      c += 1
    else:
      c -= 1
    if c < 0:
      s = "(" + s
      break
  if c > 0:
    s = s + ")"
  if c == 0:
    print(s)
    break
# Judge status: Wrong Answer
X=int(input())

if (X%2==1)and(not(X==1)):
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
N = int(input())
X = list(map(int, input().split()))

ans = 0

for i in X:
  ans += (N-i)**2
 

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

n = int(input())
A = list(map(int, input().split()))
A = [min(8, a // 400) for a in A]
CA = Counter(A)
num = 0
for i in range(8):
    if i in CA:
        num += 1

num_8 = CA[8]
saidai = min(num + num_8, 8)

saisho = min(1, num)
print(saisho, saidai)
# Judge status: Wrong Answer
N=int(input(),10)
V = 10**9 + 7


ans = 1
for i in range(1, N+1):
    ans *= i % V
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=[-1,0]
i=0
while i<=n-1:
    res=0
    cnt=0
    m=2
    if a[i]==a[0] or a[i]==a[-1]:
        m=1
    while i+res<=n-1 and a[i+res]-a[i]<=m:
        if a[i+res]==a[i]:
            cnt+=1
        res+=1
    if res>ans[1]:
        ans[1]=res
        ans[0]=i
    i+=cnt
print(ans[1])
# Judge status: Accepted
N = int(input())
if N % 2 == 1:
  ans = int(N / 2) + 1
else:
  ans = int(N / 2)
  
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
X = list(map(int, input().split()))
P = []
N = []
for x in X:
    if x >= 0:
        P.append(x)
    else:
        N.append(x)

P.sort()
N.sort(reverse=True)
P = [0]+P
N = [0]+N
ans = 10**16
for a in range(k+1):
    b = k-a
    if a > len(P)-1 or b > len(N)-1:
        continue
    else:
        ans = min(ans, min(2*P[a]+(-1)*N[b], P[a]+2*(-1)*N[b]))
print(ans)
# Judge status: Accepted
k = int(input())

t = 7
t %= k

for i in range(k+1):
    if t == 0:
        print(i+1)
        break
    #常に余りを用いる　⇒　10**7桁の演算
    t = (t*10 + 7)%k
else:print(-1)

"""
else:
for(while)文を
break文で抜ける（真）　⇒　実行しない
forのイテラブルを使い切る、whileが偽になる　⇒　実行する
"""
# Judge status: Accepted
S = str(input())


if S[-1] == "s":
  print(S + "es")
else:
  print(S + "s")
# Judge status: Accepted
import collections
n=int(input())
c=collections.Counter(list(map(int,input().split())))
p=-1
for x in sorted(c.keys())[::-1]:
    if p==-1 and c[x]>=4:print(x*x);break
    elif p==-1 and c[x]>=2:p=x
    elif p!=-1 and c[x]>=2:print(p*x);break
else:print(0)
# Judge status: Wrong Answer
s=int(input())
n=1000000007
for i in range (1,667):
    if s<i*3:
        print((i-1)%n)
# Judge status: Wrong Answer
import itertools
import copy

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

N_all = list(itertools.combinations(N_list, len(N_list)-1))
for N_rem in N_all:
    count = 0
    num_list = list(itertools.combinations(N_rem,2))
    for i, j in num_list:
        if i==j:
            count+=1
    print(count)
# Judge status: Wrong Answer
import collections

N = int(input())
S = input()
ans = 0

r_index = [i for i, x in enumerate(S) if x == 'R']
g_index = [i for i, x in enumerate(S) if x == 'G']
b_index = [i for i, x in enumerate(S) if x == 'B']

for i in r_index:
    for j in g_index:
        for k in b_index:
            if abs(j-i) == abs(k-j):
                continue
            else:
                ans += 1
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

for n_iter in range(k):
    b = [0] * n
    for i in range(n):
        left = max(0, i - a[i])
        right = min(n-1, i + a[i])
        b[left] += 1
        if right + 1 < n: 
            b[right + 1] -= 1

    a[0] = b[0]
    for i in range(1, n):
        b[i] += b[i-1]
        a[i] = b[i]
    
    if n_iter >= 50:
        break

print(*a)
# Judge status: Wrong Answer
n, k = map(int,input().split())

sum = 0
cnt = 0

while True:
    sum += int(k**cnt)
    if sum <= n:
        cnt += 1
    else:
        break
print(cnt)
# Judge status: Wrong Answer
n = input()
s = str(n)
array = list(map(int, s))
if sum(array)%9 == 0 and sum(array)!=0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import heapq
from numpy import ceil,sum
N,M = (int(x) for x in input().split())
A = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(A)
for i in range(M):
    t1 = heapq.heappop(A)
    t2 = t1 / 2
    heapq.heappush(A, t2)
B = ceil(A)
print(int(sum(B)*(-1)))
# Judge status: Wrong Answer
k=int(input())
n=0
for a in range(k):
    a+=1
    for b in range(k):
        b+=1
        for c in range(k):
            c+=1
            s=1
            for d in range(k):
                d+=1
                if a>=d and b>=d and c>=d and a%d == 0 and b%d== 0 and c%d == 0:
                    s=s*d
            n+=s
print(n)
# Judge status: Accepted

s = input()

for i in range(1,len(s)):
    if s[i-1] == s[i]:
        print("Bad")
        exit()
print("Good")
# Judge status: Accepted
n,k=map(int,input().split())
s=input()
ans=s[:k-1]+s[k-1].lower()+s[k:]
print(ans)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())

l=sum([a==b,b==c,c==a])
print([1,2,0,3][l])
# Judge status: Wrong Answer
h, a = map(int, input().split())
if h <= a:
  print(1)
  quit()
c = 0
while h > a:
    c += 1
    a += a
print(c)
# Judge status: Accepted
a, b, c = map(int, input().split())
d = a + b
f = a + c
g = b + c
my_list = [d, f, g]
h = my_list.sort()
i = my_list[0]
print(i)
# Judge status: Accepted
n = int(input())
print(n*(n+1) // 2)
# Judge status: Accepted
(n,m),*e=[[*map(int, t.split())] for t in open(0)]
t=[[]for _ in range(n+1)]
for a,b in e:t[a]+=[b];t[b]+=[a]
q=[1]
a=[0]*-~n
while q:q=[a[j]==0and(a.__setitem__(j,i)or j)for i in q for j in t[i]]
print('Yes',*a[2:])
# Judge status: Wrong Answer
N,M = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(M)]
for i in range(10**N):
    stop = True
    for t in sc:
        if i//(10**(N-t[0]))%10 != t[1]:
            stop = False
    if stop:
        print(i)
        break
if stop:
    print(-1)
# Judge status: Wrong Answer
w,a,b = map(int,input().split())

x = b-(a+w)
y = a-(b+w)

if x<=0 or y<=0:
  print(0)
else:
  ans = min(x,y)
  print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
a,b = map(int,input().split())
s = input()
flag = 0
for i in range(a+b+1):
    if i < a or i > a :
        if s[i] == "-": flag = 1
        """if ord(s[i]) < 48 or ord(s[i]) > 57:
            flag = 1"""
    elif s[i] != "-":
        flag = 1
print("Yes" if flag == 0 else "No")
# Judge status: Accepted
K, S = map(int, input().split())

count = 0
for x in range(K+1):
    for y in range(K+1):
        if 0 <= S - (x+y) <= K:
            count += 1
print(count)
# Judge status: Accepted
n = input()
ans = 0
for i in range(len(n)):
    ans += int(n[i])
if ans == 1:
    ans = 10
print(ans)
# Judge status: Accepted
x,a,b = map(int,input().split())

print("A" if abs(x-a) <= abs(x-b) else "B")
# Judge status: Accepted
n,m,x,y=map(int,input().split())
x_=list(map(int,input().split()))
y_=list(map(int,input().split()))
x_.append(x)
y_.append(y)

if min(y_)>max(x_):
            print('No War')
else:
            print('War')
# Judge status: Wrong Answer
n = int(input())
print(800*n-200*(n/15))
# Judge status: Wrong Answer
from itertools import*
s=input()


x=[len(list(v)) for k,v in groupby(s)]

n=len(x)

ans=0
if s[0]=="<":
    ans+=(x[0]-1)*x[0]//2
    n-=1
    del x[0]
if s[-1]==">":
    ans+=(x[-1]-1)*x[-1]//2
    n-=1
for i in range(0,n,2):
    ma=max(x[i],x[i+1])
    mi=min(x[i],x[i+1])
    ans+=ma*(ma+1)//2
    ans+=(mi-1)*mi//2
print(ans)
# Judge status: Wrong Answer
print(["Yes","No"][int(input())<int(input())%500])
# Judge status: Wrong Answer
# coding:utf-8

S = input()
n = S.count('N')
s = S.count('S')
e = S.count('E')
w = S.count('W')
print(n, s, e, w)

if (n == 0 and s != 0) or (n != 0 and s == 0):
    print('No')
elif (e == 0 and w != 0) or (e != 0 and w == 0):
    print('No')
else:
    print('Yes')
# Judge status: Accepted
n = int(input())
count = 0
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        count += 1
    else:
        continue
print(count)