peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import math
n,d = map(int,input().split())

y = list()
x = list()
xy = list()

for i in range(n):
    xy += map(int,input().split())

#xy_2 = int(len(xy) / 2)
#for i in range(xy_2):
#    x.append(xy.pop(0))
#    y.append(xy.pop(0))

for i in range(n):
    x.append(xy.pop(0)**2)
    y.append(xy.pop(0)**2)

x.sort()
y.sort()

ans = 0
for i in range(int(len(x))):
    if d >= math.sqrt(x.pop(0) + y.pop(0)):
        ans += 1
    else:
        break

print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
list=[]
seikai=0
sum=0
for i in range(m):
  p,s=input().split()
  if p not in list:
    if s=='AC':
      list.append(p)
      seikai=seikai+1
    elif s=='WA':
      sum=sum+1
print(seikai,sum)
# Judge status: Accepted
x,y = map(int,input().split())
mod = 10**9+7
def comb(a,b):
  comb = 1
  chld = 1
  for i in range(b):
    comb = comb*(a-i)%mod
    chld = chld*(b-i)%mod
  return (comb*pow(chld,mod-2,mod))%mod
if (x+y)%3!=0:
  print(0)
else:
  nm = (x+y)//3
  n = y-nm
  m = x-nm
  if n>=0 and m>=0:
    print(comb(n+m,m))
  else:
    print(0)
# Judge status: Accepted
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
def main():
    N,K = map(int,input().split())
    print(len(str(Base_10_to_n(N,K))))
main()
# Judge status: Wrong Answer
from collections import defaultdict

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

A.sort(reverse=True)

for i in A:
  D[i] += 1

cnt1 = 0
ans1 = 1
cnt2 = 0
ans2 = 1

for i, x in D.items():
  if x >= 4:
    ans2 *= i**2
    cnt2 += 2
  if x >= 2:
    ans1 *= i
    cnt1 += 1
  if cnt1 == 2:
    print(max(ans1, ans2))
    exit()

if cnt2 == 2:
  print(ans2)
else:
  print(0)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import math
# 整数の入力
n, m = map(int, input().split())
li = list(map(int, input().split()))
# 計算
a = n-sum(li)
if 0 <= n:
    print(a)
else:
    print(-1)
# Judge status: Accepted
N,R = map(int,input().split())
if N>=10:
  print(R)
else:
  print(R+100*(10-N))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
allL = sum(A)
L, mL = 0, float('inf')
for i in range(N):
    L += A[i]
    if abs(2*L-allL) < mL:
        mL = abs(2*L-allL)
    else:
        break
print(mL)
# Judge status: Wrong Answer
S = input( '今日の天気は？' )

if S == 'Sunny':
    answer = 'Cloudy'
elif S == 'Cloudy':
    answer = 'Rainy'
elif S == 'Rainy':
    answer = 'Sunny'
else:
    answer = '入力間違い【Sunny】【Cloudy】【Rainy】を入力'

print(answer)
# Judge status: Accepted
k = int(input())

x = 100
cnt = 0

while(1):
    x *= 1.01
    x = int(x)
    cnt += 1
    if x >= k:
        break
        
print(cnt)
# Judge status: Accepted
from collections import Counter

N = int(input())
S = [input() for i in range(N)]

c = Counter(S)
l = list(c.most_common())
A = []
for i,j in l:
    if j == l[0][1]:
        A.append(i)

A.sort()

for i in A:
    print(i)
# Judge status: Accepted
# Papers, Please

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

for Ai in A:
  if Ai % 2 == 1:
    continue
  else:
    if Ai % 3 != 0 and Ai % 5 != 0:
      print("DENIED")
      exit()

print("APPROVED")
# Judge status: Accepted
N=int(input())
p=list(map(int,input().split()))
t=0
for i in range(N):
  if i!=N-1:
    if p[i]==i+1:
      s=p[i+1]
      p[i]=s
      p[i+1]=i+1
      t+=1
  else:
    if p[i]==i+1:
      u=p[i-1]
      p[i]=u
      p[i-1]=i+1
      t+=1
