peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import string
str_map = {num+1: item for num, item in enumerate(string.ascii_lowercase)}
def main():
	n = int(input())
	ans = []
	while n > 26:
		tmp = 26 if n%26 == 0 else n%26
		ans.append(str_map[tmp])
		n = (n-1) // 26
	ans.append(str_map[n])
	ans_str = ''.join(ans)
	print(ans_str[::-1])
	return

if __name__ == "__main__":
	main()
# Judge status: Accepted
import math
k = int(input())

seq = 7
ans = -1
for i in range(k):
    mod = seq%k
    if mod == 0:
        ans = i+1
        break
    seq = mod*10 + 7

print(ans)
# Judge status: Wrong Answer
def main():
  c = input()
  if c.isupper():
    print(c.lower())
  else:
    print(c.upper())

main()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
val = 0
l = []
s = sum(a)
hlf = s/2
for i in range(n-1):
    val += a[i]
    l.append(abs(hlf - val))

val = min(l)
print(int(val*2))
# Judge status: Wrong Answer
W,H,x,y=map(int,input().split())
S = H*W/2
res = 0
if x*2 == W or y*2 == H:
  res = 1
print(S,res)
# Judge status: Accepted
n = int(input())
dp = [[0] * 3 for _ in range(n + 1)]
abc = [list(map(int, input().split())) for _ in range(n)]
for i in range(1, n + 1):
    for j in range(3):
        dp[i][j] = max(dp[i- 1][(j + 1) % 3] + abc[i - 1][j], dp[i- 1][(j + 2) % 3] + abc[i - 1][j] )
print(max(dp[:][n]))
# Judge status: Wrong Answer
n = int(input())
a_s = list(map(int, input().split(' ')))
b_s = list(map(int, input().split(' ')))
c_s = list(map(int, input().split(' ')))

sat = 0
for a_i in range(0, n):
    print(sat)
    i = a_s[a_i] - 1
    b = b_s[i]
    sat += b
    if a_i < n-1 and a_s[a_i] +1 == a_s[a_i+1]:
        if i >= 0:
            sat += c_s[i]
