Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 26 14:22:54 2020

@author: Maruthi Srinivas
"""
import sys
sys.setrecursionlimit(10000000000)
def dfs(node,graph):
    temp=0
    for i in graph[node]:
        temp=max(temp,dfs(i,graph)+1)
    return temp
            
v,e=map(int,input().split())
adj={x:[] for x in range(v+1)}
for i in range(e):
    x,y=map(int,input().split())
    adj[x].append(y)
m=-1
for i in range(1,v+1):
    visited=[False]*(v+1)
    x=dfs(i,adj)
    #print(i,x)
    m=max(m,x)
print(m)



### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Jul 26 14:22:54 2020

@author: Maruthi Srinivas
"""
import sys
sys.setrecursionlimit(1000000)
def dfs(node,graph,dp):
    temp=0
    if dp[node]!=-1:
        return dp[node]
    for i in graph[node]:
        temp=max(temp,dfs(i,graph,dp)+1)
    dp[node]=temp
    return temp
            
v,e=map(int,input().split())
adj={x:[] for x in range(v+1)}
for i in range(e):
    x,y=map(int,input().split())
    adj[x].append(y)
m=-1
dp=[-1]*(v+1)
for i in range(1,v+1):
    x=dfs(i,adj,dp)
    m=max(m,x)
print(m)
#!/usr/bin/python3
# -*- coding: utf-8 -*-
a, b = input().strip().split()
a = int(a)
for _ in range(len(b)):
    a = a*10
ab = a+int(b)
for i in range(ab):
    if i * i = ab:
        print("Yes")
    elif i * i < ab:
        continue
    else:
        print("No")
        break

### FIXED CODE ###

#!/usr/bin/python3
# -*- coding: utf-8 -*-
a, b = input().strip().split()
a = int(a)
for _ in range(len(b)):
    a = a*10
ab = a+int(b)
for i in range(ab):
    if i * i == ab:
        print("Yes")
        break
    elif i * i < ab:
        continue
    else:
        print("No")
        break
X = int(input())
M = 100
y = 0
while X > M:
  M = int(M*1.01)
  y += 1X = int(input())
M = 100
y = 0
while X > M:
  M = int(M*1.01)
  y += 1
print(y)

### FIXED CODE ###

X = int(input())
M = 100
y = 0
while X > M:
  M += M//100
  y += 1
print(y)
a=Y
b=X
c=Z
A=c
B=b
C=a
print(A B C)

### FIXED CODE ###

X,Y,Z=input().split()
print(Z,X,Y)
import sys
input = sys.stdin.readline

def main():

    """
    # color: 親と自らを繋ぐ辺の色
    # now: 現在地
    """
    def dfs(color,now):
        # 現在地が葉のとき
        if not now in a:
            return

        # 現在地から伸びる辺のインデックス
        index = [i for i in range(N-1) if now == a[i]]

        # 子ノードに伸びる辺を色塗り
        number = 1
        for i in range(len(index)):
            if number == color:
                number += 1
            K[index[i]] = number
            # 子ノードで色塗り開始
            dfs(number, b[index[i]])
            number += 1

    N = int(input())
    a = [0] * (N-1)
    b = [0] * (N-1)
    for i in range(N-1):
        a[i],b[i] = map(int,input().split())
    # 辺の色
    K = [0] * (N-1)
    dfs(0,1)
    print(len(set(K)))
    for i in K:
        print(i)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
N = int(input())
AB = [[int(i) for i in input().split()] for _ in range(N-1)]

# graph[i]: 頂点iの親と子の集合
graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

# 根
root = 1
# parent[i]: 頂点iの親
parent = [0]*(N+1)
# トポロジカル順序
order = []
# 未探索の頂点
stack = [root]

# dfsでparentを求める
while stack:
    # n: 探索する頂点
    n = stack.pop()
    order.append(n)
    for j in graph[n]:
        # jがnの親の場合
        if j == parent[n]:
            continue
        parent[j] = n
        stack.append(j)

