Harryxun/stf_run huggingface dataset:
N,A,B,C,D = map(int,input().split())
S = list(input())

flg = 0

if C < D:
   cnt = 0
    for i in range(A, D):
        if S[i] == '#':
            cnt += 1
        else:
            cnt = 0
        if cnt == 2:
            flg = 1
            break

else:
    cnt = 0
    flg = 1
    for i in range(B-1, D+1):
        if S[i] == '.':
            cnt += 1
        else:
            cnt = 0
        if cnt == 3:
            flg = 0
            break
if flg == 1:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

N,A,B,C,D = map(int,input().split())
S = input()

flg = 0
cnt = 0
S_ac = S[A:C]
S_bd = S[B:D]

if '##' in S_ac or '##' in S_bd:
    flg = 1

if D < C and flg == 0:
    S = S[B-2:D+1]
    if '...' not in S:
        flg = 1

if flg == 1:
    print('No')
else:
    print('Yes')
import collections
def main():

    N, M = map(int, input().split())
    graph = collections.defaultdict(list)
    for _ in range(M):
        x, y = map(int, input().split())
        graph[x].append(y)

    memo = dict()
    def helper(node):
        if node in memo:
            return memo[node]

        max_l = 0
        for nxt in graph[node]:
            max_l = max(max_l, helper(nxt) + 1)
        memo[node] = max_l
        return max_l

    max_l = 0
    for i in range(1, N+1):
        l = helper(i)
        max_l = max(max_l, l)
    return max_l

if __name__ == '__main__':
    print(main())

### FIXED CODE ###

import collections
import sys
def main():

    sys.setrecursionlimit(10 ** 6)

    N, M = map(int, input().split())
    graph = collections.defaultdict(list)
    for _ in range(M):
        x, y = map(int, input().split())
        graph[x].append(y)

    memo = dict()
    def helper(node):
        if node in memo:
            return memo[node]

        max_l = 0
        for nxt in graph[node]:
            max_l = max(max_l, helper(nxt) + 1)
        memo[node] = max_l
        return max_l

    max_l = 0
    for i in range(1, N+1):
        l = helper(i)
        max_l = max(max_l, l)
    return max_l

if __name__ == '__main__':
    print(main())
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
for i in range(N-M+1):
    for j in range(N-M+1):
        cnt = 0
        for k in range(i,i+M): # yoko
            for l in range(j,j+M): # tate
                if A[k][l]!=B[k][l]:
                    break
                else:
                    cnt+=1
        if cnt == M*M:
            print('Yes')
            exit()             
print('No')

### FIXED CODE ###

N, M = map(int, input().split())
A = [list(input()) for _ in range(N)]
B = [list(input()) for _ in range(M)]
for i in range(N-M+1):
    for j in range(N-M+1):
        flg = True
        for k in range(M):
            for l in range(M):
                if A[i+k][j+l]!=B[k][l]:
                    flg = False    
        if flg == True:
            print('Yes')
            exit()             
print('No')
n,m=list(map(int,input().split()))
p=list(map(int,input().split()))
from collections import defaultdict
c=0
for i in range(n):
    if p[i]==i+1:
        c+=1
vis=[0]*n
def dfs(x):
    vis[x]=1
    a.append(x+1)
    for u in d[x]:
        if vis[u]==0:
            dfs(u)
d=defaultdict(list)
for i in range(m):
    a,b=list(map(int,input().split()))
    d[a-1].append(b-1)
    d[b-1].append(a-1)
ans=0
for i in range(n):
    if vis[i]==0:
        a=[]
        dfs(i)
        l=0
        z=0
        for j in a:
            if p[j-1] in a:
                z+=1
            if p[j-1]==j:
                l+=1
        ans=max(ans,c+z-l)
print(ans)
        
                
                
    
    
    
    

### FIXED CODE ###

n,m=list(map(int,input().split()))
p=list(map(int,input().split()))
from collections import defaultdict
from collections import deque
c=0
for i in range(n):
    if p[i]==i+1:
        c+=1
vis=[0]*n
def dfs(x):
    vis[x]=1
    a.add(x+1)
    
    di = deque()
    di.append(x)
    while di:
        now = di.popleft()
        for j in d[now]:
            if not vis[j]:
                vis[j] = 1
                a.add(j+1)
                di.append(j)
    
    
    for u in d[x]:
        if vis[u]==0:
            dfs(u)
