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

N = int(input())
A = map(int, input().split())
A_count = dict(collections.Counter(A))
A_countsort = sorted(A_count, reverse=True)
# print(A_countsort)
hen_list = []
for key in A_countsort:
    if A_count[key] >= 4:
        hen_list.append(key)
        hen_list.append(key)
    elif A_count[key] >= 2:
        hen_list.append(key)

if len(hen_list) >= 2:
    print(hen_list[0]*hen_list[1])
else:
    print(0)
# Judge status: Accepted
n, m = map(int, input().split())

if n % 2 == 1:
    for i in range(m):
        print(1+i, n-1-i)
else:
    for i in range(m):
        if i % 2 == 0:
            print(n//2-i//2, n//2+1+i//2)
        else:
            print(1+i//2, n-1-i//2)
# Judge status: Accepted
n = int(input())
ans = 0
def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table

t = num_divisors_table(n)
for i in range(1,n+1):
  ans += t[i]*i

print(ans)
# Judge status: Wrong Answer
import numpy as np
n = int(input())
a = [int(i)- k-1 for k,i in enumerate(input().split())]
ans = 10**9
a = np.array(a,dtype = 'int64')
sum_a = np.sum(a)
var_f = np.floor(sum_a / n)
var_c = np.ceil(sum_a / n)
b = a - int(var_f)
d = a - int(var_c)
c = np.abs(b)
e = np.abs(d)

print(min(np.sum(c),np.sum(e)))
# Judge status: Wrong Answer
import math
n,k = map(int, input().split())
a = list(map(int, input().split()))
loc = a.index(1) + 1
upper = math.ceil((n - loc) / (k - 1))
lower = math.ceil((loc - 1) / (k - 1))
print(upper + lower)
# Judge status: Accepted
n, m = map(int, input().split())
scs = [tuple(map(int, input().split())) for _ in range(m)]

mi = 0
if 2 <= n:
    mi += 10 ** (n - 1)
ma = 10 ** n
ans = -1

for i in range(mi, ma):
    st = str(i)
    tmp = True
    for j in range(m):
        if (int(st[scs[j][0] - 1]) != scs[j][1]):
            tmp = False
    if tmp:
        ans = i
        break
print(ans)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))
L.sort()
cnt = 0
for i in range(N):
  Li = L[i]
  for j in range(N):
    Lj = L[j]
    if Li != Lj:
      for k in range(N):
        Lk = L[k]
        if Lk != Lj and Lk != Li:
          if Lk < Li + Lj:
            cnt += 1
print(cnt)
# Judge status: Accepted
s = input()
if int(s[5:7]) <= 4 and int(s[8:10]) <= 30:
    print('Heisei')
else:
    print('TBD')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

A_set = set(A)

if len(A) == len(A_set):
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
N = int(input())

sum = 266666333332
for i in range(N):
  if(i % 3 != 0 and i % 5 != 0):
    sum += i

print(sum - 266666333332)
# Judge status: Wrong Answer
A, B = map(int, input().split())

if A % 2 != B % 2:
  print("IMPOSSIBLE")
elif A >= B:
  print(A - int((A + B) / 2))
else:
  print(B - int((A + B) / 2))
# Judge status: Accepted
A, B = map(int, input().split())

ans = (A+B) % 24
print(ans)
# Judge status: Wrong Answer
N = int(input())
a = map(int, input().split())
# N = 3
# a = [200, 300, 500]

s = sorted(a)
t = 0
result = 0
if len(s) == 1:
    result = s[0]
    
for i in range(0, N-1):
    if i == N - (N - 1):
        result = (t + s[i+1]) / 2
    z = (s[i] + s[i+1]) / 2
    t = z
print(result)
# Judge status: Accepted
L, R = map(int, input().split())

ans = 10 ** 9
for i in range(L, R):
    for j in range(i+1, R+1):
        tmp = (i*j)%2019
        if ans > tmp:
            ans = tmp
        if ans == 0:
            break
    else:
        continue
    break
