Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

def get_primes(n=10**6):
    primes = [2]
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if n <= p ** 2:
            return primes + data
        primes.append(p)
        data = [d for d in data if d % p != 0]


def main():
    MOD = 10 ** 9 + 7
    N = int(input())
    A = list(map(int, input().split(' ')))
    # 答えは sum(lcm(A) / A)
    primes = get_primes(max(max(A), 3))
    lcm_pf = [0] * len(primes)
    a_pf = [[0] * len(primes) for _ in range(N)]
    # lcm(A) の素因数分解表示を計算
    for i, a in enumerate(A):
        for j, p in enumerate(primes):
            while a % p == 0:
                a_pf[i][j] += 1
                a //= p
            if a == 1:
                break
        for j in range(len(primes)):
            lcm_pf[j] = max(lcm_pf[j], a_pf[i][j])
    # sum(lcm(A) / A) を計算
    ans = 0
    for i in range(N):
        v = 1
        for j, p in enumerate(primes):
            e = lcm_pf[j] - a_pf[i][j]
            v *= p ** e
            v %= MOD
        ans += v
        ans %= MOD
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import math


def main():
    MOD = 10 ** 9 + 7
    N = int(input())
    A = list(map(int, input().split(' ')))
    # 答えは sum(lcm(A) / A)
    L = 1
    for a in A:
        L = L * a // math.gcd(L, a)
    ans = 0
    for a in A:
        ans += L * pow(a, MOD - 2, MOD)
        ans %= MOD
    print(ans)


if __name__ == '__main__':
    main()
### BUGGY CODE ###

s = input()
y = 2019
a = [0]*y
k = 1
r = 0
for i in range(len(s))[::-1]:
    j = int(s[i])*k%y
    tmp = [0]*y
    for i in range(2019):
        tmp[(i+j)%y] = a[i]
    tmp[j] += 1
    a = tmp
    r += a[0]
    k *= 10
    k %= y
print(r)



### FIXED CODE ###

import numpy as np
s = input()
y = 2019
dp = np.zeros(y, dtype="int64")
tmp = np.zeros(y, dtype="int64")
k = 1
r = 0
for c in s[::-1]:
    i = int(c)*k%y
    tmp[i:] = dp[:y-i]
    tmp[:i] = dp[y-i:]
    tmp[i] += 1
    dp, tmp = tmp, dp
    r += dp[0]
    k *= 10
    k %= y
print(r)
### BUGGY CODE ###

i=j=x=int(input())
while(i:=-~i%221)**5-j**5-x:j=j%98-i
print(i,j)

### FIXED CODE ###

x,r=int(input()),range(-99,120);[i**5-x-j**5or exit(print(i,j))for i in r for j in r]
### BUGGY CODE ###

n,k = map(int,input().split())
p = list(map(int,input().split()))

a = i = j = count = ans = 0

new_p = [0] * n

for i in range(n):
    for j in range(p[i]):
        new_p[i] += j+1
    new_p[i] = float(new_p[i]/p[i])

i = j = 0

while k <= n:
    total = 0
    for i in range(j,k):
        total += new_p[i]
    if ans < total:
        ans = total
    j += 1
    k += 1

print(ans)



### FIXED CODE ###

n,k = map(int,input().split())
p = list(map(int,input().split()))

a = i = j = count = ans = 0

new_p = [0] * n

for i in range(n):
    new_p[i] = float((p[i]+1)/2)

i = j = 0
total = 0
for i in range(k):
    total += new_p[i]
ans = total
for i in range(k,n):
    total = total + new_p[i] - new_p[i-k]
    ans = max(ans,total)

print('{:.10f}'.format(ans))
### BUGGY CODE ###

H, W, N = input().split(" ")
H, W, N = int(H), int(W), int(N)
A = [input().split(" ") for i in range(N)]
A = [[int(l[0])-1, int(l[1])-1] for l in A]

sq3_3 = [[0 for w in range(W - 3 + 1)] for h in range(H - 3 + 1)]
sq3_3

for p, q in A:
    for k in [0, 1, 2]:
        for l in [0, 1, 2]:
            if 0 <= p-k < H-3+1 and 0 <= q-l < W-3+1:
                sq3_3[p - k][q - l] += 1
sq3_3

l = []
for s in sq3_3:
    l += s

for i in range(10):
    print(l.count(i))