print(t)
# Judge status: Wrong Answer
n,k=map(int,input().split())
A=list(map(int,input().split()))

def culc(L):
    subL=[0]*(n+1)

    for i in range(n):
        temp=L[i]
        bottom=max(i-temp,0)
        top=min(i+temp,n-1)

        subL[bottom]+=1
        subL[top+1]-=1
    
    resL=[0]*n
    resL[0]=subL[0]
    for i in range(1,n):
        resL[i]=resL[i-1]+subL[i]

    return resL

for i in range(min(k,45)):
    A=culc(A)

print(A)
# Judge status: Accepted
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    ans = 0
    for i in reversed(range(N)):
        reduce2 = min(A[i+1],B[i])
        reduce1 = min(A[i], B[i]-reduce2)
        A[i] -= reduce1
        ans += reduce1 + reduce2
    print(ans)


if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
x=int(input())
d,m=divmod(x,11)
ans=2*d
if m<7:
  ans+=1
else:
  ans+=2
print(ans)
# Judge status: Accepted
x = int(input())

def is_prime(n):
  if n <= 1: return False
  for i in range(2, int(n**0.5)+1):
    if n % i == 0: return False
  return True

if not is_prime(x):
  while not is_prime(x):
    x += 1
print(x)
# Judge status: Wrong Answer
n=int(input())

dp=[[0]*n for _ in range(2)]

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

dp[0][0]=a[0]

for i in range(n-1):
    dp[0][i+1]=dp[0][i]+a[i+1]

for i in range(n-1):
    dp[1][i+1]=max(dp[0][i+1],dp[1][i])+b[i+1]
    
print(dp[1][n-1])
# Judge status: Wrong Answer
# coding: utf-8
# Your code here!

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


for a in range(1,101):
    if int(a * 0.1) == y:
        if int(a * 0.08) == x:
            print(a)
            exit()
print(-1)
# Judge status: Accepted
n=int(input())
ans=[]
for i in range(55000):
  if int(i*1.08)==n:
    ans.append(i)
if ans==[]:
  print(':(')
else:
  print(ans[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()))
sum = 0

A.append(0)

for i in range(N):
  sum += B[A[i]-1]
  if A[i+1] == A[i] + 1:
    sum += C[A[i]-1]
  print(sum)

print(sum)
# Judge status: Wrong Answer
n, m = map(int, input().split())

result = {}
c_cnt = 0
w_cnt = 0
for i in range(m):
    p, s = input().split()
    if (p in result):
        continue
        
    if (s == 'AC'):
        result[p] = 1
        c_cnt = c_cnt + 1
    else:
        w_cnt = w_cnt + 1

print('{} {}'.format(c_cnt, w_cnt))
# Judge status: Accepted
sx,sy,tx,ty = map(int, input().split())
x = tx-sx
y = ty-sy

ans = []
ans = ans + ['R']*x
ans = ans + ['U']*y

ans = ans + ['L']*x
ans = ans + ['D']*y

ans = ans + ['D']
ans = ans + ['R']*(x+1)
ans = ans + ['U']*(y+1)
ans = ans + ['L']

ans = ans + ['U']
ans = ans + ['L']*(x+1)
ans = ans + ['D']*(y+1)
ans = ans + ['R']

print(''.join(ans))
# Judge status: Accepted
#!/usr/bin/env python3
A, B = map(int, input().split())
ans = (A + B) % 24
print(ans)
# Judge status: Wrong Answer
N = int(input())
rests = []

for i in range(1, N+1):
    S, P = input().split()
    rests.append((S, int(P), i))

rests.sort(key=lambda x: x[0]+str(100-x[1]) if x[1]!=0 else x[0]+"999")
for rest in rests:
    print(rest[2])
