peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n, d = map(int,input().split())
cnt = 0
for i in range(n):
    p,q = map(int,input().split())
    if d <= (p**2)+(q**2):
        cnt+=1
print(cnt)
# Judge status: Accepted
D, N = map(int, input().split())
if N<100:
    print(100**D*N)
else:
    print(100**D*101)
# Judge status: Accepted
N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])
mod = 10**9+7

step = [0] * (N+1)
step[0] = 1
step[1] = 1

for i in range(N+1):
    if i==0 or i==1:
        if i in A:
            step[i] = 0
    else:
        step[i] = step[i-1]+step[i-2]
        if i in A:
            step[i] = 0
        step[i] %= mod

print(step[-1])
# Judge status: Accepted
N = int(input())

count = [0 for __ in range(N)]
Nl = [i for i in range(1,N+1)]

for i,n in enumerate(Nl):
    while n%2==0:
        n /= 2
        count[i] += 1
idx = count.index(max(count))
print(Nl[idx])
# Judge status: Accepted
N,M =map(int,input().split())
print(N*(N-1)//2+M*(M-1)//2)
# Judge status: Accepted
X=int(input())
gohyaku = X//500
go = (X-gohyaku*500) // 5
print(gohyaku*1000+go*5)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))

A_=A.copy()
for n in range(N):
    A_[n] = A_[n]-(n+1)
A_.sort()
# A_s=A_[0]
# A_e=A_[-1]
# A_mean=(A_s+A_e)/2
A_mean=sum(A_)/len(A_)

A_mean

def cul_ans(i):
    A_abs_=[]
    for a in A_:
        A_abs_.append(abs(a-i))
    return A_abs_

ans=10**20
for i in range(int(A_mean)-3,int(A_mean)+2):
    
    if ans>sum(cul_ans(i)):
        ans=sum(cul_ans(i))
print(ans)
# Judge status: Wrong Answer
p,q,r=map(int,input().split())
if p+q<q+r and p+q<p+r:
    print(p+q)
if p+r<p+q and p+r<q+r:
    print(p+r)
if q+r<p+r and q+r<p+q:
    print(q+r)
if p+q==q+r and p+q<p+r:
    print(p+q)
if p+r==q+r and p+r<p+q:
    print(p+r)
if p==q==r:
    print(p+q)
# Judge status: Accepted
l, r = (int(_) for _ in input().split())
r = min(r,l+2019)
x = [i*ii%2019 for i in range(l,r+1) for ii in range(i+1,r+1)]
print(min(x))
# Judge status: Accepted
c = input()
if c == "a" or c == "i" or c == "u" or c == "e" or c == "o":
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
from itertools import zip_longest

n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x: -x[1])

stack = []
i = 0
while len(stack) < n and i < m:
  for _ in range(BC[i][0]):
    stack.append(BC[i][1])
    if len(stack) >= n:
      break
  i += 1

ans = 0
for a, s in zip_longest(A, stack, fillvalue=0):
  ans += max(a, s)

print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline
N=int(input())
a=list(map(int,input().split()))
from collections import Counter
d=Counter(a)
ans=0
for key,val in d.items():
    if key>val:
        ans+=val
    elif key<val:
        ans+=val-key
print(ans)
# Judge status: Accepted
def resolve():
    '''
    code here
    '''
    S = int(input())

    a, b = divmod(S, 10**9)
    x2 = (10**9 - b)%10**9
    y2 = (S+x2) // (10**9)

    print(0,0, 10**9, 1, x2, y2)

if __name__ == "__main__":
    resolve()
# Judge status: Accepted
N = int(input())
arr = [0]*(N+1)
ans =0

for i in range(1,N+1):
    for j in range(i,N+1,i):
        arr[j] += 1
    ans += i*arr[i]