### FIXED CODE ###

H, W, N = input().split(" ")
H, W, N = int(H), int(W), int(N)
A = []
for i in range(N):
    A.append([int(j) for j in input().split(" ")])


import itertools
from collections import defaultdict, Counter

c = defaultdict(int)
for a, b in A:
    # そのセルを含む正方形の中心を記録
    for dx,dy in itertools.product([-1,0,1],repeat = 2):
        aa = a + dx
        bb = b + dy
        if 2 <= aa <= H-1 and 2 <= bb <= W-1:
            c[(aa,bb)] += 1
            
result = Counter(c.values())
result[0] = (H-2)*(W-2) - sum(result.values())
 
for j in range(10):
    print(result[j])
### BUGGY CODE ###

h, n = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]

dp = [0] * (h+max(a for a,b in ab))
for i in range(1, len(dp)):
    dp[i] = min([float('inf')] + [(dp[i-a]+b) for a, b in ab if i-a >= 0])
print(min(dp[h:]))


### FIXED CODE ###

h, n = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]

dp = [0] * (h+max(a for a,b in ab))
for i in range(1, len(dp)):
    dp[i] = min(dp[i-a]+b for a, b in ab)
print(min(dp[h:]))
### BUGGY CODE ###

#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

D,G = II()
p,c = Line(D)

def dfs(point,p):
    if point<=0:
        return 0
    else:
        ret = []
        for i in range(D):
            if p[i]==0:
                continue
            num = math.ceil(point/((i+1)*100))
            if num <= p[i]:
                ret.append(num)
            else:
                temp = p[i]
                p[i] = 0
                ret.append(dfs(point-100*(i+1)*temp-c[i],p)+temp)
                p[i] = temp
        return min(ret)

print(dfs(G,p))

### FIXED CODE ###

#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

D,G = II()
p,c = Line(D)

def dfs(point,p):
    if point<=0:
        return 0
    else:
        ret = []
        for i in range(D):
            if p[i]==0:
                continue
            q,mod = divmod(point,(i+1)*100)
            if mod ==0:
                num = q
            else:
                num = q+1
            if num <= p[i]:
                ret.append(num)
            else:
                temp = p[i]
                p[i] = 0
                ret.append(dfs(point-100*(i+1)*temp-c[i],p)+temp)
                p[i] = temp
        return min(ret)

print(dfs(G,p))
### BUGGY CODE ###

T = input()
 
w0 = "dream"
w1 = "dreamer"
w2 = "erase"
w3 = "eraser"
 
dict_sen = {0:w0,1:w1,2:w2,3:w3}
 
dp = ""
FT = len(T)
F = 0
while(F < FT):
  for i in range(4):
    if T[F:F+len(dict_sen[i])] == dict_sen[i]:
      dp = dp + dict_sen[i]
      F = len(dp)
      break
 
if dp != T:
  print("NO")
else :
  print("YES")

### FIXED CODE ###

S=str(input()) #Sの入力
Smojisuu=len(S)
c=S.count("eraser")
S=S.replace("eraser","xxxxxx",c)
d=S.count("erase")
S=S.replace("erase","xxxxx",d)
e=S.count("dreamer")
S=S.replace("dreamer","xxxxxxx",e)
f=S.count("dream")
S=S.replace("dream","xxxxx",f)
g=S.count("x")
if len(S)>g:
  print("NO")
elif len(S)==g:
  print("YES")
else:
  print("error")
### BUGGY CODE ###

import sys
from bisect import bisect_left
#inpurt = sys.stdin.readline
a, b, q = map(int, input().split())
INF = 10 ** 11
s = [-INF]
#s_append = s.append
for i in range(a):
    si = int(input())
    s.append(si)
s.append(INF)
t = [-INF]
#t_append = t.append
for i in range(b):
    ti = int(input())
    t.append(ti)
t.append(INF)
x = []
#x_append = x.append
for i in range(q):
    xi = int(input())
    x.append(xi)

for xi in x:
    index_s = bisect_left(s, xi)
    s1 = xi - s[index_s - 1]
    s2 = s[index_s] - xi
    index_t = bisect_left(t, xi)
    t1 = xi - t[index_t - 1]
    t2 = t[index_t] -xi
    print(min(max(s1, t1), max(s2, t2), min(s1, t2) * 2 + max(s1, t2), min(s2, t1) * 2 + max(s2, t1)))