# Judge status: Accepted
e_r, e_g, n_r, n_g, n_n = map(int, input().split())
red = list(map(int, input().split()))
green = list(map(int, input().split()))
none = list(map(int, input().split()))
 
red.sort(reverse=True)
green.sort(reverse=True)
none.sort(reverse=True)

eat_r = red[0:e_r]
eat_g = green[0:e_g]

eat = eat_r + eat_g
eat.sort()

for i in range(len(eat)):
  if len(none) > 0 and eat[i] < none[0]:  
    eat[i] = none.pop(0)

print(sum(eat))
# Judge status: Wrong Answer
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.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b = rm()
if a == b:
  print(a*b)
else:
  print(max(a, b)*2-1)
# Judge status: Wrong Answer
n=str(input())
m=len(n)
if list(set(n))==['9']:
    print(9*m)
else:
    print(9*(m-1)+int(n[0])-1)
# Judge status: Wrong Answer
S = input()
Ss = '{}s'.format(S) if not S.endswith('s') else '{}es'.format(S)
# Judge status: Accepted
n = int(input())
T = [0]*n
c,s,f = [0]*(n-1),[0]*(n-1),[0]*(n-1)
 
for i in range(n-1):
	c[i],s[i],f[i] = map(int,input().split())

for	i in range(n-1):
	T[i] = s[i] + c[i]
	for j in range(i+1,n-1):
		if T[i] > s[j]:
			T[i] += (-T[i])%f[j] + c[j]
		else:
			T[i] = s[j] + c[j]
	print(T[i])
print(0)
# Judge status: Wrong Answer
N,K=map(int,input().split())
lst=[]
for i in range (N):
    h=int(input())
    lst.append(h)
lst.sort()
ans=100000000
for i in range (N-K+1):
    ans=min(ans,lst[i+K-1]-lst[i])
print(ans)
# Judge status: Accepted
import heapq as hp
n,m=map(int,input().split())
AB=[[] for i in range(m+1)]

for i in range(n):
  a,b=map(int,input().split())
  if a<=m:
    AB[a].append(-b)

ans=0
l=[]
hp.heapify(l)
for ab in AB:
  for t in ab:
    hp.heappush(l,t)
  if len(l)>0:
    ans-=hp.heappop(l)
print(ans)
# 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))  # 各要素を-1倍
heapq.heapify(a)  # リストを優先度付きキューへ
for _ in range(M):
    number=heapq.heappop(a)  # 最大値の取り出し
    if number%2==0:
        number=number//2
    else:
        number=number//2+1
    heapq.heappush(a, number)  # 要素の挿入
print(-sum(a))
# Judge status: Wrong Answer
data = input()
if data >= "a" and data <= "z":
    print("a")
elif data >= "A" and data <= "Z":
    print("a")
# Judge status: Accepted
n = int(input())
m = [(x, 0) for x in range(1, n+1)]

for i, x in enumerate(map(int, input().split())):
  m[i] = (m[i][0], x)
m.sort(key=lambda x : x[1])
print(' '.join([str(x[0]) for x in m]))
# Judge status: Accepted
s = input()
zero = s.count('0')
one = s.count('1')
if zero <= one:
    print(2 * zero)
else:
    print(2 * one)
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a % b == 0:
  print(0)