# color[i]: 頂点iと親を繋ぐ辺の色
color = [-1] * (N+1)
# dfsで色を塗る
for i in order:
    # 既に使用した色
    ng = color[i]
    # 色
    c = 1
    for j in graph[i]:
        # jがiの親の場合(塗装済みなのでcontinue)
        if j == parent[i]:
            continue
        if c == ng:
            c += 1
        # 頂点iと頂点jの辺に色を塗る
        color[j] = c
        c += 1

# 入力順に辺の色を出力する
answer = [color[a] if parent[a]==b else color[b] for a,b in AB]
print(max(answer))
print("\n".join(map(str,answer)))
k,n = map(int, input().split())
prices = list(int, input().split()).sort()
total = sum(prices[:n])
print(total)


### FIXED CODE ###

k, n = map(int, input().split())
prices = list(map(int, input().split()))
prices.sort()
total = sum(prices[:n])
print(total)
n = int(input())
 
total = 0
for i in range(1, n+1):
  if i%2==0: continue
  cnt = 0
  for j in range(1, j+1):
    if i%j ==0: cnt+=1
  
  if cnt==8:
    total += 1
 
print(total)

### FIXED CODE ###

n = int(input())
 
total = 0
for i in range(1, n+1):
  if i%2==0: continue
  cnt = 0
  for j in range(1, n+1):
    if i%j ==0: cnt+=1
  
  if cnt==8:
    total += 1
 
print(total)
#!/usr/bin/python
# -*- coding: utf-8 -*-

# def
def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return x

def str_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(input()))
    return x

def int_map():
    return map(int,input().split())

def int_list():
    return list(map(int,input().split()))

def print_space(l):
    return print(" ".join([str(x) for x in l]))

# import
import numpy as np
import statistics
import math
import collections

# main code
H,W,M = int_map()
hw = int_mtx(M)

h = []
w = []
for hhww in hw:
    h.append(hhww[0])
    w.append(hhww[1])

ch = collections.Counter(h)
cw = collections.Counter(w)
a = ch.most_common()[0][1]
b = cw.most_common()[0][1]

if a < b:
    bb = cw.most_common()[0][0]
    hw1 = [i for i in hw if not i[1] == bb]
    
    h1 = []
    for hhww in hw1:
        h1.append(hhww[0])

    ch1 = collections.Counter(h1)
    a1 = ch1.most_common()[0][1]

    print(b+a1)
    exit()
else:
    aa = ch.most_common()[0][0]
    hw1 = [i for i in hw if not i[0] == aa]
    
    w1 = []
    for hhww in hw1:
        w1.append(hhww[1])

    cw1 = collections.Counter(w1)
    b1 = cw1.most_common()[0][1]

    print(a+b1)
    exit()



### FIXED CODE ###


#!/usr/bin/python
# -*- coding: utf-8 -*-

# def
def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return x

def str_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(input()))
    return x

def int_map():
    return map(int,input().split())

def int_list():
    return list(map(int,input().split()))

def print_space(l):
    return print(" ".join([str(x) for x in l]))

# import
import numpy as np
import statistics
import math
import collections

# main code
H,W,M = int_map()
hw = int_mtx(M)

h = []
w = []
for hhww in hw:
    h.append(hhww[0])
    w.append(hhww[1])

ch = collections.Counter(h)
cw = collections.Counter(w)
a = ch.most_common()[0][1]
b = cw.most_common()[0][1]

if a == M or b == M:
    print(M)
    exit()

if a < b:
    bb = cw.most_common()[0][0]
    hw1 = [i for i in hw if not i[1] == bb]
    
    h1 = []
    for hhww in hw1:
        h1.append(hhww[0])

    ch1 = collections.Counter(h1)
    a1 = ch1.most_common()[0][1]

    print(b+a1)
    exit()
else:
    aa = ch.most_common()[0][0]
    hw1 = [i for i in hw if not i[0] == aa]
    
    w1 = []
    for hhww in hw1:
        w1.append(hhww[1])

    cw1 = collections.Counter(w1)
    b1 = cw1.most_common()[0][1]

    print(a+b1)
    exit()
raw_input = input()

l = raw_input.split()
A = int(l[0])
B = int(l[1])