### FIXED CODE ###

import bisect
import sys
input = sys.stdin.readline
A, B, Q = list(map(int, input().split()))
s = [int(input()) for i in range(A)]
t = [int(input()) for i in range(B)]
s.append(-100000000000);s.append(100000000000)
t.append(-100000000000);t.append(100000000000)
s = sorted(s, reverse=False)
t = sorted(t, reverse=False)

for i in range(Q):
    xi = int(input())
    sr = s[bisect.bisect_left(s, xi)]
    sl = s[bisect.bisect_left(s, xi) - 1]
    tr = t[bisect.bisect_left(t, xi)]
    tl = t[bisect.bisect_left(t, xi) - 1]

    ans = min(max(sr, tr) - xi, xi - min(sl, tl),
              tr - sl + min(tr - xi, xi - sl), sr - tl + min(sr - xi, xi - tl))
    print(ans)
### BUGGY CODE ###

A,B,C,D,E,F=list(map(int,input().split()))
max=0
satou=0
water=0
for i in range(31):
    for j in range(31):
        for k in range(101):
            for l in range(101):
                a=100*A*i+100*B*j
                s=C*k +D*l
                if a+s<=F and (a/100)*E>=s and a!=0:
                    if max<s/(a+s):
                        max=s/(a+s)
                        water=a+s
                        satou=s

print(water,satou)

### FIXED CODE ###

A,B,C,D,E,F=list(map(int,input().split()))
max=0
satou=0
water=0
for i in range(31):
    for j in range(31):
        for k in range(101):
            for l in range(101):
                a=100*A*i+100*B*j
                s=C*k +D*l
                if a==0:break
                if a+s<=F and (a/100)*E>=s :
                    if max<100*s/(a+s):
                        max=100*s/(a+s)
                        water=a+s
                        satou=s
if satou>0:
    print(water,satou)
else:
    print(100*A,0)
### BUGGY CODE ###

n = int(input())
l = [int(i) for i in input().split()]
l.sort()
a = 0
for i in range(n):
    for j in range(i+1, n):
        for k in range(n - 1, j, -1):
            if l[i] + l[j] > l[k]:
                a += k - j
                break
print(a)


### FIXED CODE ###

import bisect
n = int(input())
l = [int(i) for i in input().split()]
l.sort()
k = 0
for i in range(n):
    for j in range(i + 1, n):
        ind = bisect.bisect_left(l, l[i] + l[j])
        k += max(ind-j-1, 0)
print(k)
### BUGGY CODE ###

import sys
from collections import deque
def input(): return sys.stdin.readline().strip()


def main():
    H, W = map(int, input().split())
    A = []
    for _ in range(H):
        A.append(list(map(int, input().split())))
    B = []
    for _ in range(H):
        B.append(list(map(int, input().split())))
    
    """
    明らかなdp臭。
        dp[i][j] = (マス(0, 0)から(i, j)に進むときの偏りとしてありうるものの集合)
    とおく。(0<=i<=H-1, 0<=j<=W-1, 0<=d<=80)
    """

    dp = [[set([]) for _ in range(W)] for _ in range(H)]
    dp[0][0].add(abs(A[0][0] - B[0][0]))
    for i in range(1, H):
        diff = A[i][0] - B[i][0]
        for val in dp[i - 1][0]:
            if abs(val + diff) <= 1600: dp[i][0].add(abs(val + diff))
            if abs(val - diff) <= 1600: dp[i][0].add(abs(val - diff))
    for j in range(1, W):
        diff = A[0][j] - B[0][j]
        for val in dp[0][j - 1]:
            if abs(val + diff) <= 6400: dp[0][j].add(abs(val + diff))
            if abs(val - diff) <= 6400: dp[0][j].add(abs(val - diff))

    for i in range(1, H):
        for j in range(1, W):
            diff = A[i][j] - B[i][j]
            for val in dp[i - 1][j]:
                if abs(val + diff) <= 6400: dp[i][j].add(abs(val + diff))
                if abs(val - diff) <= 6400: dp[i][j].add(abs(val - diff))
            for val in dp[i][j - 1]:
                if abs(val + diff) <= 6400: dp[i][j].add(abs(val + diff))
                if abs(val - diff) <= 6400: dp[i][j].add(abs(val - diff))
    
    print(min(dp[H - 1][W - 1]))


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from collections import deque
def input(): return sys.stdin.readline().strip()