d=defaultdict(list)
for i in range(m):
    a,b=list(map(int,input().split()))
    d[a-1].append(b-1)
    d[b-1].append(a-1)
ans=0
for i in range(n):
    if vis[i]==0:
        a=set()
        dfs(i)
        l=0
        z=0
        for j in a:
            if p[j-1] in a:
                z+=1
            if p[j-1]==j:
                l+=1
        ans=max(ans,c+z-l)
print(ans)
A,B,C,D=map(int,input().split())
t=0
while A>0 and C>0:
  if t%2==0:
    A-=D
  else:
    C-=B
  t+=1
if A<=0:
  print("No")
else:
  print("Yes")


### FIXED CODE ###

S,W=map(int,input().split())
if W>=S:
  print("unsafe")
else:
  print("safe")
a, b = map(int, input().split())
s = input()
ok = True
for i in range(a):
    if s[i] == '-':
        ok = False
ok = ok and s[a] == '-'
for i in range(b):
    if s[a + 2 + i] == '-':
        ok = False
if ok:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a, b = map(int, input().split())
s = input()
ok = True
for i in range(a):
    if s[i] == '-':
        ok = False
ok = ok and s[a] == '-'
for i in range(b):
    if s[a + 1 + i] == '-':
        ok = False
if ok:
    print('Yes')
else:
    print('No')
import math
print(2*R*(math.pi))

### FIXED CODE ###

import math
a = int(input())
print(2 * a * math.pi)
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

a,b,c,d = map(int,stdin.readline().rstrip().split())

li = [1]*a+[0]*b+[-1]*c

print(sum(li[:d]))

### FIXED CODE ###

from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

a,b,c,d = map(int,stdin.readline().rstrip().split())

if d > a+b:
    print(a-(d-a-b))
elif d < a:
    print(d)
else:
    print(a)
from sys import exit
from collections import deque
# import copy
# import numpy as np
# from collections import deque

n, m, k = map(int, input().split())
a = deque(list(map(int, input().split())))
b = deque(list(map(int, input().split())))

cnt = 0

while k >= a[0] or k >= b[0]:
    if a[0] < b[0]:
        k -= a.popleft()
        cnt += 1

    elif a[0] > b[0]:
        k -= b.popleft()
        cnt += 1

    else:
        for i in range(1, min(len(a), len(b))+1):
            if a[i] < b[i]:
                for t in range(0, i+1):
                    k -= a[0]
                    a.popleft()
                    cnt += 1
                    if k < a[0]:
                        break
                break
            elif a[i] > b[i]:
                for t in range(0, i+1):
                    k -= b[0]
                    b.popleft()
                    cnt += 1
                    if k < a[0]:
                        break
                break
        else:
            if len(a) > len(b):
                for i in range(len(a)):
                    k -= a[0]
                    a.popleft()
                    if k < a[0]:
                        break
            else:
                for i in range(len(b)):
                    k -= b[0]
                    b.popleft()
                    cnt += 1
                    if k < b[0]:
                        break
    if a == []:
        a = [float("inf")]
    if b == []:
        b = [float("inf")]
print(cnt)


### FIXED CODE ###

from sys import exit
import copy
# import numpy as np
from collections import deque

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

cnt = 0


a.insert(0, 0)
b.insert(0, 0)


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

for i in range(1, m+1):
    b[i] += b[i-1]

tmp = m
for i in range(n+1):
    for j in range(tmp, -1, -1):
        if a[i] + b[j] <= k:
            cnt = max(cnt, i + j)
            tmp = j
            break


print(cnt)
strings = raw_input().split()
cand = [5, 7, 5]

for i in range(len(cand)):
    for j in range(len(strings)):
        if cand[i] == int(strings[j]):
            cand.pop(i)
print(len(cand)==0)

### FIXED CODE ###

from collections import defaultdict
strings = raw_input().split()
# a, b, c = int(strings[0]), int(strings[1]), int(strings[2])
cand = {
    '5': 2,
    '7': 1
}
source = defaultdict(int)
for i in range(len(strings)):
    if strings[i] == '5':
        if source[strings[i]]:
            source[strings[i]] += 1
        else:
            source[strings[i]] = 1
    elif strings[i] == '7':
        if source[strings[i]]:
            source[strings[i]] += 1
        else:
            source[strings[i]] = 1