else:
  print((a // b) - (a % b))
# Judge status: Accepted
g=[0,1,3,1,2,1,2,1,1,2,1,2,1]
x,y=map(int,input().split())
if g[x]==g[y]: print("Yes")
else: print("No")
# Judge status: Accepted
A,B,C = map(int, input().split())
ctr = 0
if A == B == C and A%2 == 0 and B%2 == 0 and C%2 == 0:
  print(-1)
else:
  while A%2 == 0 and B%2 == 0 and C%2 == 0:
    A,B,C = int((B+C)/2), int((A+C)/2), int((A+B)/2)
    ctr += 1
  print(ctr)
# Judge status: Accepted
n = int(input())
cnt = 0
ans = "No"
for i in range(n):
    d1, d2 = map(int,input().split())
    if d1 == d2:
        cnt += 1
    else:
        cnt = 0
    if cnt == 3:
        ans = "Yes"
print(ans)
# Judge status: Accepted
import math
from collections import namedtuple

Station = namedtuple('Station', 'c s f')

N = int(input())
stations = []
for _ in range(N - 1):
  c, s, f = map(int, input().split())
  stations.append(Station(c, s, f))

  
def measure(start):
  if start > len(stations) - 1:
    return 0
  
  time = 0
  for station in stations[start:]:
    depart_at = station.s\
      if station.s >= time\
      else math.ceil(time / station.f) * station.f
    time = depart_at + station.c
  return time

for i in range(N):
  print(measure(i))
# Judge status: Accepted
h1, m1, h2, m2, k = map(int, input().split())
s = (h2 * 60 + m2) - (h1 * 60 + m1)
if s > k:
    print(s - k)
else:
    print(0)
# Judge status: Accepted
import sys

def count(n, b):
    res = 0
    while n:
        n, r = divmod(n, b)
        res += r
    return res

n = int(sys.stdin.readline().rstrip())

def main():
    res = float('inf')
    for i in range(n + 1):
        res = min(res, count(i, 6) + count(n - i, 9))
    print(res)

if __name__ ==  '__main__':
    main()
# Judge status: Accepted
import numpy as np

a = [list(map(int,input().split())) for _ in range(3)]

n = int(input())

b = list([int(input()) for _ in range(n)])

c = np.zeros(9).reshape(3,3)

for k in b:
    for i in range(3):
        for j in range(3):
            if k == a[i][j]:
                c[i,j]=1

if (max(c.sum(axis=0))==3) or (max(c.sum(axis=1))==3) or \
    (sum([c[i,i] for i in range(3)])==3) or (c[2,0]+c[1,1]+c[0,2]==3):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
A, B, T = map(int, input().split())
print((T//A) * B)
# Judge status: Accepted
a = int(input())
for i in range(a,10**7):
  result=[x for x in range(1,i+1) if i%x==0]
  if len(result)==2:
    print(i)
    break
# Judge status: Accepted
s=input()
if s=='Sunny':print('Cloudy')
elif s=='Cloudy':print('Rainy')
else:print('Sunny')
# Judge status: Accepted
x,y = map(int, input().split())
cnt=0
while True:
    if x>y:
        break

    else:
        x = x*2
        cnt+=1

print(cnt)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split(' ')))
B = []
i = 0
while i < n:
    B.append((A[i],i+1))
    i += 1
B.sort()
ans = ''
for b in B:
    ans += str(b[1]) + ' '
print(ans)
# Judge status: Wrong Answer
from collections import defaultdict
d = defaultdict(int)
d["DEFAULT"]=0

n=int(input())
for _ in range(n):
  d[input()]+=1

n=int(input())
for _ in range(n):
  d[input()]-=1
  
print(d[max(d)])
# Judge status: Accepted
import sys
n,l=input().split()

n=int(n)
l=int(l)
v=[]
vv=[]
for i in range(1,n+1):
    v.append(abs(l+i-1))
    vv.append(l+i-1)
v.sort()
#print(v)
#print(vv)
ss=sum(vv)
for i in range(1,n+1):
    if abs(l+i-1)==v[0]:
        print(ss-(l+i-1))
        sys.exit()
#print(ss-v[0])
# Judge status: Accepted
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()


ok = [True] * N
d = {"r": P, "s": R, "p": S}
ans = 0
for i in range(N):
    if i >= K and T[i - K] == T[i] and ok[i - K]:
        ok[i] = False
    if ok[i]:
        ans += d[T[i]]
print(ans)
# Judge status: Accepted
x, y = [int(i) for i in input().split()]

if y % 2 != 0:
    print("No")
    exit()

if 2*x - y/2 >= 0 and y/2 - x >= 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b, c = map(int, input().rstrip().split())
print(c,a,b)
# Judge status: Wrong Answer
import collections
N = int(input())
A = sorted(list(map(int, input().split())))
a = collections.Counter(A)
ans = [0, 0]
for i in a.keys():
    if a[i] >= 2:
        ans.append(i)
    if a[i] >= 4:
        ans.append(i)
print(ans[-1]*ans[-2])
# Judge status: Wrong Answer
import sys

N = int(input())

for i in range(N//4):
    if (N-4*i)%7 == 0:
        print("Yes")
        sys.exit()

print("No")
# Judge status: Accepted
N = int(input())
if N // 10 == 9 or N % 10 == 9:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
box = list(map(int,input().split()))
box.reverse()
print("%d %d %d"%(box[0],box[1],box[2]))
# Judge status: Wrong Answer
n = int(input())
print((n**0.5//1)**2)
# Judge status: Accepted
A = int(input())
B = list(map(int,input().split(" ")))
memory = 1
for i in range(A):
    if B[i] == memory:
        memory += 1
    else:
        continue
if A-(memory-1) == A:
    print("-1")
else:
    print(A-(memory-1))
# Judge status: Accepted
from math import gcd
n = int(input())
a = list(map(int, input().split()))

pref = [0]; suff = [0]

for i in range(n):
    pref.append(gcd(pref[-1], a[i]))

for i in range(n-1, -1, -1):
    suff.append(gcd(suff[-1], a[i]))

suff.reverse()

ans = pref[-1]

for i in range(len(pref)-1):
    ans = max(ans, gcd(pref[i], suff[i+1]))

print(ans)
# Judge status: Wrong Answer
import sys
import math

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

ans = 0

if (N + M) % 2 == 0:
  if N != M:
    print(0)
    sys.exit()

  ans = (math.factorial(N) * 2 * 2) % (10**9 + 7)

else:
  if not N == M - 1 and not N - 1 == M:
    print(0)
    sys.exit()

  ans = (math.factorial(N) * math.factorial(M)) % (10**9 + 7)

print(ans)
# Judge status: Wrong Answer
print('yes' if len(set(input())) == 26 else 'no')
# Judge status: Wrong Answer
n=int(input())
x=list(map(int,input().split()))
p=sum(x)//n+1
answer=0
for i in range(n):
    answer+=(x[i]-p)**2
print(answer)
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())
if (a-1)//d >= (b-1)//c:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
A, B, M = [int(i) for i in input().split()]
al = [int(i) for i in input().split()]
bl = [int(i) for i in input().split()]
xyc = [[int(i) for i in input().split()] for _ in range(M)]

print(min(min(al)+min(bl), min([al[m[0]-1] + bl[m[1]-1] - m[2] for m in xyc])))
# Judge status: Wrong Answer
x, y = map(int,input().split())
if x*(y-1)//y != 0:
  print(x*(y-1))
else:
  print(-1)
# Judge status: Wrong Answer
N = int(input())
L = [i for i in map(int,input().split())]
L.sort()

import bisect
ans = 0
for i in range(1,N):
  for j in range(i):
    index = bisect.bisect(L,L[i]+L[j])
    if index <= i+1:
      continue
    ans += len(L[i+1:index])
    
print(ans)
# Judge status: Accepted
import math
from collections import Counter

n = int(input())
s = [Counter(list(input())) for _ in range(n)]
a = [math.inf] * 26
flag = [0] * 26
ans = ""
for i in s:
    ke = list(i.keys())
    val = list(i.values())
    for j, k in enumerate(ke):
        a[ord(k) - 97] = min(a[ord(k) - 97], val[j])
        flag[ord(k) - 97] += 1
for v in range(len(a)):
    if a[v] != math.inf and flag[v] >= n:
        ans += a[v] * chr(97 + v)
print(ans)
# Judge status: Accepted
N,K = map(int,input().split())
h = [0] + list(map(int,input().split()))

dp = [0] * (N+1)

for i in range(2,N+1):
    scope = min(i-1,K)
    jump = [dp[i-j]+abs(h[i]-h[i-j]) for j in range(1,scope+1)]
    dp[i] = min(jump)

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

import itertools

ans = 0
for tmpr in itertools.combinations(list(range(len(L))),3):
    a,b,c = L[tmpr[0]],L[tmpr[1]],L[tmpr[2]]
    if a!=b and b!=c and a!=c:
        if a+b>c and a+c>b and b+c > a:
            ans+=1
   
print(ans)
# Judge status: Accepted
import numpy as np
n, targw = map(int,input().split())
w = [0 for _ in range(n)]
v = [0 for _ in range(n)]
for i in range(n):
	w[i], v[i] = map(int,input().split())
dp = np.zeros(targw+1, dtype=np.int64)
for i in range(n):
	dp[w[i]:] = np.maximum(dp[:-w[i]] + v[i], dp[w[i]:])
print(dp[targw])
# Judge status: Accepted
A, B = map(int, input().split())

if (A == 1) and (B != 1):
    print("Alice")

elif (A != 1) and (B != 1) and (A > B):
    print("Alice")

elif (B == 1) and (A != 1):
    print("Bob")

elif (B != 1) and (A != 1) and (A < B):
    print("Bob")

elif (A == B):
    print("Draw")
# Judge status: Wrong Answer
N = int(input())
P = list(map(int, input().split()))

count = 1
minP = P[0]
for i in range(1, N):
    if P[i] < minP:
        count = count + 1
    minP = P[i]

print(count)
# Judge status: Accepted
def main():
    N = int(input())
    H = [int(h) for h in input().split()]

    increase = True
    for i in reversed(range(1, N)):
        if H[i] >= H[i-1]:
            pass
        elif H[i-1] - H[i] == 1:
            H[i-1] -= 1
        else:
            increase = False
            break

    if increase:
        print("Yes")
    else:
        print("No")
        
if __name__ == "__main__":
    main()
# Judge status: Accepted
def main():
    a = [int(i) for i in input().split()]

    print("Yes" if len(set(a)) == 2 else "No")



if __name__ == "__main__":
    main()
# Judge status: Accepted
x = int(input())
if x % 2 == 0:
    print(int(x/2)**2)
else:
    print(int((x+1)/2*(x-1)/2))
# Judge status: Wrong Answer
a, b = map(int,input().split())

if (a*b)%2==1:
  print((a*b)//2+1)
else:
  print(a*b/2)
# Judge status: Accepted
t = input()
ans = ""
j = 0
for i in t:
    if i in ["?"]:
        ans += "D"
    else:
        ans += i
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    alist = map(int, input().split())

    print(" ".join(
        [str(i + 1) for i, _ in sorted(enumerate(alist), key=lambda x: x[1])]))


main()
# Judge status: Accepted
h, n = map(int, input().split())
a = map(int, input().split())
if sum(a) < h:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
import math
print(2*math.pi*int(input()))
# Judge status: Accepted
a,b,c,k=map(int,open(0).read().split())
while a>=b:b+=b;k-=1
while b>=c:c+=c;k-=1
print('YNeos'[k<0::2])
# Judge status: Accepted
n, k = map(int, input().split())
ans = []
for i in range(k):
    x = int(input())
    x = list(map(int, input().split()))
    for j in x:
        ans.append(j)
ans = set(ans)
cnt = 0
for i in range(1, n+1):
    if not i in ans:
        cnt += 1
print(cnt)
# Judge status: Accepted
N = int(input())
div = int(N / 1.08)
if int(int(div) * 1.08) == N:
    print(div)
elif int(int(div + 1) * 1.08) == N:
    print(div + 1)
else:
    print(":(")
# Judge status: Wrong Answer
def calculate(N,X,T):
    x = N // X
    if x ==0:
        return T
    elif not N % X == 0:
        return (x + 1)*T;
    else:
        return x*T
N,X,T = 100,20,30
result = calculate(N,X,T)
print(result)
# Judge status: Accepted
n,m,x,y = map(int,input().split())
xlist = list(map(int,input().split()))
ylist = list(map(int,input().split()))
if max(xlist)<y and x<min(ylist) and max(xlist)<min(ylist):
    print("No War")
else:
    print("War")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
cnt = 1
	
status = 0
for i in range(N-1):
	if A[i] > A[i+1]:
		if status == 0: status = 1
		elif status == -1:
			status = 0
			cnt += 1
	elif A[i] < A[i+1]:
		if status == 0: status = -1
		elif status == 1:
			status = 0
			cnt += 1
print(cnt)
# Judge status: Accepted
a,b,c=input().split()

if a==b==c:
    print("1")
elif a==b or b==c or c==a:
    print("2")
else:
    print("3")
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())

if abs(a-c) <= d or abs(b-c) <= d:
    print('Yes')
else:
    print('No')

# aとcが直接的もしくはbとcが直接的だと成り立つ
# or構文に変更
# Judge status: Accepted
s = input()
k = int(input())
ans = 1
for i in range(k):
    if s[i] != '1':
        ans = s[i]
        break
print(ans)
# Judge status: Accepted
n = int(input())
d = list(map(int, input().split()))
mod = 998244353

a = [0] * n
for d_ in d:
    a[d_] += 1

res = d[0] == 0 and a[0] == 1
pre = 1
for a_ in a:
    res *= pre ** a_
    res %= mod
    pre = a_

print(res)
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))
if n <= k:
  print("0")
else:
  h.sort(reverse=True)
  h_new = h[k:]
  print(sum(h_new))
# Judge status: Accepted
s = input()

hi = 'hi'

if s =='hi' or s == 'hihi' or s == 'hihihi' or s == 'hihihihi' or s == 'hihihihihi':
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
l = [[0] * 10 for _ in range(10)]
ans = 0

for i in range(N):
    s = int(str(i)[0])
    t = int(str(i)[-1])
    l[s][t] += 1

for i in range(1, 10):
    for j in range(1, 10):
        ans += l[i][j] * l[j][i]
print(ans)
# Judge status: Accepted
h,w=map(int,input().split())
if h==1 or w==1:
    print(1)
    exit()
print(-(-h*w//2))
# 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)

c = read().decode("utf-8")
l = [chr(ord('a') + i) for i in range(26)]

if c == "z":
    print("a")
    quit()

f = False
for a in l:
    if a == c:
        f = True
        continue
    if f:
        print(a)
        quit()
# Judge status: Accepted
import sys
from math import gcd

def solve(K: int):

    ans = 0

    for i in range(1, K+1):
        for j in range(1, K+1):
            for k in range(1, K+1):
                ans += gcd(gcd(i, j), k)

    print(ans)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    solve(K)

if __name__ == '__main__':
    main()
# Judge status: Accepted
S = input()
Sn = S.replace('2017','2018')
print(Sn)
# Judge status: Accepted
import sys
from itertools import combinations
import math


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


N = I()
A = LI()

A.sort()
A = A[::-1]
alice = 0
bob = 0
flag = 0
for i in A:

    if flag % 2 == 0:
        alice += i
    else:
        bob += i
    flag += 1
print(alice-bob)
# Judge status: Accepted
n = int(input())
s = sorted([int(input()) for _ in range(n)])
a = sum(s)
if a % 10:
  print(a)
else:
  for si in s:
    if si % 10:
      print(a - si)
      break
  else:
    print(0)
# Judge status: Accepted
import sys
S = "".join(sorted(input()))
T = "".join(sorted("".join(sorted(input())), reverse=True))
print("Yes" if S < T else "No")