def main():
    H, W = map(int, input().split())
    A = []
    for _ in range(H):
        A.append(list(map(int, input().split())))
    B = []
    for _ in range(H):
        B.append(list(map(int, input().split())))
    
    """
    明らかなdp臭。
        dp[i][j] = (マス(0, 0)から(i, j)に進むときの偏りとしてありうるものの集合)
    とおく。(0<=i<=H-1, 0<=j<=W-1, 0<=d<=80)

    残念ながらPypyだとsetでdp値を保持しているとTLEするので、setではなくビットで偏りの値を管理する
    ただし-diffの方向にビットシフトするとき0桁目以下が切り捨てられてしまうので、最初から適当に
    offsetで桁の水増しをしておく
    """

    offset = 80 * 164

    dp = [[0] * W for _ in range(H)]
    dp[0][0] |= 1 << (A[0][0] - B[0][0] + offset)
    dp[0][0] |= 1 << (B[0][0] - A[0][0] + offset)
    for i in range(1, H):
        diff = abs(A[i][0] - B[i][0])
        dp[i][0] |= dp[i - 1][0] << diff
        dp[i][0] |= dp[i - 1][0] >> diff
    for j in range(1, W):
        diff = abs(A[0][j] - B[0][j])
        dp[0][j] |= dp[0][j - 1] << diff
        dp[0][j] |= dp[0][j - 1] >> diff

    for i in range(1, H):
        for j in range(1, W):
            diff = abs(A[i][j] - B[i][j])
            dp[i][j] |= dp[i - 1][j] << diff
            dp[i][j] |= dp[i - 1][j] >> diff
            dp[i][j] |= dp[i][j - 1] << diff
            dp[i][j] |= dp[i][j - 1] >> diff
    
    ans1 = offset
    while not (dp[H - 1][W - 1] & (1 << ans1)):
        ans1 += 1
    ans2 = offset
    while not (dp[H - 1][W - 1] & (1 << ans2)):
        ans2 -= 1
    print(min(ans1 - offset, offset - ans2))


if __name__ == "__main__":
    main()
### BUGGY CODE ###

N = int(input())
A_rate = list(map(int, input().split()))
B_rate = list(map(int, input().split()))