print(sat)
# Judge status: Accepted
# AtCoder
a, b, c = map(int, input().split())
print(int((c+0.5)//a*b))
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    A = int(input())
    S = input()
    print(S if A >= 3200 else 'red')


if __name__ == "__main__":
    main()
# Judge status: Accepted
n=int(input())
ans=""
while n!=0:
  ans=str(n%(2))+ans
  n=-(n//(2))
print(0 if ans =="" else ans)
# Judge status: Accepted
import math

N = int(input())
cnt = 0
maxI = int(math.floor(math.sqrt(N)))

for i in range(1,maxI+1, 1):
  cnt += int(math.floor((N-1)/i)) - i

cnt *= 2

if N == maxI * maxI:
  cnt += maxI + 1
else:
  cnt += maxI

print(cnt)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort()
c.sort()
import bisect as bi
ans=0
for i in b:
    k=1
    k*=bi.bisect_left(a,i)
    k*=n-bi.bisect_right(c,i)
    ans+=k
print(ans)
# Judge status: Accepted
def pow(a, b, mod):
    result = 1
    while b:
        if b&1: result = (result * a) %mod
        a = (a * a) % mod
        b >>= 1
    return result

n = int(input())
if n <= 1:
    print(0)

else:

    mod = 10 ** 9 + 7

    print((mod + pow(10, n, mod) - 2 * pow(9, n, mod) +  pow(8, n, mod)) % mod)
# Judge status: Accepted
c, a, b = map(int, input().split())
print(c*a//2)
# Judge status: Accepted
# -*- coding: utf-8 -*-

#----------
D = int(input().strip())
#----------
if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas Eve Eve")
elif D == 22:
  print("Christmas Eve Eve Eve")
# Judge status: Accepted
A = list(map(int, input().split()))

if A[0] == A[1]:
    print("Draw")
else:
    if A[0] == 1:
        print("Alice")
    elif A[1] == 1 or A[1] > A[0]:
        print("Bob")
    else:
        print("Alice")
# Judge status: Accepted
n,k=map(int,input().split())
x=list(map(int,input().split()))
ans=float("inf")
for i in range(n-k+1):
    l=x[i]
    r=x[i+k-1]
    if l*r==0:
        t=max(abs(l),abs(r))
    if l*r>0:
        t=max(abs(l),abs(r))
    if l*r<0:
        if abs(l)>abs(r):
            t=2*abs(r)+abs(l)
        if abs(r)>=abs(l):
            t=2*abs(l)+abs(r)
    if t<ans:
        ans=t
print(ans)
# Judge status: Accepted
a,b,c,d = map(int, input().split())
max_list = [a*c,a*d,b*c,b*d]
max_list = sorted(max_list, reverse=True)
print(max_list[0])
# Judge status: Accepted
N = int(input())
XY = list([list(map(int, input().split())) for _ in range(N)])
sum = 0
for i in range(N-1):
    for j in range(i+1, N):
        sum += ((XY[j][0]-XY[i][0])**2 + (XY[j][1]-XY[i][1])**2) ** 0.5
ans = sum * 2 / N
print(ans)
# Judge status: Wrong Answer
import sys
import math

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N=int(input())
cnt=1
li=[]

for _ in range(N):
	li.append(int(input()))
	
so=sorted(li)
ct=1

for i in range(N-1):
	if so[i]==so[i+1]:
		ct+=1
	else:
		if ct%2==1:
			cnt+=1
		ct=1

if N==1:
	print(1)
else:	
	print(cnt)
# Judge status: Wrong Answer
n,d = map(int,input().split())
wide = d*2+1
print(n//wide)
# Judge status: Accepted
n, d = map(int, input().split())
d2 = d * d
count = 0
for _ in range(n):
  x, y = map(int, input().split())
  if x * x + y * y <= d2:
    count += 1
print(count)
# Judge status: Accepted
N=input()
sum=0
for i in N:
    sum+=int(i)
if sum%9==0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import math
N=int(input())
x=[0]*N
y=[0]*N
for i in range(N):
    x[i],y[i]=map(int,input().split())
ans_sum=0
for i in range(N):
    for j in range(N):
        if i!=j:
            ans_sum+=math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)
print(ans_sum*0.5/N)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

ans = [0]*n
for i in A:
    ans[i-1] += 1

for i in range(n):
    print(ans[i])
# Judge status: Accepted
n,k,*l=map(int,open(0).read().split())
for _ in range(min(k,41)):
  s=[0]*-~n
  for i in range(n):
    s[max(i-l[i],0)]+=1
    s[min(i+l[i]+1,n)]-=1
  for i in range(n): s[i+1]+=s[i]
  l=s
print(*l[:n])
# Judge status: Accepted
from collections import Counter

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

asum=sum(A)

C=Counter(A)

for i in range(int(input())):
    b,c=list(map(int,input().split()))

    asum=asum+(c-b)*C[b]

    C[c]=C[c]+C[b] if c in C else C[b]
    C[b]=0

    print(asum)
# Judge status: Accepted
a,b,x = map(int,input().split())
print(b//x - (a-1)//x)
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Counter


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    A = sorted(Counter(A).items(), key=lambda x: x[1])

    result = 0
    for i in range(max(0, len(A) - K)):
        result += A[i][1]

    print(result)


if __name__ == "__main__":
    main()
# Judge status: Accepted

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

def main(N, M, K):
    for i in range(0, N+1):
        for j in range(0, M+1):
            if i * (M - j) + j * (N - i) == K:
                return True
    return False

res = main(N, M, K)

if res == True:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a, b, c = map(int, input().split())
k = int(input())

m = max(a, b, c)
s = sum([a, b, c])-m
for i in range(k):
    m *= 2

print(s+m)
# Judge status: Wrong Answer
a,b = map(int,input().split())
l = list(input())


for i in range(a+1,a+b+1):
    if i == a:
        if l[a] != "-":
            print("No")
            exit()
    else:
        if l[i] == "-":
            print("No")
            exit()
print("Yes")
# Judge status: Accepted
# ABC104B - AcCepted
def main():
    S = input().rstrip()
    flags = [S[0] == "A", S[2:-1].count("C") == 1, S.translate(str.maketrans({"A": None, "C": None})).islower()]
    print("AC" if all(flags) else "WA")


if __name__ == "__main__":
    main()
# Judge status: Accepted
N, M = map(int, input().split())
nums = []
for n in range(1, int(M**0.5)+1):
  if M%n == 0:
    nums.append(n)
    nums.append(M//n)
nums.sort()
answer = 1
for num in nums:
  if M//num < N:
    break
  else:
    answer = num
print(answer)
# Judge status: Wrong Answer

r, g, b = map(int, input().split())

answer = r * 100 + g * 10 + b

if answer % 4 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
K = int(input())
if K % 2 == 0 or K % 5 == 0:
    print(-1)
    exit()

tmp1 = 0
for i in range(1, 2 * K + 1):
    tmp1 += 7 * pow(10, i, K)
    if tmp1 % K == 0:
        print(i)
        exit()

print(-1)
# Judge status: Wrong Answer
n,lim = map(int,input().split())

ans = 10000

for i in range(n):
    cost,time = map(int,input().split())
    
    if time <= lim and cost < ans:
        ans = cost
        
print(ans)
# Judge status: Accepted
(n,),*csf = [list(map(int, s.split())) for s in open(0)]

for j in range(n):
    t = 0
    for i in range(j,n-1):
        c,s,f = csf[i]
        t = max(t,s)
        t = s + (0-(s-t)//f * f)
        t += c
    print(t)
# Judge status: Wrong Answer
N = int(input())
V = [int(i) for i in input().split()]

V.sort()
print(V)

ans = 0

for i in range(N):
	if i == 0 or i == 1:
		ans += V[i] / (2**(N-1))
	else:
		ans += V[i] / (2**(N-i))

print(ans)
# Judge status: Accepted
s = input()
K = int(input())

rlt = ''

for i in range(len(s)-1):
  c = (26-ord(s[i])+ord('a'))%26
  if K >= c:
    rlt += 'a'
    K -= c
  else:
    rlt += s[i]
    
rlt += chr((K + ord(s[-1]) - ord('a'))%26 + ord('a'))
print(rlt)
# Judge status: Accepted
s=input()
if s=="ABC":
  print("ARC")
else:
  print("ABC")
# Judge status: Wrong Answer
from functools import reduce
from math import ceil

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

alist = list(map(int,input().split(' ')))
# alist = [i // 2  for i in alist]


from fractions import gcd

def getLCM(a, b):
    return a * b // gcd(a, b)

def get_lcm_for(your_list):
    return reduce(lambda x, y: getLCM(x, y), your_list)

lcmr = get_lcm_for(alist)

if (lcmr in alist):
    print(0)
    exit(0)

result = round((m)/(lcmr))


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

if len(s) <= k:
  print(s)
else:
  print(s[:k]+'...')
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
if a + b + c == 19:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
def resolve():
	n = int(input())
	a = list(map(int, input().split()))
	ans = 100**6
	for i in range(-100, 100):
		tmp = 0
		for j in a:
			if i == j:
				continue
			tmp += (j - i)**2
		if tmp < ans:
			ans = tmp
	print(ans)

resolve()
# Judge status: Accepted
n = int(input())
w = [input()]
ans = 'Yes'
for i in range(1, n):
    w.append(input())
    if w[i] in w[:-1] or w[i][0] != w[i-1][-1]:
        ans = ('No')
print(ans)
# Judge status: Wrong Answer
n = int(input())
s = input()
l, r, c = 0, 0, 0
for a in s:
    if a == '(':
        c += 1
    else:
        if c:
            c -= 1
        else:
            r -= 1
    l = n
print("("*l + s + ")"*r)
# Judge status: Accepted
# coding:utf-8

N, K = (int(x) for x in input().split())
h = [int(x) for x in input().split()]

inf = 100000000000000
dp = [inf for x in range(N)]

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

print(dp[N-1])
# Judge status: Accepted
N,K = map(int,input().split())
if N == 0 or N == 1:
    print(1)
for i in range(1,100):
    if K**i <= N < K**(i+1):
        print(i+1)
        break
# Judge status: Accepted
import sys
input = sys.stdin.readline

def dsum(n):
	res = 0
	while n:
		res += n%10
		n //= 10
	return res

def main():
	N = int(input())
	#S = input().rstrip()
	#N,A,B = map(int,input().split())
	
	res = 1001001001
	t = 0
	for i in range(1,N):
		x = dsum(i)+dsum(N-i)
		if res>x:
			res = x
			t = i

	print(t,N-t,file=sys.stderr)
	print(res)
	
main()
# Judge status: Wrong Answer
N = int(input())
import math
print(math.pi * N)
# Judge status: Wrong Answer
import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces

def main():
    n = ni()
    s = [ns() for i in range(n)]
    st = tuple(s)
    print(len(st))
    return

if __name__ == '__main__':
  main()
# Judge status: Accepted
s=input()
for i in range(2,len(s),2):
    x=s[:-i]
    leng=len(x)
    if x[:leng//2] == x[leng//2:]:
        print(leng)
        break
# Judge status: Accepted
A,B = map(int, input().split())
if 1<=A<=9 and 1<=B<=9:
  print(A*B)
else:
  print(-1)
# Judge status: Accepted
a,b = list(map(int,input().split()))
if a > b:
    print(a+a-1)
elif a < b:
    print(b+b-1)
else:
    print(a+b)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print(b, c, a)
# Judge status: Accepted
from sys import stdin
N,A,B = [int(x) for x in stdin.readline().rstrip().split()]
S = (stdin.readline().rstrip())

AC = 0
BC = 0

for i in S:
    if i == "a":
        if A + B > AC + BC:
            AC += 1
            print("Yes")
        else:
            print("No")
    elif i == "b":
        if A + B > AC + BC and BC < B:
            BC += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")
# Judge status: Accepted
N, Y = map(int, input().split())

result = []
for a in range(N+1):
  for b in range(N+1):
    c = max(N - a - b, 0)
    total = a * 10000 + b * 5000 + c * 1000
    if (total == Y) and (a + b + c == N):
      result.append([a, b, c])

if len(result) == 0:
  print("-1 -1 -1")
else:
  print(" ".join(map(str, result[0])))
# Judge status: Wrong Answer
S = input()
 
if S == 'AAA' or 'BBB':
    print('No')
if S == 'AAB' or 'ABA' or 'ABB' or 'BAA' or 'BBA' or 'BAB':
    print('Yes')
# 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) # 再帰限界変更（デフォルトは1000）

N = int(readline().rstrip()) 
A = list(map(int,readline().rstrip().split()))

buka=[0]*N

for i in range(N-1):
    buka[A[i]-1]+=1

print(buka)
# Judge status: Accepted
import heapq
N, M = map(int, input().split())
A = list(map(lambda x: -int(x), input().split()))
heapq.heapify(A)
ans = 0
for _ in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, a / 2)
print(-sum(int(a) for a in A))
# Judge status: Wrong Answer
#ABC048 B
a,s,t=input().split()
print(a,s[0],t)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
maxa=0
total=0
for i in a:
  maxa=max(maxa,i)
  total=total+maxa-i
print(total)
# Judge status: Accepted
import math
n=int(input())
a=list(map(int,input().split()))

l="".join(["o" if i+1==a[i] else "x" for i in range(n)])
sl=l.split("x")
ss=[len(x) for x in sl]
ans=[math.ceil(i/2) for i in ss]
print(sum(ans))
# Judge status: Wrong Answer
N,M = list(map(int,input().strip().split()))

if N < M*2:
  res =  (M - 2*N)//4 + N
else:
  res = N
print(res)
# Judge status: Accepted
from math import factorial as fac
def main():
    n,m=map(int,input().split())
    if abs(n-m)>1:
        print(0)
        exit()
    elif n==m:
        print((fac(n)*fac(m)*2)%(10**9+7))
    else:
        print((fac(n)*fac(m))%(10**9+7))
main()
# Judge status: Accepted
a, b = map(int, input().split())
print((a+b)//2 + (a+b)%2)
# Judge status: Wrong Answer
import numpy as np
n = int(input())
ds = list(map(int, input().split()))
ds = np.array(ds)
ans = 0
for i in range(1, max(ds)):
    temp1 = np.count_nonzero(ds < i)
    temp2 = np.count_nonzero(ds >= i)
    if temp1 == temp2:
        ans += 1

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

if (N-1)%(K-1) == 0:
    print(int((N-1)/(K-1)))
else:
    print(int((N-1)/(K-1)) + 1)
# Judge status: Wrong Answer
N=int(input())
X=list(map(int,input().split()))
ave=sum(X)//N
a=[(X[i]-ave)**2 for i in range(N)]
b=[(X[i]-ave+1)**2 for i in range(N)]
print(min(sum(a),sum(b)))
# Judge status: Accepted
n, m = list(map(int, input().split()))
ans = 1
mod = 10**9+7
if n==m:
    for i in range(1, n+1):
        ans *= i
        ans %= mod
    print((ans**2*2)%mod)
elif abs(n-m)==1:
    for i in range(1, n+1):
        ans *= i
        ans %= mod
    for i in range(1, m+1):
        ans *= i
        ans %= mod
    print(ans)
else:
    print(0)
# Judge status: Accepted
A, B, H, M = input().split(" ")
A, B, H, M = int(A), int(B), int(H), int(M)

import math

dig = min(abs((H * 60 + M) * 0.5 - M*6), 360 - abs((H * 60 + M) * 0.5 - M*6))
if dig <= 90:
    a2 = A * math.cos((dig/180) * math.pi)
    a3 = A * math.sin((dig/180) * math.pi)
    print(((B-a2)**2 + a3**2)**(1/2))

elif dig > 90:
    dig1 = 180 - dig
    a2 = A * math.sin((dig1/180) * math.pi)
    a3 = A * math.cos((dig1/180) * math.pi)
    print(((B+a3)**2 + a2**2)**(1/2))
# Judge status: Accepted
import copy
N = int(input())
S = list(input())
S_ans = copy.deepcopy(S)
app = 0
q = [0]
save = 0
for i in range(N):
    if S[i] == '(':
        q.append(q[-1] + 1)
        
    else:
        q.append(q[-1] - 1)
        if q[-1] == -1:
            S_ans.insert(app + save,"(")
            app += 1
            q[-1] = 0

for i in range(q[-1]):
    S_ans.append(")")
print("".join(S_ans))
# Judge status: Accepted
k=int(input())
from collections import deque
d=deque()
for i in range(1,10):d.append(i)
for i in range(k-1):
  m=d.popleft()
  if m%10!=0:d.append(10*m+m%10-1)
  d.append(10*m+m%10)
  if m%10!=9:d.append(10*m+m%10+1)
print(d.popleft())
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]
buka = [0 for i in range(N)]
for a in A:
    buka[a-1] += 1
for n in range(N):
    print(buka[n])
# Judge status: Wrong Answer
def readinput():
    n=int(input())
    return n

def main(n):
    x7=int(n/1.07)
    x8=int(n/1.08)
    x9=int(n/1.09)
    n100=n*100
    for x in range(max(1,x9-1),x7+1):
        xx=x*108//100
        if xx==n:
            print(x)
            break
    else:
        print(':(')

        

if __name__=='__main__':
    n=readinput()
    main(n)
# Judge status: Accepted
a,b,c = map(int, input().split())

for i in range(1,101):
  if a*i%b == c:
    print("YES")
    exit()
print("NO")
# Judge status: Wrong Answer
a=int(input())
print(0.5*a*(a+1))
# Judge status: Wrong Answer
S=input()
for i in range(len(S)-1):
  if S[i]==S[i+1]:
    print('bad')
    exit()
print('good')
# Judge status: Accepted
a, s, c = input().split()
str = 'A' + s[0] + 'C'
print(str)
# Judge status: Accepted
N,Y = map(int,input().split())
res = (-1,-1,-1)
for x in range(N+1):
  for y in range(N+1-x):
    if N-x-y >=0 and 10000*x + 5000*y + 1000*(N-x-y) == Y:
      res = (x,y,N-x-y)
print(res[0],res[1],res[2])
# Judge status: Wrong Answer
h = int(input())
w = int(input())
n = int(input())

if n / max(h, w) > n:
    print(n // max(h, w) + 1)
elif n / max(h, w) == 1:
    print(1)
elif n / max(h, w) < 1:
    print(1)
else:
    print(n // max(h, w))
# Judge status: Accepted
N = int(input())
print(int(not N))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))

B = [2 **i for i in range(N)]

S = 1
OK = 0
Sum = 0

for i in range(N+1):

  
  Sum += A[i]+2**(-(-A[i] // 2)) -1
  
  if A[i] > S:
    break
  S = S - A[i]
  S = S*2
  
  if i == N-1:
    OK = 1
  if not A[i] == 0:
    OK = 0

  
if OK == 0:
  print(-1)
else:
  print(Sum)
# Judge status: Accepted
#数学的に解く
w,h,n = map(int,input().split())
cnt = 0
X = 0
Y = 0
while(cnt < n):
    x,y,a = map(int,input().split())
    
    if(a == 1):
        X = max(X,x)
    elif(a == 2):
        w = min(w,x)
    elif(a == 3):
        Y = max(Y,y)
    elif(a == 4):
        h = min(h,y)
    #print(w,h,X,Y)
    cnt += 1
print(max(w-X,0)*max(h-Y,0))
# Judge status: Accepted
n = int(input())
ball = list(map(int,input().split()))

num = [0] * (n + 1)
data = [0] * (n + 1)

for i in ball:
    num[i] += 1

for i in range(n+1):
    data[i] = num[i] * (num[i] - 1) // 2

x = sum(data)

for i in ball:
    print(x - num[i] + 1)
# Judge status: Accepted
n, d = map(int, input().split())
ans = [-1]*3
for x in range(n+1):
    for y in range(n-x+1):
        zd = d - 10000*x - 5000*y
        if zd//1000 == n-x-y:
            ans[0] = x
            ans[1] = y
            ans[2] = zd//1000
            break
print(*ans)
# Judge status: Accepted


N, M = [int(x) for x in input().split()]
a = set(int(input()) for _ in range(M))

MOD = 10 ** 9 + 7
dp = [0] * (N + 1)
dp[0] = 1

for i in range(1, N + 1):
  if i in a:
    continue
  x = dp[i - 1]
  if i > 1:
    x += dp[i - 2]
  dp[i] = x % MOD

ans = dp[N]
print(ans)
# Judge status: Accepted
n=int(input())

a=sorted(list(map(int,input().split())),reverse=True)

stack=-1
t=[]
for i in a:
    if stack==i:
        t.append(i)
        stack=-1
    else:
        stack=i
    
    if len(t)>=2:
        break
try:
    print(t[0]*t[1])
except:
    print(0)
# Judge status: Wrong Answer
import bisect
import math
n = int(input())
l = sorted(list(map(int,input().split())))
a = l[-1]/2
s = bisect.bisect_left(l,a)
k1 = l[s-1]
if len(l)==2 :
  print(l[-1],l[-2])
  exit()
k2 = l[s]
s1 = a-k1
s2 = a-k2
if s1<=s2:
  print(l[-1],k1)
else:
  print(l[-1],k2)
# Judge status: Wrong Answer
# 170 B

x, y = map(int, input().split())
res = "No"

for i in range(1, x+1):
    tot = (i * 2) + ((x - i) * 4)
    if tot == y:
        res = "Yes"
        break

print(res)
# Judge status: Accepted
s=input()
a=[]
cnt=""
for i in range(5):
    cnt+="hi"
    a.append(cnt)
if s in a:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a=int(input())
n=int(input())

if a%500<=n:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
a = list(int(input()) for i in range(n))
ans = 0
for i in range(n-1):
    m = a[i]//2
    ans += m
    a[i] -= m*2
    if a[i] == 1 and a[i+1] != 0:
        ans += 1
        a[i] -= 1
        a[i+1] -= 1
print(ans + a[-1]//2)
# Judge status: Accepted
X = input()

s = 0
ans = 0
for Xi in X:
    if Xi == 'S':
        s += 1
        ans += 1
    else:
        if s >= 1:
            s -= 1
            ans -= 1
        else:
            ans += 1
print(ans)
# Judge status: Wrong Answer
n = int(input())
s = []
ans = 0
for i in range(n):
    s.append(int(input()))

s.sort()

for i in s:
    ans += i

for i in s:
    if ans % 10 == 0:
        ans -= i
    else:
        break

print(ans)
# Judge status: Wrong Answer
n = int(input())
arr = []
for i in range(1, n + 1):
  a = []
  for j in range(1, i + 1):
    if j % 2 == 1:
      if n % j == 0:
        a.append(j)
  if len(a) == 8:
    arr.append(i)
print(len(arr))
# Judge status: Wrong Answer
n = int(input())
h_list = list(map(int,input().split()))
count = 0
ans = 0
for i in range(1,n-1):
    if h_list[i] >= h_list[i+1]:
        count += 1
        #print(count)
    else:
        ans = max(ans,count)
        count = 0
ans = max(ans,count)
print(ans)
# Judge status: Accepted
X,k,d = map(int,input().split())
x = abs(X)

if x >= k*d:
    print(x - d*k)
else:
    e = x//d
    k -= e
    x %= d
    if k % 2 == 0:
        print(x)
    else:
        print(d-x)
# Judge status: Wrong Answer
a1,a2,a3,_,*b = [i.split() for i in open(0)]
bingo = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [2, 5, 8], [0, 3, 6], [1, 4, 7], [0, 4, 8], [2, 4, 6]]
s = ["" if i in b else i for i in a1 + a2 + a3]
for i,j,k in bingo:
    if {s[i],s[j],s[k]} ==  {''}:
        print('Yes')
        exit()
print('No')
# Judge status: Accepted
import bisect
N, H = map(int, input().split())
B = [0] * N
m = 0
for i in range(N):
  a, b = list(map(int, input().split()))
  B[i] = b
  m = max(m, a)
  
B = sorted(B)
index = bisect.bisect_left(B, m)
#print(index)

over = sum(B[index:])
if over >= H:
  #Bのみ
  now = 0
  i = 1
  while now < H:
    now += B[-i]
    i += 1
  print(i - 1)  
else:
  H -= over
  ans = N - index
  ans += int(H / m)
  if H % m != 0:
    ans += 1
  print(ans)
# Judge status: Wrong Answer
N,C,K = map(int,input().split())
T = [int(input()) for _ in range(N)]


T = sorted(T)
num  = 0  
bus = 0
flag = 0

for n in range(N):
  if flag == 0:
    person_limit = C-1
    time_limit = T[n] + K
    flag = 1
  else:
    if T[n] <= time_limit:
      person_limit -= 1
      if person_limit == 0:
        bus += 1
        flag = 0
    else:
      bus += 1
      person_limit = C-1
      time_limit = T[n] + K
      flag = 1
  if n == N-1 and flag == 1:
    bus += 1

print(bus)
# Judge status: Accepted
a,b = map(str,input().split())

A = int(str(a+b))

B = int(A**0.5)

if A == B*B:
  print("Yes")
else:
  print("No")