print(ans)
# Judge status: Accepted
n = int(input())

ans_b = []
ans_n = ['a']

s = ['a','b','c','d','e','f','g','h','i','j']

for i in range(1,n):
    ans_b = ans_n.copy()
    ans_n = []
    for j in ans_b:
        plus = 1
        ans_n.append(j+'a')
        while( j.count(s[plus-1]) > 0):
            ans_n.append(j+ s[plus])
            plus += 1

ans = sorted(ans_n)

for i in ans:
    print(i)
# Judge status: Accepted
n = int(input())
min = float('inf')
for _ in range(5):
    i = int(input())
    if min > i:
        min = i

if n % min == 0:
    ans = n // min + 4
else:
    ans = n // min + 5

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

a = sorted(a)

M = []
cn = 0

for i in range(N):
    x = x - a[i]


    
    if x >= 0 and i != N-1: 
        cn = cn + 1
    elif x < 0:
        print(cn)
        break
    elif i == N-1:
        if x == 0:
            cn = cn + 1
            print(cn)
            break
        else:
            print(cn)
            break
# Judge status: Accepted
N = int(input())
L = list()
As, Bs= list(),list()
for i in range(N):
    A,B = map(int,input().split())
    L.append([A,B])
    As.append(A)
    Bs.append(B)