if source == cand:
    print "YES"
else:
    print "NO"
n,m = map(int, input().split())
ab = list(map(int, input().split()))
s = [0] * (10 ** 5+1)
for a,b in ab:
  s[a] += 1
  s[b] += 1
if any([s % 2 for i in s]):
  print("NO")
else:
  print("YES")
  


### FIXED CODE ###

n,m = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(m)]
s = [0] * (10 ** 5+1)
for a,b in ab:
  s[a] += 1
  s[b] += 1
if any([i % 2 for i in s]):
  print("NO")
else:
  print("YES")
n = int(input())
a = list(map(int,input().split()))

l = []
ans = 0

for x in range(n)
    for _ in range(10000000):
        if a[x]%2 == 0 and a_min > 0:
            ans += 1
            continue
        else:
            l.append(ans)
            ans = 0
            break

print(min(l))

### FIXED CODE ###


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

l = []
ans = 0

for x in range(n):
    for _ in range(10000000):
        if a[x]%2 == 0 and a[x] > 0:
            a[x] = a[x]//2
            ans += 1
            continue
        else:
            l.append(ans)
            ans = 0
            break

print(min(l))
n = input().split(" ")

a = int(n[0])
b = int(n[1])
t = int(n[2])

w = (t / a)
pritn(w * b)

### FIXED CODE ###

n = input().split(" ")
 
a = int(n[0])
b = int(n[1])
t = int(n[2])
 
w = int(t / a)
print(w * b)
N, A = [int(_) for _ in input().split()]

MAX_I = 1000
memo = [[0] * MAX_I for _ in range(N + 2)]