print(ans)
# Judge status: Accepted
H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
else:
    if H * W % 2 == 0:
        print(H * W // 2)
    else:
        print(H * W // 2 + 1)
# Judge status: Wrong Answer
N = int(input())
l = []
for i in range(N):
    l.append(input())
k = sorted(l)
ans = 0
for i in range(N):
    a = 0
    if k[i]!=a:
        ans+= 1
        a = k[i]
print(ans)
# Judge status: Wrong Answer
# Problem A - Colorful Subsequence

# input
N = int(input())
S = list(input())

# initialization
word_dic = {}
ans = 1

# word count
for s in S:
    if not s in word_dic:
        word_dic[s] = 1
    else:
        word_dic[s] += 1

# output
for w in word_dic:
    tmp = word_dic[w]
    ans = ans * (tmp + 1)
ans -= 1
print(ans)
# Judge status: Accepted
n = int(input())
for i in range(1,10):
    for j in range(1,10):
        if i*j==n:
            print('Yes');exit()
print('No')
# Judge status: Wrong Answer
n = int(input())
S = list(input() for _ in range(n))

if n == 1:
  print(S[0])
else:
  def intersect_list(l1, l2):
    arr = []
    lst = l1.copy()
    for element in l2:
      try:
        lst.remove(element)
      except ValueError:
        pass
      else:
        arr.append(element)
    return arr

  l = intersect_list(list(S[0]), list(S[1]))
  for i in range(2, n):
    l = intersect_list(l, list(S[i]))

  l.sort()
  print("".join(l))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = 0
dic1 = {}
dic2 = {}
for i in range(n):
    tmp1 = a[i] + (i + 1)
    tmp2 = -a[i] + (i + 1)
    if tmp1 in dic1:
        dic1[tmp1] += 1
    else:
        dic1[tmp1] = 1
    if tmp2 in dic2:
        dic2[tmp2] += 1
    else:
        dic2[tmp2] = 1
for key in dic1.keys():
    if key in dic2:
        ans += dic1[key] * dic2[key]
print(ans)
# Judge status: Accepted
import collections
N=int(input())
L=list(map(int,input().split()))
for i in range(N):
	L.append(i+1)
S=collections.Counter(L)
S=sorted(S.items())
for x,y in S:
	print(y-1)
# Judge status: Accepted
S = input()
print('x'* len(S))
# Judge status: Accepted
# 解説動画視聴

s = input()

a = [0]*(len(s)+1)
if len(s) == 1:
    print(1)
    exit()
for i in range(len(s)):
    if s[i] == '<':
        a[i+1] = max(a[i+1],a[i]+1)
for i in range(len(s)-1,-1,-1):
    if s[i] == '>':
        a[i] = max(a[i],a[i+1]+1)

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

luka =[2, 1]

for i in range(2, N+1):
  a = luka[i-2] + luka[i-1]
  luka.append(a)

print(luka.pop())
# Judge status: Accepted
n,q = map(int,input().split())
s = input()
lr=[list(map(int,input().split())) for i in range(q)]
l=[0]*n
r=[0]*n
lcnt=0
rcnt=0
for i in range(n-1):
    if s[i]=="A" and s[i+1] == "C":
        # lcnt+=1
        rcnt+=1
        l[i+1]=1
    r[i+1]=rcnt
# print(l)
# print(r)
for i in lr:
    # print(max(0,r[i[1]-1]-r[i[0]-1]-l[i[0]-1]))
    # print(s[i[0]-1:i[1]])
    print(max(0,r[i[1]-1]-r[i[0]-1]))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
N = [0] * (n+1)
for i in range(1, n+1):
    N[i] += N[i-1] + a[i-1]

Max = N[-1]
ans = float("INF")
for i in range(1, n):
    if abs(N[i] - (Max-N[i])) < ans:
        ans =  abs(N[i] - (Max-N[i]))
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = sorted([int(i) for i in input().split()])
b = list(range(a[0], a[-1] + 1))
l = len(b)
if l == 0:
    print(0)
else:
    m1 = b[l // 2]
    m2 = b[l // 1 - 1]
    c1, c2 = 0, 0
    for i in range(n):
        c1 += (a[i] - m1) ** 2
        c2 += (a[i] - m2) ** 2
    print(min(c1, c2))
# Judge status: Accepted
X = int(input())

def oneyear(m):
    return m + m//100

y = 0
m = 100
while m < X:
    m = oneyear(m)
    y += 1

print(y)
# Judge status: Wrong Answer
k=int(input())
a,b=list(map(int,input().split()))
if b//k-a//k>=1:
  print("OK")
else:
  print("NG")
# Judge status: Wrong Answer
a, b, c, x, y = map(int, input().split())
big = max(a, b)
small = min(a, b)
small_many = False
if (small == a and y <= x) or (small == b and x <= y):
    small_many = True
if big <= c:
    print(x * a + y * b)
elif small <= c < big:
    if ((big + small) <= 2 * c):
        print(x * a + y * b)
    else:
        if small_many:
            print(2 * c * min(x, y) + small * (max(x, y) - (min(x, y))))
        else:
            print(2 * c * max(x, y))
else:
    print(2 * c * max(x, y))
# Judge status: Accepted
x = int(input())
if x == 0:
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
n,m = map(int,input().split())

if n == 1:
    print(max(0, m-2))
elif m == 1:
    print(max(0, n-2))
else:
    print((n-2) * (m-2))
# Judge status: Accepted
n = int(input())
lower_divisors, upper_divisors = [], []
i = 1
while i*i <= n:
    if n % i == 0:
        lower_divisors.append(i)
        upper_divisors.append(n // i)
    i += 1

ans = (lower_divisors[-1] - 1) + (upper_divisors[-1] - 1)

print(ans)
# Judge status: Accepted
a = list(map(int, input().split()))
if len(list(set(a))) == 2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
h=int(input())
w=int(input())
n=int(input())
if h>=w:
  if n%h==0:
    ans=n//h
  else:
    ans=n//h+1
else:
  if n%w==0:
    ans=n//w
  else:
    ans=n//w+1
print(ans)
# Judge status: Accepted
N = int(input())
L = list(map(int,input().split()))
L.sort()
a = 0
for i in range(0, N):
  for j in range(i + 1, N):
    for k in range(j + 1, N):
      if L[i] < L[j] and L[j] < L[k] and L[i] + L[j] > L[k]:
        a += 1
print(a)
# Judge status: Wrong Answer
L, R = map(int, input().split())
MOD = 2019
x = L % MOD
y = R % MOD

if -(-L//MOD) == (R-1)//MOD:
    print(0)
elif x <= 3 and 693 <= y:
    print(0)
else:
    print(x*(x+1) % MOD)
# Judge status: Wrong Answer
import math
n, m = map(int, input().split())
ans = 0

if m >= 2*n:
    ans += n
    m -= 2*n
else:
    ans += m//2
    m -= m//2

ans += math.floor(m / 4)

print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a>=10 or b>=10:
  print(a*b)
else:
  print(-1)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print(min(c,a//b))
# Judge status: Wrong Answer
N = int(input())
rate = input().split(" ")
for i in range(N):
  rate[i] = int(rate[i])

kabu = 0
money = 1000

for day in range(N):
  if kabu > 0:
    if rate[day-1] < rate[day]:
      money = money + kabu*rate[day]
      kabu = 0
    else:
      None
  else:
    if day == N-1:
      None
    elif rate[day] < rate[day+1]:
      kabu = money // rate[day]
      money = money - kabu*rate[day]
      
print(money)
# Judge status: Accepted
import math
# map(int, input().split())
# int(input())
# input().split()
S = input()
if S[2] == S[3] and S[4] == S[5]: print("Yes")
else: print("No")
# Judge status: Accepted
import math
n,k = map(int,input().split())
a_list = list(map(int,input().split()))
len_a = len(a_list)
if len_a <= k:
    print(1)
else:
    ans = len_a - k
    print(math.ceil(ans / (k-1))  + 1)
# Judge status: Accepted
def main():
    N = int(input())
    m = float("inf")
    ans = 0

    for i in [int(j) for j in input().split()]:
        if i < m:
            m = i
            ans += 1
    
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
P = list(map(int,input().split()))
c = 0

for n in range(N-1):
  if P[n]==n+1:
    P[n],P[n+1] = P[n+1],P[n]
    c+=1

if P[-1]==N:
  print(c+1)
else:
  print(c)
# Judge status: Accepted
X, Y = map(int, input().split())
ans = 0
while X <= Y:
  X *= 2
  ans += 1
print(ans)
# Judge status: Wrong Answer
n = int(input())

print(1000-(n % 1000))
# Judge status: Accepted
s = input()
if s[-1] == "s":
    s += "es"
else:
    s += "s"

print(s)
# Judge status: Wrong Answer
def maxvolume (s): 

    maxvalue = 0

  

    # for length 

    i = 1

    for i in range(s - 1): 

        j = 1

          

        # for breadth 

        for j in range(s): 

              

            # for height 

            k = s - i - j 

              

            # calculating maximum volume. 

            maxvalue = max(maxvalue, i * j * k) 

              

    return maxvalue
# Judge status: Accepted
a = int(input())
s = input()
print(s) if a >= 3200 else print('red')
# Judge status: Accepted
def minus(a:str):
    return int(a)*-1

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

import heapq as hq

def main():
    hq.heapify(A)
    for _ in range(M):
        target = hq.heappop(A)
        target = -1*((-1*target) // 2)
        hq.heappush(A,target)
    print(sum(A)*-1)
    return 

if __name__ == "__main__":
    main()
# Judge status: Accepted
x = int(input())
a = 0
for i in range(1,10**10):
    a += i
    if a >= x :
        print(i)
        break
# Judge status: Wrong Answer
# input
a_n, b_n, m = map(int, input().split())
a = input().split()
b = input().split()
x = [input().split() for i in range(m)]

# calc
min_price = 200000
tmp_price = min_price
for p in x:
   tmp_price = int(a[int(p[0])-1]) + int(b[int(p[1])-2]) - int(p[2])
   if tmp_price < min_price:
       min_price = tmp_price
print(min_price)
# Judge status: Accepted
import sys
input = sys.stdin.readline

L, R, d = [int(_) for _ in input().split()]

answer = 0
for i in range(L, R+1):
    if i % d == 0:
        answer += 1
print(answer)
# Judge status: Accepted
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p = sorted(p, reverse=True)[:X]
q = sorted(q, reverse=True)[:Y]
t = sorted(p+q+r, reverse=True)[:X+Y]
print (sum(t))
# Judge status: Accepted
# https://atcoder.jp/contests/abc139/tasks/abc139_b
a, b = map(int, input().split())

ans = 0
total = 1
while total < b:
    total -= 1
    total += a
    ans += 1
print(ans)
# Judge status: Accepted
N,K = map(int,input().split())
A = list(map(int,input().split()))

for i in range(K,N):
    if A[i-K] < A[i]:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
n,m=map(int,input().split())
if(m<100):
  print(100**n*m)
else:
  print(100**n*101)
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))

a=[]
for i in range(len(h) - 1):
  a.append(h[i] - h[i+1])

cnt=0
temp=0
for i in range(len(a)):
  if a[i] >= 0:
    temp+=1
  else:
    cnt = max(temp, cnt)
    temp=0
cnt = max(temp, cnt)
print(cnt)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

Alice = 0
Bob = 0
A.sort(reverse=True)
for i in range(len(A)):
    if i%2 == 0:
        Alice += A[0]
    else:
        Bob += A[0]
    A.pop(0)
    
print(Alice-Bob)
# Judge status: Accepted
n , a = map(int, input().split())
num = 5000*n
ans = [0, n, 0]

def find(num):
    for _ in range(n+1):
        if num < a:
            ans[0] += 1
            ans[1] -= 1
            num += 5000
        elif num > a:
            ans[1] -= 1
            ans[2] += 1
            num -= 4000
        elif num == a:
            return ' '.join(map(str, ans))
    return '-1 -1 -1'

print(find(num))
# Judge status: Accepted
S = input()
L = len(S)
SS = ""
cnt = 0

if S[0] == "0":
    while len(SS) < L:
        SS += "0"
        SS += "1"

else:
    while len(SS) < L:
        SS += "1"
        SS += "0"

for i in range(L):
    if S[i] != SS[i]:
        cnt += 1

print(cnt)
# Judge status: Accepted
n,k=map(int,input().split())
s=input()
print(s[:k-1]+s[k-1].lower()+s[k:])
# Judge status: Accepted
def resolve():
	s = input()
	if 'a' in s and 'b' in s and 'c' in s:
		print('Yes')
	else:
		print('No')
resolve()
# Judge status: Wrong Answer
n,k = map(int,input().split())
cnt = 0
ch = 0
for i in range(n):
    a,b = map(int,input().split())
    if ch == 0:
        cnt += b
        if cnt >= k:
            print(a)
            ch = 1
# Judge status: Accepted
import sys

input = sys.stdin.readline
N, K = map(int, input().split())
A = list(map(int, input().split()))

print((N-2) // (K-1) + 1)
# Judge status: Wrong Answer
p,q,r=map(int,input().split())
if p+q<=q+r and p+q<p+r:
    print(p+q)
if p+r<p+q and p+r<q+r:
    print(p+r)
if q+r<p+r and q+r<p+q:
    print(q+r)
if p+r==q+r and p+r<p+q:
    print(p+r)
if p==q==r:
    print(p+q)
if r+p==q+r and r+p>p+q:
    print(r+p)
# Judge status: Accepted
N = int(input())

print(int(N * (N - 1) // 2))
# Judge status: Wrong Answer
def sumNum(num, sums):
    if num == 0:
        return sums
    sums += num % 10
    num = num // 10
    return sumNum(num, sums)

N = int(input())
keta = 0

for A in range(2, N):
    B = N - A
    _A = sumNum(A, 0)
    _B = sumNum(B, 0)
    ret = _A + _B
    if keta == 0:
        keta = ret
    if keta <= ret:
        continue
    keta = ret

print(keta)
# Judge status: Accepted
k, n, *A = map(int, open(0).read().split())
B = [a1-a0 for a0, a1 in zip(A, A[1:])] + [k-A[-1]+A[0]]
print(sum(B) - max(B))
# Judge status: Accepted
a, b = map(int, input().split())

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
def q1():
    S = input()
    w = ['Sunny', 'Cloudy', 'Rainy']
    if S == w[0]:
        print(w[1])
    elif S == w[1]:
        print(w[2])
    elif S == w[2]:
        print(w[0])

if __name__ == '__main__':
    q1()
# Judge status: Accepted
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

a,b,c = ip()
k = inp()

ct = 0
while b <= a:
    b *= 2
    ct += 1
while c <= b:
    c *= 2
    ct += 1

if ct <= k:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/A_problems/124.py
#
a, b = map(int, input().split())
if a == b:
    print(2*a)
else:
    print(2*max(a, b)-1)
# Judge status: Wrong Answer
i = list(map(int,input().split()))
num = 100 ** i[0]
print(num * i[1])
# Judge status: Accepted
a,b = map(int,input().split())
if a <= b :
  c = str(a)
  print(c*b)
else:
  c = str(b)
  print(c*a)
# Judge status: Accepted
import itertools

n = int(input())
l = list(map(int, input().split()))
p_list = list(itertools.permutations(l, 3))
results = [x for x in p_list if max(x) < (sum(x) - max(x)) and len(x) == len(set(x))]
print(int(len(results) / 6))
# Judge status: Wrong Answer
import copy
n = int(input())
S = [list(input()) for _ in range(n)]

common_list = copy.deepcopy(S[0])
for s in S:
    print(s, common_list)
    for i in common_list:
        
        if i not in s:
            common_list.remove(i)
        else:
            s.remove(i)
    	

print("".join(sorted(common_list)))
# Judge status: Accepted
S = input()
n = int(S)

d = {}
for i in range(1, n+1):
    if (int(str(i)[0]), int(str(i)[-1])) in d:
        d[(int(str(i)[0]), int(str(i)[-1]))] += 1
    else:
        d[(int(str(i)[0]), int(str(i)[-1]))] = 1

ans = 0
for (a,b), v in d.items():
    if (b, a) in d:
        ans += d[(a, b)] * d[(b, a)]
print(ans)
# Judge status: Accepted
X,Y=map(int,input().split())

if X>=0:
    if Y>=X:
        print(Y-X)
    elif -X<=Y<=0:
        print(Y-(-X)+1)
    elif 0<Y<X:
        print(X-Y+2)
    else:
        print(-Y-X+1)
else:
    if Y>=abs(X):
        print(Y-(-X)+1)
    elif X<=Y<=0:
        print(Y-X)
    elif 0<Y<abs(X):
        print(abs(X)-Y+1)
    else:
        print(abs(Y)-abs(X)+2)
# Judge status: Wrong Answer
N=int(input())
A=[]
B=list(range(2,10))
B=B[::-1]
for i in B:
    while N%i==0:
        A.append(i)
        N//=i
if 1<=len(A) and len(A)<=2:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a,b=map(int,input().split())
if 0 == ((a*b)%2):
  print('even')
else:
  print('Odd')
# Judge status: Wrong Answer
N=int(input())
S=input()
s=[]
for i in S:
    T=ord(i) - ord('A') + 1+N+64
    if T<=90:
        t=T
    else:
        t=T-26
    s.append(chr(t))
print(*s)
# Judge status: Accepted
S=input()
s=list(set(S))
if len(s)==2:
    if S.count(s[0])==2 and S.count(s[1])==2:
        print('Yes')
    else:
        print('No')
else:
    print('No')
# Judge status: Wrong Answer
S = input()
N = len(S)
for d in range(1,N-1):
    if (N-d)&1: continue
    for i in range(N-d):
        if S[i] != S[-1-d-i]: break
    else:
        print(N-d)
        exit()
# Judge status: Wrong Answer
N,M = map(int, input().split())
L = [0]*M
R = [0]*M

for i in range(M):
    L[i],R[i] = map(int, input().split())
    
l = max(L)
r = min(R)

print(r-l+1)
# Judge status: Accepted
N,M=map(int,input().split())
stu=[]
for i in range(N):
  a,b=map(int,input().split())
  stu.append([a,b])
pl=[]
for j in range(M):
  c,d=map(int,input().split())
  pl.append([c,d])
for k in range(N):
  met=4*(10**8)+1
  pr=0
  for l in range(M):
    if abs(pl[l][0]-stu[k][0])+abs(pl[l][1]-stu[k][1])<met:
      met=abs(pl[l][0]-stu[k][0])+abs(pl[l][1]-stu[k][1])
      pr=l+1
  print(pr)
# Judge status: Accepted
print(sum([(1 if s != t else 0) for s, t in zip(input(), input())]))
# Judge status: Wrong Answer
import math

n=int(input())
sqn=int(math.sqrt(n))
soinsu=[]#soinsu[i]はi+2で何回割れるか示す
for i in range(2,sqn+1):
    count=0
    while True:
        if n%i==0:#iで割れるなら
            n=n//i
            count+=1
        else:
            soinsu.append(count)
            break
        
ans=0
for i in range(len(soinsu)):
    ans+=int((-1+math.sqrt(1+8*soinsu[i]))/2)

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

res = A[0]

def f(n, m):
    while m != 0:
        n, m = m, n%m
    return n

for a in A:
    res = f(res, a)

print(res)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    flag=False
    x=int(input())
    for i in range(-200,200):
        for j in range(-200,200):
            if i**5-j**5==x:
                flag=True
                print(i,j)
                break
        if flag:
            break
resolve()
# Judge status: Wrong Answer

def gcd(a,b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b
n = int(input())
a = int(input())
for i in range(n-1):
    b = int(input())
    a = a * b/ gcd(a, b)
print(int(a))
# Judge status: Accepted
A,B,X = map(int, input().split())
if X >= A and B >= (X-A):
  print('YES')
else:
  print('NO')
# Judge status: Accepted
K, A, B = map(int, input().split())
 
ans = 1
if A + 1 >= B  or A >= K:
    ans += K
else:
    # ビスケットがA がたまるまでの操作回数
    K -= A - 1
    # A枚→1円→B枚で2回操作
    r = K // 2
    m = K % 2
    ans = A +  r * (B - A) + m
 
print(ans)
# Judge status: Accepted
n = int(input())
c = 0
for i in range(26):
    for j in range(26):
        if 4 * i + 7 * j == n:
            c = 1
print("Yes" if c == 1 else "No")
# Judge status: Accepted
import sys
input = sys.stdin.readline
S = list(input())
T = list(input())
del S[-1]
del T[-1]
l = len(S)
ans = "No"
for i in range(l) :
    a = S[-1]
    del (S[-1])
    S.insert(0,a)
    if S == T :
        ans = "Yes"
        break
print(ans)
# Judge status: Accepted
from fractions import gcd
from functools import reduce
import sys

input = sys.stdin.readline
MOD = 10 ** 9 + 7


def inverse(n, mod=10 ** 9 + 7):
    return pow(n, mod - 2, mod)


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

    L = reduce(lambda o1, o2: o1 // gcd(o1, o2) * o2, A)
    sigma_A_inv = sum([inverse(a) for a in A])

    print(L * sigma_A_inv % MOD)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N,K = (int(X) for X in input().split())
A  = [int(X) for X in input().split()]
Left  = A.index(1)
Right = (N-1)-Left
Count = (Right%(K-1)!=0)+Right//2
Left  -= Right%(K-1)
Count += (Left%(K-1)!=0)+Left//2
print(Count)
# Judge status: Wrong Answer
n = int(input())
t = list(set([int(input()) for i in range(n)]))
def GCD(a, b):
  if b == 0:
    return a
  else:
    return GCD(b, a%b)
gcd = GCD(max(t), min(t))
lcm = (max(t)//(gcd))*min(t)
print(gcd*lcm)
# Judge status: Wrong Answer
N = int(input())

if N % 111 == 0:
    print(N)
    exit()

print(N * (N//111 + 1))
# Judge status: Wrong Answer
n = int(raw_input())
d = 2
count = 0 
def f(c):

	cumul = 0
	step = 1
	count = 0
	while(cumul < c):
		count +=1
		#stack.append(step)
		cumul += step
		step += 1
	if cumul > c:
		count -=1
		#cumul -= stack.pop()
	return count
	return len(stack)



while(n != 1 and d*d <= n):
	if n%d==0:
		c = 0
		while(n%d == 0): 
			c += 1
			n /= d
		count += f(c)
	d+=1
print count
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())

print("Yes" if (abs(b - a) <= d and abs(c - b) <= d and abs(c - a) <= d) else "No")
# Judge status: Wrong Answer
x, y, z = map(int, input().split())

total = z
count = 0
while total < x:
    total += y + 1
    count += 1
if total == x:
    print(count)
elif total > x:
    print(count - 1)
# Judge status: Accepted
w,h,x,y=map(int,input().split())
if w/2==x and h/2==y:
    ans=1
else:
    ans=0
print(w*h/2,ans)
# Judge status: Accepted
from collections import Counter

n = int(input())
an = list(map(int, input().split(' ')))

c = Counter()
for a in an:
    c[a] += 1

for i in range(1, n + 1):
    print(c[i])
# Judge status: Accepted
k,x=map(int,input().split())
for i in range((k-1)*2+1):
    print(x-k+i+1, end=' ')
print('')