As.sort()
Bs.sort()
if N % 2 == 0:
    mins = (As[N//2] + As[N//2-1]) / 2.0
    maxs = (Bs[N//2] + Bs[N//2-1]) / 2.0
    print(int((maxs-mins)/0.5)+1)
else:
    mins,maxs = As[N//2], Bs[N//2]

    print(int(maxs-mins)+1)
# Judge status: Wrong Answer
a, b = map(int, input().split())

A = a + b
if A%3== 0:
    print('Possible')
else:
    print('Impossible')
# Judge status: Accepted
def main():
  s=input()
  flg=0
  if s.count(s[0])!=2:
    flg=1
  s=s.replace(s[0],'')
  if len(s)>0 and s.count(s[0])!=2:
    flg=1
  if flg==1:
    print('No')
  else:
    print('Yes')  
main()
# Judge status: Accepted
import numpy as np

N,M=map(int,input().split())
A=np.array([list(input()) for _ in range(N)])
B=np.array([list(input()) for _ in range(M)])

bl=False
for i in range(N-M+1):
  for j in range(N-M+1):
    if (A[i:i+M,j:j+M]==B).all():
      bl=True

answer='Yes' if bl else 'No'
print(answer)
# Judge status: Accepted
from itertools import combinations
N,M = map(int,input().split())

a= list(combinations(range(N),2))
b= list(combinations(range(M),2))
print(len(a)+len(b))
# Judge status: Accepted
import math
A,B = map(int,input().split())
print(math.ceil((B - A) / (A - 1)) + 1)
# Judge status: Wrong Answer
number = int(input())

sides = [int(val) for val in input().split(' ')]

print(sum(sides))
print(max(sides))
# Judge status: Accepted
s = list(input())
ans = 0
if len(s)%2==0:
    s = s[:-2]
else:
    s.pop(-1)

while len(s)>0:
    if s[0:int(len(s)/2)]==s[int(len(s)/2):len(s)]:
        ans = len(s)
        break
    else:
        s = s[:-2]
        
print(ans)
# Judge status: Accepted
n,m = map(int,input().split())
ans = []
l = []
for i in range(n):
    if i == 0:
        ans = list(map(int,input().split()))
        ans.pop(0)
    else:
        l = list(map(int,input().split()))
        l.pop(0)
        ans = set(ans) & set(l)
print (len(ans))
# Judge status: Accepted
n,m=map(int,input().split())
mist=[0 for i in range(m)]
for j in range(n):
    temp=list(map(int,input().split()))
    for s in range(1,len(temp)):
        mist[temp[s]-1]+=1

ans=sum(1 for x in mist if x==n)

print(ans)
# Judge status: Accepted
x = int(input())
ans = (x // 11) * 2
if x % 11 > 6:
    ans += 2
elif x % 11:
    ans += 1

print(ans)
# Judge status: Wrong Answer
import numpy as np
A, B, H, M = map(int, input().split())
a = (30 * (H + M / 60)) % 360
b = (360 * (H + M / 60)) % 360
r = abs(a - b)
deg = r if r < 180 else r - 180

l = 2 * np.sin((np.pi / 180 * deg)/2)
diff = abs(A - B)
ans = diff ** 2 + A * B * (l ** 2)
print(np.sqrt(ans))
# Judge status: Accepted
n = int(input())
ab = [list(map(int, input().split())) for _ in range(n)]

ans = 0
for a, b in ab[::-1]:
    if (a + ans) % b == 0:
        continue
    ans += b - (a + ans) % b
print(ans)
# Judge status: Accepted
N = int(input())
p = list(map(int, input().split()))
skip = False
ans = 0
for i, a in enumerate(p):
    i = i + 1
    if skip:
        skip = False
        continue
    if i == a:
        ans += 1
        skip = True
print(ans)
# Judge status: Wrong Answer
import math
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
s = [a%10,b%10,c%10,d%10,e%10]
g = max(s)
for i in range(len(s)):
    if s[i]:
        g = min(g,s[i])
k = [a,b,c,d,e]
for i in range(len(k)):
    k[i] = math.ceil(k[i]/10)*10
print(sum(k)+g-10)
# Judge status: Wrong Answer
n,a,b=map(int,input().split())
s=input()

count_ab=0
count_b=0

for i in range(len(s)):
    if s[i]=='c':
        print('No')
    elif s[i]=='b' and count_b<=b and count_ab<=b:
        print('Yes')
        count_b+=1
        count_ab+=1
    elif  s[i]=='a' and count_ab<a+b:
        print('Yes')
        count_ab+=1
    else:
        print('No')
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

s = readline().rstrip().decode('utf-8')

if s == "ABC":
    print("ARC")
else:
    print("ABC")
# Judge status: Accepted
n, a, b = map(int, input().split())
mod = 10 ** 9 + 7
total = (pow(2, n, mod) - 1) % mod

def fast_nCr(n, r):
    upper = 1
    for i in range(n - r + 1, n + 1):
        upper = upper * i % mod
    below = 1
    for i in range(1, r + 1):
        below = below * i % mod
    ans = upper * pow(below, mod - 2, mod) % mod
    return ans % mod

A = fast_nCr(n, a)
B = fast_nCr(n, b)
ans = (total - A - B) % mod
print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
AB=[[int(i) for i in input().split()] for i in range(N)]
ans=0
m=0

AB.sort()

for i in range(N):
  if m==M:
    break
  if m+AB[i][1]>=M:
    for j in range(AB[i][1]):
      ans +=AB[i][0]
      m +=1
      if m==M:
        break
  else:
    ans += AB[i][0]*AB[i][1]
    m=m+AB[i][1]
    
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
n = int(input())

su = n * (n + 1) // 2
print(su - n)
# Judge status: Accepted
N,X=map(int,input().split())
L=list(map(int,input().split()))

count=0
dist=0
L.append(0)

i=0
while dist<=X and count<=N:
    dist+=L[count]
    count+=1
    #print(dist)

print(count)
# Judge status: Wrong Answer
X=int(input())
N=X//100
for a in range(N):
  for b in range(N):
    for c in range(N):
      for d in range(N):
        for e in range(N):
          for f in range(N):
            if 100*a+101*b+102*c+103*d+104*e+105*f==X:
              print('1')
              exit()
print('0')
# Judge status: Wrong Answer
S = input()
S.replace('2017','2018')
# Judge status: Accepted
S = input()
L = []

for i in range(4):
  T = "n"
  for j in range(len(L)):
    if S[i] == L[j][0]:
      L[j][1] +=1
      T = "y"
  if T == "n":
    L.append([S[i],1])
    
if len(L) == 2:
  if L[0][1] == L[1][1]:
    print("Yes")
  else:
    print("No")
else:
  print("No")
# Judge status: Accepted
h = int(input())
i = 1
ans = 0
while h > 0:
    ans += i
    i *= 2
    h //= 2
print(ans)
# Judge status: Wrong Answer
a = list(map(int,input().split()))
x = a[0]
y = a[1]

n = a[0]
count =1

while n <= y:
  n = n * 2
  count += 1
  
print(str(count))
# Judge status: Accepted
A,B,C,D = map(int,input().split())
M = [0]*100

for n in range(A,B):
  M[n-1]+=1
  
for n in range(C,D):
  M[n-1]+=1
  
print(M.count(2))
# Judge status: Accepted
s=input()
k=int(input())
lens=len(s)
alp="azyxwvutsrqponmlkjihgfedcb"

ans=[]
for i in range(lens):
    d=alp.index(s[i])
    if k>=d:
        k-=d
        ans.append("a")
    else:
        ans.append(s[i])

las=ans.pop()
alp="abcdefghijklmnopqrstuvwxyz"
ans.append(alp[(alp.index(las)+k)%26])

print("".join(ans))
# Judge status: Accepted
n, k = map(int, input().split())
X = list(map(int, input().split()))

ans = 10 ** 9
for i in range(n - k + 1):
    x_min = X[i]
    x_max = X[i + k - 1]

    if x_min <= 0 <= x_max:
        dist_min = min(abs(x_min), x_max)
        dist_max = max(abs(x_min), x_max)

        ans = min(ans, 2 * dist_min + dist_max)
    else:
        ans = min(ans, max(abs(x_min), abs(x_max)))

print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
print((N * 2 + M) // 4)
# Judge status: Wrong Answer
a,b=map(int,input().split())

S=input()
d=0
c=a+b+3
for i in range(a+b+1):
	if S[i]=='-':
		c=i+1
		d+=1

if c==a+1:
	print('Yes')
else:
	print('No')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0
for i in range(n):
    if a[i] <=  b[i]:
        ans += a[i]
        b[i] -= a[i]
    elif a[i] > b[i]:
        ans += b[i]
        b[i] = 0
    if b[i] > 0:
        if a[i+1] <= b[i]:
            ans += a[i+1]
        elif a[i+1] > b[i]:
            ans += b[i]
print(ans)
# Judge status: Accepted
k = int(input())
s = input()
 
if (len(s) <= k):
    print(s)
else:
    print(s[:k] + "...")
# Judge status: Accepted
N = int(input())
A = [int(a) for a in input().split()]

mod = 10**9 + 7

print(((sum(A)**2 - sum([i**2 for i in A]))//2) % mod)
# Judge status: Accepted
# AtCoder Regular Contest 088
# C - Multiple Gift

X,Y=map(int,input().split())

count=0

while X<=Y:
    X*=2
    count+=1

print(count)
# Judge status: Accepted
n=int(input())
i=1
j=1
while j!=n+1:
    i=(i*j)%(10**9+7)
    j+=1
print(i)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
x = 0

for i in range(n+1):
  q = i
  w = i / 10
  e = i / 100
  r = i / 1000
  sum = q + w + e + r
  if sum >= a and sum <= b:
    x += i
    
print(x)
# Judge status: Wrong Answer
n = int(input())
number = input().split(" ")
ans = 0
for i in range(n-2):
    if number[i] > number[i+1]:
        if number[i+1] > number[i+2]:
            ans += 1
    elif number[i] < number[i+1]:
        if number[i+1] < number[i+2]:
            ans += 1
    else:
        pass
print(ans)
# Judge status: Accepted
a,b,c,d,e,k=[int(input())for _ in range(6)]

print(':(' if e-a>k else 'Yay!')
# Judge status: Wrong Answer
n=int(input())
a=[0]*n
a=map(int,input().split())
    
z=0
p=0
result=0
min=1000000002

for i in a:
    if i<0:
        z+=1
    if i==0:
       p=1 
    result+=abs(i)
    if abs(i)<min:
        min=abs(i)

if p==0 & z//2==1:
    result-=min*2

print(result)
# Judge status: Accepted
import math
n = math.floor(int(input())/2)
s = input()
a = s[n:]
b = s[:n]
if a == b:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a, b = map(int, input().split())
ans = a - 1
if b >= a:
    ans += 1
print(ans)
# Judge status: Accepted

S = input()
if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import io

nim,mike=map(int,input().split())
for i in range(mike-nim+1,mike+nim):
    print(i)
# Judge status: Wrong Answer
#!python3.4.3

a = []
result = []

for i in range(3):
  a.append(list(map(int, input().split(' '))))
  
a_flat = sum(a, [])
n = int(input())

for _ in range(n):
  b = int(input())
  
  if b in a_flat:
    result.append(a_flat.index(b))


if result and (result in [0, 1, 2] or [3, 4, 5] or [6, 7, 8] or [0, 3, 4] or [1, 4, 7] or [2, 5, 8] or [0, 4, 8] or [2, 4, 6]):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n,m = map(int, input().split())

l = [0]*n
for _ in range(m):
    a, b = map(int,input().split())
    l[a-1] += 1
    l[b-1] += 1
for i in range(n):
    print(l[i])
# 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 len(min_i[0]) == 1:
    a[min_i] = min_

    
  
  if a[a>0].shape[0] == 1:
    not_0_a = a[a!=0]
    min_ = not_0_a.min()
  
print(min_)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
print(max(A-B-C, 0))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
ans = 0
l = [0]*(10**6+10)
for i in range(1,len(A)):
  x = i-A[i]
  if x<0:
    continue
  else:
    l[x]+=1
if A[0]<=10**6:
  ans+=l[A[0]]
for i in range(1,N):
  x = i+A[i]
  if x<0:
    continue
  if x>10**6:
    continue
  
  l[i-A[i]]-=1
  ans+=l[x]
  
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
list=[]
s=[]
if N == 1:
    print(len(input())-1)
else:
    for i in range(N):
        list.append(input().split())
        s = set(s) & set(list[1:])
        list=[]
    print(len(s))
# Judge status: Accepted
[K, S] = list(map(int, input().split()))
cnt =  0
for x in range(K+1):
  for y in range(K+1):
    z = S - (x+y)
    if 0 <= z <= K:
      cnt += 1
    else:
      continue
print(cnt)
# Judge status: Accepted
#!/usr/bin/env python3

import math

N, X = map(int, input().split())
A = sorted(list(map(int, input().split()))+[X])
B = []

for i in range(len(A)-1):
    B.append(A[i+1] - A[i])

g = B[0]

for b in B[1:]:
    g = math.gcd(b, g)

print(g)
# Judge status: Accepted
N, W = map(int, input().split())
w, v = [0]*N, [0]*N
for i in range(N):
  w[i], v[i] = map(int, input().split())

dp = [[0]*(W+1) for _ in range(N+1)]
for i in range(1, N+1):
  for w_sum in range(1, W+1):
    if w_sum >= w[i-1]:
      dp[i][w_sum] = max(dp[i-1][w_sum-w[i-1]] + v[i-1], dp[i-1][w_sum])
    else:
      dp[i][w_sum] = dp[i-1][w_sum]
      
print(dp[N][W])
# Judge status: Accepted
n = int(input())-1

ans = []
while n >= 0:
    n, y = divmod(n, 26)
    ans.append(y)
    n -= 1
ans.reverse()


def to_alpha(x):
    return chr(x+ord('a'))


print(''.join(map(to_alpha, ans)))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    a,b,c,k=map(int, input().split())
    num=0
    if b-a>10**18:
        num='Unfair'
    else:
        if k%2==0:
            num=a-b
        else:
            num=b-a
    print(num)
resolve()
# Judge status: Accepted
import math
from itertools import permutations

N = int(input())
points = [tuple(map(int, input().split(' '))) for _ in range(N)]

s = 0
count = 0
for routes in permutations(points):
    count += 1
    for p1, p2 in zip(routes, routes[1:]):
        x1, y1 = p1
        x2, y2 = p2
        s += math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)

print(s / count)
# Judge status: Accepted
s = input()
K = int(input())
alp = 'abcdefghijklmnopqrstuvwxyz'

ans = ''
for i,w in enumerate(s):
    if i != len(s)-1 and (26-(ord(w)-ord('a')))%26 <= K:
        ans += 'a'
        K -= (26-(ord(w)-ord('a')))%26
    elif i != len(s)-1:
        ans += w
    if i == len(s)-1:
        #ans = ans[:-1]
        lastlidx = (ord(w)-ord('a') + K%26)%26
        ans += alp[lastlidx]
print(ans)
# Judge status: Wrong Answer
N = int(input())
hs = list(map(int, input().split()))

Cost = [1e7 for _ in range(N)]
Cost[0] = 0

for i in range(N):
  if (i+1 > N-1):
    continue
  Cost[i+1] = min(Cost[i+1], Cost[i] + abs(hs[i]-hs[i+1]))
  if (i+2 > N-1):
    continue
  Cost[i+2] = min(Cost[i+2], Cost[i] + abs(hs[i]-hs[i+2]))

print(Cost[N-1])
# Judge status: Wrong Answer
k=int(input())
a,b=map(int,input().split())

import math

if math.floor(b/k)-math.ceil(a/k)>=1:
  print('OK')
else:
  print('NG')
# Judge status: Wrong Answer
three =  list(map(int, input().split()))
r = three[0]
g = three[1]
b = three[2]
g = str(g)
b = str(b)
gb = g + b
gb = int(gb)

if gb%4 ==0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n-k):
    print("Yes" if a[i] < a[i+k] else "No")
# Judge status: Wrong Answer
A, B, M = [int(_) for _ in input().split()]
a = [int(_) for _ in input().split()]
b = [int(_) for _ in input().split()]
xyc = [[int(_) for _ in input().split()] for i in range(M)]

rets = [ai+bi for ai, bi in zip(a, b)]

for x, y, c in xyc:
    rets += [a[x-1] + b[y-1] - c]
print(min(rets))
# Judge status: Accepted
a,b=map(int,input().split());print("Possible" if (a%3==0 or b%3==0 or (a+b)%3==0) else "Impossible")
# Judge status: Accepted
n=int(input()) 
m=10**5+4 
for i in range(n,m): 
	lst=[] 
	if all(( i % j) !=0 for  j in range(2,int(n**0.5//1+1))): 
		print(i) 
		break
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans0 = sum(a)
for i in range(n):
    if b[i] > a[i]:
        a[i+1] -= b[i]-a[i]
        a[i] = 0
        if a[i+1] < 0:
            a[i+1] = 0
    elif b[i] <= a[i]:
        a[i] -= b[i]
ans1 = sum(a)
print(ans0-ans1)
# Judge status: Wrong Answer
y,m,d=map(int,input().split("/"))
if y<2019:
    print("Heisei")
elif y==2019:
    if m<=4:
        print("Heisei")
else:
    print("TBD")
# Judge status: Wrong Answer
def main():
  n, k = map(int, input().split())
  d = list(map(int, input().split()))
  a = 0
  for i in range(n, 10000):
    if checknum(i, d):
      a = i
      break
  print(a)

def checknum(n, d):
  for s in str(n):
    if d.count(int(s)) > 0:
      return False
  return True

if __name__ == '__main__':
  main()
# Judge status: Accepted
S = input()
n = len(S)
ok = False
while not ok:
    n -= 2
    flag = True
    for i in range(n//2):
        if S[i] != S[i+n//2]:
            flag = False
    if flag:
        ok = True
print(n)
# Judge status: Accepted
S = input()
ans = 753
for i in range(len(S)-2):
    ans = min(ans, abs(753-int(S[i:i+3])))
print(ans)
# Judge status: Accepted
import itertools,sys
def S(): return sys.stdin.readline().rstrip()
S = S()
for i,j in itertools.combinations(range(len(S)+2),2):
    if S[:i]+S[j-1:]=='keyence':
        print('YES')
        break
else:
    print('NO')
# Judge status: Accepted
n,m = map(int,input().split())
a = [int(c) for c in input().split()]
from heapq import *
from math import *
a = [-i for i in a]
heapify(a)
while m > 0:
	heappush(a,-((-heappop(a))//2))
	m -=1
print(-sum(a))
# Judge status: Wrong Answer
S = input()
Q = int(input())
que2 = []
que2.append(S)
rv_flag= 0
for _ in range(Q):
    que = list(map(str, input().split()))
    if que[0] == "1":
        rv_flag = rv_flag + 1
    elif que[1] == "1":
        que2.insert(0,que[2])
    elif que[1] == "2":
        que2.append(que[2])
if rv_flag % 2 == 1:
    que2.reverse()
ans = "".join(que2)
print(ans)
# Judge status: Accepted
import math
n = int(input())
x = math.ceil(n/1000)
print(x*1000-n)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if a+b==c or b+c==a or c+a==b:
	print("YES")
else:
  print("NO")
# Judge status: Accepted
[P,Q,R] = list(map(int,input().split()))

A = P + Q
B = Q + R
C = R + P

print(min(A,B,C))
# Judge status: Accepted
def myfunc(A, B):
    def resfunc(x):
        if A <= sum(map(int,list(str(x)))) <=B:
            return x
        else:
            return 0
    return resfunc

N, A, B = map(int, input().split())
print(sum(map(myfunc(A,B), range(1, N+1))))
# Judge status: Wrong Answer
n=int(input())
P=[]
for i in range(n):
    s=input()
    x=len(s)
    P.append([x,s])
P=sorted(P)
m=P[0][0]

B=[]
for i in range(m):
    B.append(P[0][1][i])

que=[]
for i in B:
    cnt=0
    for j in range(n):
        if i in P[j][1]:
            cnt+=1
    if cnt==n:
        que.append(i)
que=sorted(que)
print(''.join(que))
# Judge status: Wrong Answer
s=input()
ss=s[0]
sss=ss.upper()
print("A"+sss+"C")
# Judge status: Accepted
A,B = map(int,input().split())

if A<=5:
  print(0)
elif A<=12:
  print(B//2)
else:
  print(B)
# Judge status: Wrong Answer
n,k = map(int,input().split())
r,s,p = map(int,input().split())
a = list(input())

hand = {"r":p,"s":r,"p":s}
ans = 0
for i in range(n):
    if a[i-k] == a[i] and i-k >= 0:
        ans += 0
    else:
        ans += hand[a[i]]
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
h = [int(input()) for i in range(n)]

h.sort()

ans = 1000000000
for i in range(n - k + 1):
  temp = h[i + k - 1] - h[i]
  ans = min(temp, ans)

print(ans)
# Judge status: Accepted
import itertools
n, m, q = map(int, input().split())
ls = []
for _ in range(q):
    a, b, c, d = map(int, input().split())
    ls.append((a, b, c, d))

def calc(x, ls):
    s = sum([d for a, b, c, d in ls if x[b - 1] - x[a - 1] == c])
    return s

ans = 0
cands = range(1, m+1)
c = itertools.combinations_with_replacement(cands, n)
for x in c:
    ans = max(ans, calc(x, ls))
print(ans)
# Judge status: Accepted
# coding:utf-8
def main():
    l = int(input())
    ippen = l / 3
    print(ippen*ippen*ippen)


if __name__ == '__main__' :
    main()
# Judge status: Accepted
n = str(input())
# N,A,B = map(int, input().split())
print(n.count('1'))
# Judge status: Accepted
A, B, C = map(int,input().split())
li = [A, B, C]
li.sort()

ans = "No"

if li[0] == li[1] and li[1] != li[2] :
  ans = "Yes"

elif li[0] != li[1] and li[1] == li[1] == li[2]:
  ans = "Yes"

print(ans)