answers = [1,2,3]

answers.remove(A)
answers.remove(B)


for ans in answers:
    print(ans)

### FIXED CODE ###

raw_input1 = input()
raw_input2 = input()

A = int(raw_input1)
B = int(raw_input2)

answers = [1,2,3]

answers.remove(A)
answers.remove(B)


for ans in answers:
    print(ans)
n = int(input())
h = [int(x) for x in input().split(" ")]

for i in range(1, n):
  if h(-i)-h(-i-1) >= 0:
    continue  
  if h(-i)-h(-i-1) == -1:
    h(-i-1) = h(i-1) - 1
    continue
  if h(i)-h(-i-1) < -1:
    ans = "No"
    break
else:
  ans = "Yes"

print(ans)

### FIXED CODE ###

n = int(input())
h = [int(x) for x in input().split(" ")]
 
for i in range(1, n):
  if h[-i]-h[-i-1] >= 0:
    continue  
  elif h[-i]-h[-i-1] == -1:
    h[-i-1] = h[-i-1] - 1
    continue
  elif h[-i]-h[-i-1] < -1:
    ans = "No"
    break
else:
  ans = "Yes"
  
print(ans)
N = int(input())
A = input()
B = input()

r = ""
for i in range(N):
  i+= A[i]
  i+= B[i]

### FIXED CODE ###

N = int(input())
A, B = input().split()
 
r = ""
for i in range(N):
  r+= A[i]
  r+= B[i]