def cnv(v):
    return v - A + (MAX_I // 2)


X = [int(_) for _ in input().split()]
for i in range(N):
    offset = X[i] - A
    # print('x', offset)

    mm = memo[i]
    for j in range(MAX_I):
        if mm[j] > 0:
            memo[i + 1][j + offset] += mm[j]
        memo[i + 1][j] += mm[j]

    memo[i + 1][cnv(X[i])] += 1

print(memo[N][MAX_I//2])


### FIXED CODE ###

N, A = [int(_) for _ in input().split()]

MAX_I = 5000
memo = [[0] * MAX_I for _ in range(N + 2)]


def cnv(v):
    return v - A + (MAX_I // 2)


X = [int(_) for _ in input().split()]
for i in range(N):
    offset = X[i] - A
    # print('x', offset)

    mm = memo[i]
    for j in range(MAX_I):
        if mm[j] > 0:
            memo[i + 1][j + offset] += mm[j]
        memo[i + 1][j] += mm[j]

    memo[i + 1][cnv(X[i])] += 1

print(memo[N][MAX_I//2])
import fractions
import numpy as np
from functools import reduce
from operator import mul

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

mod = 10**9+7

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

primes = sieve(A)
# primes = sieve(int(max(A)**0.5)+1)

def primeFactorization(n):
    temp = n
    ans = [0 for _ in range(len(primes))]
    for i in range(len(primes)):
        while temp%primes[i] == 0:
            temp /= primes[i]
            ans[i] += 1
    return ans

AFactorized = list(map(primeFactorization, A))

lcm = [0 for _ in range(len(primes))]
for i in AFactorized:
    lcm = np.maximum(lcm, i)

B = [lcm-a for a in AFactorized]

ans = 0
for b in B:
    ans += reduce(mul, primes**b%mod)
    ans %= mod

print(ans)

### FIXED CODE ###

import fractions
from functools import reduce

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

p = 10**9+7

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(A)

B = [lcm//i for i in A]

print(sum(B)%p)
a,b,c = map(int,input().split())

print(max(c-(a-b),0)

### FIXED CODE ###

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

print(max(c-(a-b),0))
N,K = map(int, input().split())
A =[0]
B=list(map(int, input().split()))
for m in range(N):
    A.append(B[m])
place=set([])
p=[]
i=1
count=0
while i not in place:
    place.add(i)
    p.append(i)
    i=A[i]
    count+=1
if count>=K:
    print(place[K+1])
else:
    loop=[i]
    start=i
    j=A[i]
    count+=1
    while j!=start:
        loop.append(j)
        j=A[j]
        count+=1
    if count>=K:
        print(loop[K-len(p)])
    else:
        num=(K-count)%len(loop)
        print(loop[num])

### FIXED CODE ###

N,K = map(int, input().split())
A =[0]
B=list(map(int, input().split()))
for m in range(N):
    A.append(B[m])
place=set([])
p=[]
i=1
count=0
while i not in place:
    place.add(i)
    p.append(i)
    i=A[i]
    count+=1
if count>K:
    print(p[K])
else:
    loop=[i]
    start=i
    j=A[i]
    count+=1
    while j!=start:
        loop.append(j)
        j=A[j]
        count+=1
    if count>K:
        print(loop[K-len(p)])
    else:
        num=(K-count)%len(loop)
        print(loop[num])
N=int(input())
L=list(map(int,input().split()))
if al(l%2==0 for l in L):
  print("second")
else:
  print("first")

### FIXED CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]

if all(v % 2 == 0 for v in A):
    print("second")
else:
    print("first")
while True:
    w, h = map(int, raw_input().split())
    if w == 0 and h == 0:
        break
    tile = []
    for i in range(h):
        tile.append(list(raw_input()))
    print tile
    x = y = 0
    while True:
        a = tile[y][x]
        tile[y][x] = 0
        if   a == ">": x += 1
        elif a == "<": x -= 1
        elif a == "^": y -= 1
        elif a == "v": y += 1
        elif a == ".": print x,y   ; break
        else:        print "LOOP"; break

### FIXED CODE ###

while True:
    h, w = map(int, raw_input().split())
    if w == 0 and h == 0:
        break
    tile = []
    for i in range(h):
        tile.append(list(raw_input()))
    x = y = 0
    while True:
        a = tile[y][x]
        tile[y][x] = 0
        if   a == ">": x += 1
        elif a == "<": x -= 1
        elif a == "^": y -= 1
        elif a == "v": y += 1
        elif a == ".": print x,y; break
        else: print "LOOP"; break
from fractions import gcd
n,k=map(int,input().split())
a=list(map(int,input().split()))
g=gcd(a[0],a[1])
for j in range(1,n):
  g=gcd(g,a[j])
m=max(a)
if k<=m and k%g==0:print('POSSIBLE')
else:print('IMPOSSIBLE')

### FIXED CODE ###

from fractions import gcd
n,k=map(int,input().split())
a=list(map(int,input().split()))
if n>=2:
  g=gcd(a[0],a[1])
  for j in range(1,n):
    g=gcd(g,a[j])
  m=max(a)
  if k<=m and k%g==0:print('POSSIBLE')
  else:print('IMPOSSIBLE')
else:
  if a[0]==k:print('POSSIBLE')
  else:print('IMPOSSIBLE')
f = lambda : raw_input().rstrip()
f1 = lambda : f().split()
f2 = lambda t : map(t, f1())

def main1():
    A, B, C = f2(int)
    print 0 if B + C <= A else (B + C) % A

def main2():
    n = int(f())
    p = 0
    ans = 0
    while 10**p<n:
        if 10**(p+1) > n:
            ans = ans + n - 10**p + 1
        else:
            ans = ans + 10**(p+1) - 10**p 
        p = p + 2
    print ans
    
def main3():
    n = int(f())
    a = f2(int)
    m = 0
    for i in xrange(1,n):
        if a[i] < a[i-1]:
            m = m + 1#(a[i-1] - a[i])
  
    print "Yes" if m < 2 else "No"

def main4():
    s = f()
    n = len(s)
    ans = [0]*n
    m = 1
    i = 1
    st = 0
    s = s + ("L" if s[-1]=="R" else "R")
    while i <= n:
        if s[i] != s[i-1]:
            #print i, st,
            j = st if s[i-1]=="L" else i
            #print j
            if m&1:
                ans[j-1] = ans[j-1] + m/2 + (1 if s[i-1] == "R" else 0) 
                ans[j] = ans[j] + m/2 + (1 if s[i-1] == "L" else 0)
            else:
                ans[j-1] =  ans[j-1] + m/2
                ans[j] = ans[j] + m/2
            m = 0
            st = i
        #print ans
        i = i + 1
        m = m + 1
    print " ".join(map(str,ans)) 
         
if __name__=="__main__":
    main1()

### FIXED CODE ###

f = lambda : raw_input().rstrip()
f1 = lambda : f().split()
f2 = lambda t : map(t, f1())

def main1():
    A, B, C = f2(int)
    print 0 if B + C <= A else (B + C) - A

def main2():
    n = int(f())
    p = 0
    ans = 0
    while 10**p <= n:
        if 10**(p+1) > n:
            ans = ans + n - 10**p + 1
        else:
            ans = ans + 10**(p+1) - 10**p 
        p = p + 2
    print ans
    
def main3():
    n = int(f())
    a = f2(int)
    m = 0
    for i in xrange(1,n):
        if a[i] < a[i-1]:
            m = m + 1#(a[i-1] - a[i])
  
    print "Yes" if m < 2 else "No"

def main4():
    s = f()
    n = len(s)
    ans = [0]*n
    m = 1
    i = 1
    st = 0
    s = s + ("L" if s[-1]=="R" else "R")
    while i <= n:
        if s[i] != s[i-1]:
            #print i, st,
            j = st if s[i-1]=="L" else i
            #print j
            if m&1:
                ans[j-1] = ans[j-1] + m/2 + (1 if s[i-1] == "R" else 0) 
                ans[j] = ans[j] + m/2 + (1 if s[i-1] == "L" else 0)
            else:
                ans[j-1] =  ans[j-1] + m/2
                ans[j] = ans[j] + m/2
            m = 0
            st = i
        #print ans
        i = i + 1
        m = m + 1
    print " ".join(map(str,ans)) 
         
if __name__=="__main__":
    main2()
x=input().split()
a = x[0]
b = x[1]

print( a*b +' '+ a*2+b*2 )

### FIXED CODE ###

x=input().split()
a = int(x[0])
b = int(x[1])

print( a*b , a*2+b*2 )
[XYZK,A,B,C] = [input() for i in range(4)]
[X,Y,Z,K] = [int(i) for i in XYZK.split()]
A = [int(i) for i in A.split()]
B = [int(i) for i in B.split()]
C = [int(i) for i in C.split()]
Ans = [0 for i in range(K)]
for a in A:
    for b in B:
        for c in C:
            abc = a+b+c
            if min(Ans) < a + b + c:
                Ans[Ans.index(min(Ans))] = a+b+c
Ans = sorted(Ans,reverse=True)
for i in range(Ans):
    print(Ans[i])

### FIXED CODE ###

[XYZK,A,B,C] = [input() for i in range(4)]
[X,Y,Z,K] = [int(i) for i in XYZK.split()]
A = sorted([int(i) for i in A.split()],reverse=True)[:K]
B = sorted([int(i) for i in B.split()],reverse=True)[:K]
C = sorted([int(i) for i in C.split()],reverse=True)[:K]

ABC = []
for i in range(X):
    if (i + 1) > K:
        break
    for j in range(Y):
        if (i + 1) * (j + 1) > K:
            break
        for l in range(Z):
            if (i + 1) * (j + 1) * (l + 1) > K:
                break
            ABC.append(A[i] + B[j] + C[l])
ABC = sorted(ABC, reverse=True)
print(*ABC[:K])
h, w = map(int, input().split())
pict = [[0]*(w+2) for _ in range(h+2)]

for y in range(1, h+1):
    pict[y][1:w+1] = list(input())
ans = "Yes"
for y in range(h):
    for x in range(w):
        if pict[x][y] == "#":
            if pict[x-1][y] == "." and pict[x+1][y] == "." and pict[x][y-1] == "." and pict[x][y+1] == ".":
                ans = "No"
print(ans)


### FIXED CODE ###

h, w = map(int, input().split())
pict = [[0]*(w+2) for _ in range(h+2)]

for y in range(1, h+1):
    pict[y][1:w+1] = list(input())
ans = "Yes"
for y in range(h):
    for x in range(w):
        if pict[y][x] == "#":
            if pict[y-1][x] == "." and pict[y+1][x] == "." and pict[y][x-1] == "." and pict[y][x+1] == ".":
                ans = "No"
print(ans)
a_1 = list(map(int,input().split()))
a_2 = list(map(int,input().split()))
a_3 = list(map(int,input().split()))
a = [a_1,a_2,a_3]
n = int(input())
for i in range(n):
  h = int(input())
  for j in range(3):
    for k in range(3):
      if(a[j][k]==h):
        a[j][k]=0
ans = "No"
for i in range(3):
  if(len(set(a[i]+[0]))==1):
    ans = "Yes"
for i in range(3):
  if(len(set([a[0][i],a[1][i],a[2][i],[0]]))==1):
    ans= "Yes"
if((a[0][0]==0)and(a[1][1]==a[2][2])and(a[0][0]==a[1][1]))or((a[0][2]==0)and(a[1][1]==a[2][0])and(a[0][2]==a[1][1])):
  ans = "Yes"
  
print(ans)
    


### FIXED CODE ###

a_1 = list(map(int,input().split()))
a_2 = list(map(int,input().split()))
a_3 = list(map(int,input().split()))
a = [a_1,a_2,a_3]
n = int(input())
for i in range(n):
  h = int(input())
  for j in range(3):
    for k in range(3):
      if(a[j][k]==h):
        a[j][k]=0
ans = "No"
for i in range(3):
  if(a[i][0]==0)and(a[i][0]==a[i][1])and(a[i][1]==a[i][2]):
    ans = "Yes"
for i in range(3):
  if(a[0][i]==0)and(a[0][i]==a[1][i])and(a[1][i]==a[2][i]):
    ans= "Yes"
if((a[0][0]==0)and(a[1][1]==a[2][2])and(a[0][0]==a[1][1]))or((a[0][2]==0)and(a[1][1]==a[2][0])and(a[0][2]==a[1][1])):
  ans = "Yes"
  
print(ans)
import queue
dx=[1,0,-1,0]
dy=[0,1,0,-1]
H,W=map(int,input().split())
S=[]
for h in range(H):
  S.append(input())

def bfs(s):
  dist = [[-1]*H for _ in range(W)]
  
  h,w = s
  dist[h][w]=0
  que = queue.Queue()
  que.put(s)
  
  while not(que.empty()):
    h,w = que.get()
    for d in range(4):
      nh = h + dx[d]
      nw = w + dy[d]
      if nh<0 or H<=nh or nw<0 or W<=nw:
        continue
      if S[nh][nw]=="#":
        continue
      if dist[nh][nw]==-1:
        dist[nh][nw]=dist[h][w]+1
        que.put([nh,nw])
  return dist[h][w]

ans = 0
for h in range(H):
  for w in range(W):
    if S[h][w]==".":
      ans = max(ans,bfs([h,w]))
print(ans)
      

### FIXED CODE ###

import sys
import queue
def I(): return int(sys.stdin.readline())
def LI(): return [int(x) for x in sys.stdin.readline().split()]

d = [[-1,0],[1,0],[0,-1],[0,1]]

H,W = LI()
S = [list(input()) for _ in range(H)]

def bfs(s):
    dist = [[-1]*W for _ in range(H)]
    h,w = s
    dist[h][w] = 0
    que = queue.Queue()
    que.put(s)
    while(not(que.empty())):
        h,w = que.get_nowait()
        for dh,dw in d:
            nh,nw = h+dh,w+dw
            if 0<=nh<H and 0<=nw<W and dist[nh][nw]==-1 and S[nh][nw]=='.':
                dist[nh][nw] = dist[h][w] + 1
                que.put([nh,nw])
    return dist[h][w]

def main():
    ans = 0
    for h in range(H):
        for w in range(W):
            if S[h][w] == '.':
                ans = max(ans,bfs([h,w]))
#                if (((h==0 or S[h-1][w]=='#') or (h==H-1 or S[h+1][w]=='#')) and 
#                        ((w==0 or S[h][w-1]=='#') or (w==W-1 or S[h][w+1]=='#'))):
#                    ans = max(ans,bfs([h,w]))
    print(ans)

if __name__ == "__main__":
    main()
print('pphbhhphph'.index(int(input())%10)+'on')

### FIXED CODE ###

N = int(input())
n = N%10
if n==3:
    print('bon')
elif n in (0,1,6,8):
    print('pon')
else:
    print('hon')
from math import gcd
N = int(input())
A = list(map(int, input().split()))
 
ans = 0
MOD = 1000000007
 
LCM = A[0]
for i in range(1, N):
    LCM *= A[i] // gcd(LCM, A[i])
    
for a in A:
  ans += LCM // a
  
print(ans%MOD)


### FIXED CODE ###

from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
 
ans = 0
MOD = 1000000007
 
LCM = A[0]
for i in range(1, N):
    LCM *= A[i] // gcd(LCM, A[i])
    
for a in A:
  ans += LCM // a
  
print(ans%MOD)