def trade(d, buy_rate, sell_rate):
    stuff = []
    for i in range(3):
        stuff.extend([[buy_rate[i], sell_rate[i]] for _ in range((d // buy_rate[i]))])
    stuff.extend([[1, 1] for _ in range(d)])
    dp = [[0 for j in range(d+1)] for i in range((len(stuff) + 1))]
    for i in range(1, len(stuff) + 1):
        for j in range(d+1):
            if j-stuff[i-1][0] >= 0:
                dp[i][j] = max(dp[i-1][j], dp[i-1][j-stuff[i-1][0]] + stuff[i-1][1])
            else:
                dp[i][j] = dp[i-1][j]
    return max(dp[-1])


print(trade(trade(N, A_rate, B_rate), B_rate, A_rate))


### FIXED CODE ###

mod = 1000000007
eps = 10**-9
inf = 10**9


def main():
    import sys
    input = sys.stdin.readline

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

    dp = [[-inf] * (N+1) for _ in range(4)]
    dp[0][N] = N
    for i in range(3):
        for j in range(N, -1, -1):
            dp[i+1][j] = max(dp[i+1][j], dp[i][j])
            if j - A[i] >= 0:
                dp[i+1][j-A[i]] = max(dp[i+1][j-A[i]], dp[i+1][j] + B[i] - A[i])
    N = max(dp[-1])
    dp = [[-inf] * (N + 1) for _ in range(4)]
    dp[0][N] = N
    for i in range(3):
        for j in range(N, -1, -1):
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
            if j - B[i] >= 0:
                dp[i + 1][j - B[i]] = max(dp[i + 1][j - B[i]], dp[i+1][j] + A[i] - B[i])
    print(max(dp[-1]))


if __name__ == '__main__':
    main()
### BUGGY CODE ###

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

def func(x: int) -> int:
    return (A * x) // B - A * (x // B)

prev = -1
for n in range(N + 1):
    res = func(n)
    if res < prev:
        print(prev)
        break
    prev = res
else:
    print(prev)


### FIXED CODE ###

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

def f(x: int) -> int:
    return (A * x) // B - A * (x // B)

x = min(N, B - 1)
print(f(x))
### BUGGY CODE ###

import sys

def main():
    sinputl = sys.stdin.readline

    num_card, num_gate = [int(x) for x in sinputl().split()]
    input = [[int(x) for x in sinputl().split()] for _ in range(num_gate)]

    cards = list(range(1, num_card + 1))

    for gate in input:
        cards = list(filter(lambda x: gate[0] <= x <= gate[1], cards))

    print(len(cards))



if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys

def main():
    sinputl = sys.stdin.readline

    num_card, num_gate = [int(x) for x in sinputl().split()]
    input = [[int(x) for x in sinputl().split()] for _ in range(num_gate)]

    card = [1, num_card]

    for gate in input:
        card[0] = max(card[0], gate[0])
        card[1] = min(card[1], gate[1])

    print(max(card[1] - card[0] + 1, 0))


if __name__ == "__main__":
    main()
### BUGGY CODE ###

N,K,Q=map(int,input().split())
A=[]
score=[K]*N
for i in range(0,Q):
    A.append(int(input()))

for j in range(0,N):
    score[j]=score[j]-(Q-A.count(j+1))
    if(score[j]>0):
        print("Yes")
    else:
        print("No")
    

### FIXED CODE ###

N,K,Q=map(int,input().split())
A=[0]*N
score=[K]*N
for i in range(0,Q):
    a=int(input())
    A[a-1]+=1
        
for j in range(0,N):
    score[j]=score[j]-(Q-A[j])
    if(score[j]>0):
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

def main():
    s = int(input())
    x = int(s**0.5//1)
    if s <= 10**9:
        print(0,0,1,0,0,s)
        exit()
    for i in range(x,0,-1):
        if s%i ==0:
            x = i
            break
    y = int(s/x)
    print(0,0,x,0,0,y)
if __name__ == '__main__':
    main()

### FIXED CODE ###

S=int(input())
if S<10**18:
    x1,y1,x2,y2,x3,y3=0,0,(S//10**9+1),10**9-S%10**9,1,10**9
else:
    x1,y1,x2,y2,x3,y3=(0,0,10**9,1,0,10**9)
print(x1,y1,x2,y2,x3,y3)
### BUGGY CODE ###

# D
from collections import deque
INF = float('inf')
h, w = map(int, input().split())
maps = []

for _ in range(h):
    lst = list(input())
    maps.append(lst)

def bfs(start, maps, distance, height, width):
    d = deque()
    d.append(start)
    sx, sy = start
    distance[sx][sy] = 0
    
    while d:
        now = d.pop()
        nowx, nowy = now
        
        for i in range(0, 4):
            nx, ny = nowx + [1, 0, -1, 0][i], nowy + [0, 1, 0, -1][i]
            if (0<=nx<height)and(0<=ny<width):
                if (maps[nx][ny] == '.'):
                    if (distance[nx][ny] == -1) or \
                        (distance[nowx][nowy]+1<distance[nx][ny]):
                        d.append((nx, ny))
                        distance[nx][ny] = distance[nowx][nowy] + 1
    #print(distance)
    max_ = -1
    for row in distance:
        for val in row:
            if val > max_:
                max_ = val
    return max_

cand = []
for sx in range(h):
    for sy in range(w):
        if maps[sx][sy] == '#':
            continue
        distance = [[-1 for _ in range(w)] for _ in range(h)]
        cand.append(bfs((sx, sy), maps, distance, h, w))
print(max(cand))

### FIXED CODE ###

from collections import deque

def bfs(maze, visited, H, W, sx, sy):
    que = deque()
    que.append([sx, sy])
    visited[sx][sy] = 0
    ml = 0
    
    while que:
        x, y = que.popleft()
        
        for px, py in [[1, 0], [-1, 0], [0, 1], [0, -1]]:
            nx, ny = x+px, y+py
            if (0<=nx<H)and(0<=ny<W):
                if (maze[nx][ny] == '.')and(visited[nx][ny]==-1):
                    que.append([nx, ny])
                    dist = visited[x][y] + 1
                    visited[nx][ny] = dist
                    ml = max(ml, dist)
    return ml
                    

H, W = map(int, input().split())
maze = [input() for _ in range(H)]
ans = 0
for i in range(H):
    for j in range(W):
        if maze[i][j] == '#':
            continue
        else:
            visited = [[-1]*W for _ in range(H)]
            ans = max(ans, bfs(maze, visited, H, W, i, j))
print(ans)
### BUGGY CODE ###

# Not using k-d tree.

import sys
import bisect

def main():
    i_f = sys.stdin
     
    n = int(i_f.readline())

    Px = []
    Py = []
    for i in range(n):
        x, y = map(int, i_f.readline().split())
        Px.append([x, y, i])
        Py.append([y, x, i])

    Px.sort()
    Py.sort()

    q = int(i_f.readline())

    A = []

    for l in i_f:
        sx, tx, sy, ty = map(int, l.split())
        
        x_low = bisect.bisect_left(Px, [sx, sy, 0])
        x_high = bisect.bisect_right(Px, [tx, ty, n], lo=x_low)
        y_low = bisect.bisect_left(Py, [sy, sx, 0])
        y_high = bisect.bisect_left(Py, [ty, tx, n], lo=y_low)
        
        x_width = x_high - x_low
        y_width = y_high - y_low

        a = []
        if x_width < y_width:
            for p in Px[x_low:x_high]:
                if sy <= p[1] <= ty:
                    a.append(p[2])
        else:
            for p in Py[y_low:y_high]:
                if sx <= p[1] <= tx:
                    a.append(p[2])

        if a:
            a.sort()
            A.extend(a)
        A.append('')

    print('\n'.join(map(str, A)))

main()

### FIXED CODE ###

import sys, math
from operator import itemgetter
from bisect import bisect_left, bisect_right

f_i = sys.stdin

def main():
    n = int(f_i.readline())
    
    lx = []
    ly = []
    li = []
    for i in range(n):
        x, y = map(int, f_i.readline().split())
        lx.append(x)
        ly.append(y)
        li.append(i)

    x_width = max(lx) - min(lx)
    y_width = max(ly) - min(ly)
    if x_width > y_width:
        P = list(zip(lx, ly, li))
    else:
        P = list(zip(ly, lx, li))
    P.sort()

    interval = int(math.sqrt(n))

    low = [v1 for v1, v2, i in P[::interval]]
    high = [v1 for v1, v2, i in P[interval - 1::interval]] + [float('inf')]

    S = []
    v2_sec_list = []
    for i in range(0, n, interval):
        si = P[i:i + interval]
        si.sort(key=itemgetter(1))
        v2_s = [p[1] for p in si]
        v2_sec_list.append(v2_s)
        S.append(si)

    A = []

    q = f_i.readline()

    for l in f_i:
        sx, tx, sy, ty = map(int, l.split())
        a = []
        if x_width > y_width:
            for i in range(bisect_left(high, sx), bisect_right(low, tx)):
                v = S[i]
                k = v2_sec_list[i]
                for j in range(bisect_left(k, sy), bisect_right(k, ty)):
                    if sx <= v[j][0] <= tx:
                        a.append(v[j][2])
        else:
            for i in range(bisect_left(high, sy), bisect_right(low, ty)):
                v = S[i]
                k = v2_sec_list[i]
                for j in range(bisect_left(k, sx), bisect_right(k, tx)):
                    if sy <= v[j][0] <= ty:
                        a.append(v[j][2])
        
        if a:
            a.sort()
            A.extend(a)
        A.append('')

    print('\n'.join(map(str, A)))

main()
### BUGGY CODE ###

# -*- coding: utf-8 -*-
"""
Created on Mon Dec 31 14:30:45 2018

@author: Yamazaki Kenichi
"""

N,P = map(int, input().split())

limit = int(pow(P,1/N)//1+1)

if N == 1:
    ans = P
else:
    ans = 1
    for i in range(2,limit+1):
        if P % pow(i,N) == 0:
            ans = i

print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Mon Dec 31 14:30:45 2018

@author: Yamazaki Kenichi
"""

N,P = map(int, input().split())

limit = int(pow(P,1/N)//1)

if N == 1:
    ans = P
elif limit == 1:
    ans = 1
else:
    ans = 1
    for i in range(2,limit+2):
        if P % pow(i,N) == 0:
            ans = i
            
print(ans)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
for i in range(1,n+1):
    print(a.count(i))

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
lis = [0]*n
for i in range(n-1):
    lis[a[i]-1] += 1
for i in range(n):
    print(lis[i])