print(r)
t=list(map(int,input().split()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
p,q=[0],[0]
x,y=[(a[0]-b[0])*t[0],(a[1]-b[1])*t[1]]
if x+y==0:
    print("infinity")
elif (x<0 and y<0) or (x>0 and y>0):
    print(0)
#elif (x<0 and x+y>0) or (x>0 and x+y<0):
elif (x<0 and x+(x+y)>0) or (x>0 and x+(x+y)<0):
    print(1)
else:
    print(hhh)

### FIXED CODE ###

T1, T2 = map(int, input().split())
A1, A2 = map(int, input().split())
B1, B2 = map(int, input().split())
 
P = (A1 - B1) * T1
Q = (A2 - B2) * T2
if P > 0:
	P *= -1
	Q *= -1
 
if P + Q < 0:
	print(0)
elif P + Q == 0:
	print("infinity")
else:
	S = (-P) // (P + Q)
	T = (-P) % (P + Q)
	if T != 0:
		print(S * 2 + 1)
	else:
		print(S * 2)
import math

a, b = map(float, input().split())
ans = math.floor(int(a)*b)
print(ans)

### FIXED CODE ###

a, b = map(float, input().split())
A = int(a)
B = int(b*1000)

ans = A * B
print(ans//1000)
import itertools
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N, K = map(int, input())
x = combinations_count(N-1, 2)
if N-1 < K < combinations_count(N-1, 2):
    print('-1')
    quit()

for i in range(2,N+1):
    print('1', str(i))

for i in range(2,x-K,2):
    print(str(i), str(i+1))

### FIXED CODE ###

import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N, K = map(int, input().split())
if N > 2:
    x = combinations_count(N-1, 2)
else:
    x = 0
if x < K:
    print('-1')
    quit()

h = []
for i in range(2,N+1):
    h.append(('1', str(i)))

hen = x-K
x = 2
y = 3
while hen > 0:
    h.append((x,y))
    y += 1
    if y > N:
        x += 1
        y = x+1
    hen -= 1

print(len(h))
for x,y in h:
    print(x,y)
m = max([c, d])
if n>m:
    n = m
    s = s[:n]
    
if '##' in s:
    print('No')
else:
    if c>d:
        if '...' in s:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes') 

### FIXED CODE ###

n, a, b, c, d = (int(i) for i in input().split())  
s = str(input())
n = len(s)

m = max([c, d])
if n>m:
    n = m
    s = s[:n]
    
if '##' in s[a-1:]:
    print('No')
elif b>c:
    print('Yes')
else:
    if c>d:
        if '...' in s[b-2:d+1]:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes')
dict={25:'Christmas',24:'Christmas Eve',23:'Christmas Eve Eve',22:'Christmas Eve Eve Eve'}
print(dict[input()])

### FIXED CODE ###

dict={25:'Christmas',24:'Christmas Eve',23:'Christmas Eve Eve',22:'Christmas Eve Eve Eve'}
print(dict[int(input())])
a,b = (int, input().split())
print( max(0, a-b*2) )

### FIXED CODE ###

a,b = map(int, input().split())
print(max(0, a-b*2))
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x = 3:
                        cnt += 1
                        break

print(cnt)

### FIXED CODE ###

N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append([a-1,b-1])
if n==2:
    print(0)
    exit()


def f(x,y,c):
    c += 1
    for e in edge[x]:
        if e == y:
            continue
        if c > d:
            used[e] = 1
        f(e,x,c)



if k % 2 == 0:
    d = k//2
    res = []
    for i in range(n):
        used = [0]*n
        f(i,-1,0)
        res.append(sum(used))
    print(min(res))
else:
    d = (k-1)//2
    res = []
    for e1 in alledge:
        used = [0]*n
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        res.append(sum(used))
    print(min(res))


### FIXED CODE ###

import sys
#input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append((a-1,b-1))

def f(x,y,c):
    global tmp
    c += 1
    for e in edge[x]:
        if e == y:
            continue
        if c > d:
            tmp +=1
        f(e,x,c)

sys.setrecursionlimit(4100000)

if k % 2 == 0:
    d = k//2
    ass = 2001
    for i in range(n):
        tmp = 0
        f(i,-1,0)
        ass = min(ass,tmp)
    print(ass)
else:
    d = (k-1)//2
    ass = 2001
    for e1 in alledge:
        tmp = 0
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        ass = min(ass,tmp)
    print(ass)
n,k=map(int,input().split())
h = set(map(int,input().split()))

h = sorted(h)
l = len(h)
if k != 0:
  for i in range(l-k,l):
    h[i] = 0
  
result = 0  
for j in range(0, l):
  result = result + h[j]
print(h)
print(result)


### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
for i in range(k):
  try:
    h.pop(-1)
  except IndexError:
    pass
print(sum(h))
N, M, Q = map(int, input().split())
l = []
for i in range(Q):
  l.append(list(map(int, input().split())))

A_N = [[i] for i in range(1, M+1)]
for i in range(N-1):
  a = []
  for j in range(len(A_N)):
    last = A_N[j][-1]
    for k in range(last, M+1):
      a.append(A_N[j] + [k])
  A_N = a

high_score = 0
for i in range(len(A_N)):
    A = A_N[i]
    score = 0
    for j in range(len(l)):
        aj, bj, cj, dj = l[j]
        if A[bj-1]-A[aj-1] == cj:
            score += dj
        high_score = max(high_score, score) 
        
print(high_score)

### FIXED CODE ###

K = int(input())
A, B = map(int, input().split())

x = list(range(A, B+1))

for i in x:
  if i % K == 0:
    print('OK')
    break
  elif i == B:
    print('NG')
  else:
    pass
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and lst1[1] >=13):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12 and int(lst1[1])>=13:
      print("MMYY")
elif 0<int(lst1[1])<=12 and int(lst1[0])>=13:
      print("YYMM")

### FIXED CODE ###

n,k = map(int,input().split())
s = list(input())
ans = ''

if s[k-1] == 'A':
  s[k-1] = 'a'
elif s[k-1] == 'B':
  s[k-1] = 'b'
else:
  s[k-1] = 'c'
  
for i in s:
  ans += i
  
print(ans)
l,r = map(int,input().split())

for i in range(l,r):
    for j in range(l+1,r):
        if i == l and j == l+1:
            ans = (i*j)%2019
        else:
            res = (i*j)%2019
            ans = min(ans,res)
print(ans)


### FIXED CODE ###

l,r = map(int,input().split())

if r - l >= 2018:
    print(0)
else:
    ans = 2019
    for i in range(l,r):
        for j in range(i+1,r+1):
            ans = min(ans,(i*j)%2019)
    print(ans)
X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

ans = []
for x in range(X):
    for y in range(Y):
        for z in range(Z):
            if (x + 1) * (y + 1) * (z + 1) <= K:
                ans.append(A[x] + B[y] + C[z])
            else:
                break

ans.sort(revere=True)
print(*ans[:K], sep='\n')


### FIXED CODE ###

from heapq import heappush, heappop

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

q = []
x = y = z = 0
heappush(q, (-(A[x] + B[y] + C[z]), (x, y, z)))
done = set((0, 0, 0))
ans = []
for _ in range(K):
    val, (x, y, z) = heappop(q)
    ans.append(-val)
    for i, j, k in [(1, 0, 0), (0, 1, 0), (0, 0, 1)]:
        nx = x + i; ny = y + j; nz = z + k
        if nx < X and ny < Y and nz < Z and (nx, ny, nz) not in done:
            heappush(q, (-(A[nx] + B[ny] + C[nz]), (nx, ny, nz)))
            done.add((nx, ny, nz))

print(*ans, sep='\n')
import math
def cmb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def main():
    import sys
    N,M=list(map(int,sys.stdin.readline().split()))
    print(cmb(M,2)+cmb(N,2))


main()


### FIXED CODE ###

import math
def cmb(n, r):
    if n<2:
        return 0

    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def main():
    import sys
    N,M=list(map(int,sys.stdin.readline().split()))
    print(cmb(M,2)+cmb(N,2))


main()
#c
import sys
sys.setrecursionlimit(10000)
n,m = map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()) )
mod=10**9 + 7

def cmb(n, r, m,g1,g2):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % m

def nCrMOD(n,r,m):
    g1 = [1, 1]
    g2 = [1, 1]
    inverse = [0, 1]
    for i in range( 2, n + 1 ):
        g1.append( ( g1[-1] * i ) % m )
        inverse.append( ( -inverse[m % i] * (m//i) ) % m )
        g2.append( (g2[-1] * inverse[-1]) % m )
    return cmb(n,r,m,g1,g2)


c=0
for i in range(m-1):
    if a[i]==a[i+1]-1: c+=1
if c!=0:
    print(0)
else:
    b=[a[0]-1] + [a[j+1]-a[j]-2 for j in range(m-1)] + [n-a[-1]-1]
    cc=[ sum( nCrMOD(bb-i,i,mod) for i in range(bb//2+1) )%mod for bb in b ]

    ans=1
    for ccc in cc:
        ans = ans*ccc%mod
    print(ans)

### FIXED CODE ###

#c dp version
n,m = map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()) )
from collections import deque
a=deque(a)
mod=10**9 + 7

dp=[0]*(n+2)
dp[0]=0
dp[1]=1
aa=0
if len(a)>0:
    aa=a.popleft()
for i in range(2,n+2):
    if i-1 == aa:
        dp[i]=0
        if len(a)>0:
            aa=a.popleft()
    else:
        dp[i]=( dp[i-1]+dp[i-2] )%mod
print(dp[-1])
def main():
    int x = 99
    print(x ** 3)

if __name__ == "__main"
    main()

### FIXED CODE ###

x=int(input())
print(x**3)
N = int(input())
S = input()
l = len(S)
flg = 0
if l%2 == 0:
	flg = 1
	print("No")
else:
	for i in range(l/2):
		if S[i] != S[i+l/2]:	
			print("No")
			flg = 1
            break
if flg == 0:
	print("Yes")

### FIXED CODE ###

N = int(input())
S = input()
l = len(S)
flg = 0
if l%2 == 1:
	flg = 1
	print("No")
else:
	for i in range(int(l/2)):
		if S[i] != S[i+int(l/2)]:	
			print("No")
			flg = 1
			break
if flg == 0:
	print("Yes")
l = []
for i in range(int(input()):
   l.append(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in l:
    if i == "AC":
        ac+=1
    if i == "TLE":
        tle+=1
    if i == "WA":
        wa+=1
    if i == "RE":
        re+=1
print("AC X "+str(ac))
print("WA X "+str(wa))
print("TLE X "+str(tle))
print("RE X "+str(re))

    

### FIXED CODE ###

l = []
for i in range(int(input())):
   l.append(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in l:
    if i == "AC":
        ac+=1
    if i == "TLE":
        tle+=1
    if i == "WA":
        wa+=1
    if i == "RE":
        re+=1
print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))
number = int(input())
num_digits = len(str(number))


def dfs(i, sum_number):
    if i == num_digits:
        return sum_number
    dfs(i + 1, sum_number)
    dfs(i + 1, sum_number + str(number)[i])


print(dfs(0, 0))



### FIXED CODE ###

def dfs(i, formula):
    if i + 1 == num_digits:
        return sum(list(map(int, formula.split("+"))))

    return dfs(i + 1, formula + "+" + s[i + 1]) + dfs(i + 1, formula + s[i + 1])


s = input()
num_digits = len(s)

print(dfs(0, s[0]))
from math import gcd

def lcm(X):
    m=(X[0]*X[1])//gcd(X[0],X[1])

    for i in range(2,len(X)):
        g=gcd(m,X[i])
        m=(m*X[i])//g
    return m


N=map(int,input().split())
A=list(map(int,input().split()))
Mod=10**9+7

M=lcm(A)
K=0
for a in A:
    K+=M//a
    K%=Mod
print(K)

### FIXED CODE ###

from math import gcd

def mod_prod(X,M):
    c=1
    for x in X:
        c*=x
        c%=M
    return c

N=int(input())
A=list(map(int,input().split()))
Mod=10**9+7

E=[0]*N
a=1
for i in range(N):
    E[i]=A[i]//gcd(a,A[i])
    a*=E[i]

P=mod_prod(E,Mod)

Q=0
for a in A:
    Q+=pow(a,Mod-2,Mod)
    Q%=Mod
print((P*Q)%Mod)
import fraction

def lcm(x, y):
    return (x * y) // fraction.gcd(x, y)

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

ans = 1
for value in range(0, N):
    ans = lcm(ans, T[value])

print(ans)

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

ans = 1
for value in range(0, N):
    ans = lcm(ans, T[value])

print(ans)
def solve():
    s = input()
    t = input()
    for i in range(len(s)):
        if t == s[i:] + s[:i]:
            return True
        else False
if solve():
    print("Yes")
else:
    print("No")


### FIXED CODE ###

def solve():
    s = input()
    t = input()
    for i in range(len(s)):
        if t == s[i:] + s[:i]:
            return True
        else:
            False
if solve():
    print("Yes")
else:
    print("No")
n = int(input())
v_lst = list(map(int,input().split()))
c_lst = list(map(int,input().split()))
ans_lst = []


for i in range(n):
    ans_lst.append(v_lst[i]-c_lst[i])
ans_lst.sort(reverse=True)

ans = 0
i = 0
while(ans_lst[i] > 0 and i < len(ans_lst)):
    ans += ans_lst[i]
    i += 1

print(ans)


### FIXED CODE ###

n = int(input())
v_lst = list(map(int,input().split()))
c_lst = list(map(int,input().split()))
ans_lst = []


for i in range(n):
    ans_lst.append(v_lst[i]-c_lst[i])
ans_lst.sort(reverse=True)

ans = 0
for a in ans_lst:
    if a > 0:
        ans += a

print(ans)
A,B,H,M=map(int,input().split())
import math
H_k=H*30
M_k=M*6
if(M_k==0):
    M_k=360
if(H_k-M_k<=180 ):
    x=H_k-M_k
else:
    x=M_k-H_k
x=abs(x)

if(x==90):
    print((A**2+B**2)**0.5)
elif(x==180):
    print(A+B)
else:

    z=((A*math.sin(math.radians(x)))**2+(B-A*math.cos(math.radians(x)))**2)**0.5
    print(z)


### FIXED CODE ###

N=input()
a=[]
a=N

b=a[int(len(N))-1]

b=int(b)

if(b in [0,1,6,8]):
    print('pon')

elif(b in [3]):
    print('bon')

else:

    print('hon')