Harryxun/stf_run huggingface dataset:
import numpy as np
from collections import Counter
n = int(input())
aa = list(map(int, input().split()))
ngs = np.zeros(2*(10**5)+1, dtype=int)

for a in aa:
    ngs[2*a::a] = 1
    
dic = Counter(aa)
times = np.array(list(dic.keys()))[np.array(list(dic.values())) > 1]

for i in times:
    ngs[i] = 1
cnt = 0
for a in aa:
    cnt += 1-ngs[a]
print((cnt))

### FIXED CODE ###

import numpy as np
from collections import Counter
n = int(input())
aa = list(map(int, input().split()))
ngs = np.zeros((10**6)+1, dtype=int)

for a in set(aa):
    ngs[2*a::a] = 1
    
dic = Counter(aa)
times = np.array(list(dic.keys()))[np.array(list(dic.values())) > 1]

for i in times:
    ngs[i] = 1
cnt = 0
for a in aa:
    cnt += 1-ngs[a]
print((cnt))
a,b,c = (str(x) for x in input().split())
if a == b == c:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

S = input()
if S[0] == S[1] == S[2]:
    print('No')
else:
    print('Yes')
import numpy as np
n = int(input())
a = list(map(int,input().split()))

a = np.array(a)



print(*np.argsort(a)+1)

### FIXED CODE ###

import numpy as np
n = int(input())
a = list(map(int,input().split()))

a = np.array(a)



print(*np.argsort(a)+1)
import sys
import math

n=int(sys.stdin.readline().strip())
s=int(sys.stdin.readline().strip())

def divlist(n):
   sl=[]
   ll=[]
   for x in range(1,int(math.sqrt(n))+1):
       if n%x==0:
           sl.append(x)
           ll.append(n//x)
   ll.reverse()
   sl.extend(ll)
   return sl

def f(b,n):
    if n<b:
        return n
    else:
        return f(b,n//b)+(n%b)

if n<s:
    print(-1
elif n==s:
    print(n+1)
else:
    dl=divlist(n-s)
    for x in dl:
        if s==f(x+1,n):
            print(x+1)
            sys.exit()
    print(-1)



### FIXED CODE ###

import sys
import math

def divlist(n):
   sl=[]
   ll=[]
   for x in range(1,int(math.sqrt(n))+1):
       if n%x==0:
           sl.append(x)
           ll.append(n//x)
   ll.reverse()
   sl.extend(ll)
   return sl

def f(b,n):
    if n<b:
        return n
    else:
        return f(b,n//b)+(n%b)

def main(n,s):
    if n<s:
        return print(-1)
    elif n==s:
        return print(n+1)
    else:
        dl=divlist(n-s)
        for x in dl:
            if s==f(x+1,n):
                return print(x+1)
        return print(-1)

n=int(sys.stdin.readline().strip())
s=int(sys.stdin.readline().strip())

main(n,s)
N = int(input())
h = list(map(int, input().split()))

dp = [-1] * N  # dp[i] := i+1 から N までの移動にかかる最小コスト
dp[N-1] = 0

def rec_memo(i):
    if dp[i] >= 0:
        return dp[i]
    
    if i == N-2:
        dp[i] = rec_memo(i+1) + abs(h[i+1] - h[i])
        return dp[i]
    else:
        dp[i] = min(rec_memo(i+1) + abs(h[i+1] - h[i]), rec_memo(i+2) + abs(h[i+2] - h[i]))
        return dp[i]

print(rec_memo(0))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

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

dp = [-1] * N # dp[i] := i から N-1 までの移動にかかる最小コスト
dp[N-1] = 0

def rec_memo(i):
    if dp[i] >= 0:
        return dp[i]
    
    if i == N-2:
        dp[i] = rec_memo(i+1) + abs(h[i+1] - h[i])
        return dp[i]
    else:
        dp[i] = min(rec_memo(i+1) + abs(h[i+1] - h[i]), rec_memo(i+2) + abs(h[i+2] - h[i]))
        return dp[i]

print(rec_memo(0))
N=int(input())
from collections import deque
d = deque([int(input())]) 
def insert_search(List,a,l,r):
  if r==l:
    List[l-1]=a
    return List
  m=(l+r)//2
  if List[m]<a:
    return insert_search(List,a,m+1,r)
  elif List[m]!=a:
    return insert_search(List,a,l,m-1)
  else:
    while List[m]==a:
      m-=1
    List[m]=a
    return List
for i in range(N-1):
  a=int(input())
  if a>d[-1]:
    d[-1]=a
  elif d[0]>=a:
    d.appendleft(a)
  else:
    d=insert_search(d,a,0,len(d)-1)
print(len(d))

### FIXED CODE ###

N=int(input())
from collections import deque
d = deque([int(input())]) 
import bisect

for i in range(N-1):
  a=int(input())
  if a>d[-1]:
    d[-1]=a
  elif d[0]>=a:
    d.appendleft(a)
  else:
    i=bisect.bisect_left(d,a)
    d[i-1]=a
print(len(d))
N = int(input())
r = range(N)
l = list(r)

print(sum(l))

### FIXED CODE ###

N = int(input())
result = int(N*(N-1)//2)

print(result)
for i in range(10**100):
    total+=B
    b+=1
    if total>N:
        break
    total+=R
    if total>N:
        break
if B==0:
    print(0)

else:
    print(B*b-(total-N))

### FIXED CODE ###

N,B,R=map(int,input().split())
b=0
i=int(N/(B+R))
tari=N-(i*(B+R))

b+=B*i
if tari >= B:
    b+=B
else:
    b+=tari

print(b)
from collections import deque

s = deque()
s.append(input())
q = int(input())

reverse_status = False

for i in range(q):
  query = list(map(format, input().split()))
  if int(query[0]) == 1:
    if reverse_status:
      reverse_status = False
    else:
      reverse_status = True
  else:
    if int(query[1]) == 1:
      if reverse_status:
        s.append(query[2])
      else:
        s.appendleft(query[2])
    else:
      if reverse_status:
        s.appendleft(query[2])
      else:
        s.append(query[2])

if reverse_status:
  s.reverse()
print(''.join(s))


### FIXED CODE ###

s = input()

if s.count('A') > 0 and s.count('B') > 0:
  print('Yes')
else:
  print('No')
antena = []
for i in range(5):
  antena[i] = int(input())
  
k = int(input())

for i in range(len(antena)):
  if antena[-1]-antena[i]>k:
    print(":(")
else:
  print("Yay!")

### FIXED CODE ###

antena = [0]*5
for i in range(5):
  antena[i] = int(input())
  
k = int(input())
 
for i in range(len(antena)):
  if antena[-1]-antena[i]>k:
    print(":(")
    break
else:
  print("Yay!")
from sys import exit

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

if max(A)-min(A)>k:
	print(":(")
else:
	print("Yay!

### FIXED CODE ###

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

if (max(A)-min(A))>k:
	print(":(")
else:
	print("Yay!")
while True:
    a, op, b = input().sprit()
    a = int(a)
    b = int(b)

    if op == '?':
        break

    if op == '+':
        print(a + b)

    if op == '-':
        print(a - b)

    if op == '*':
        print(a * b)

    if op == '%':
        print(a % b)

### FIXED CODE ###

while True:
    a, op, b = input().split()
    a = int(a)
    b = int(b)

    if op == '?':
        break

    if op == '+':
        print(a + b)

    if op == '-':
        print(a - b)

    if op == '*':
        print(a * b)

    if op == '/':
        print(a // b)
import collections

def insert_card(card_number, card_list):
    i = 0
    while i < card_number:
        card_list.append(input())
        i += 1


blue_card_number = int(input())
blue_card_list = []
insert_card(blue_card_number, blue_card_list)

red_card_number = int(input())
red_card_list = []
insert_card(red_card_number, red_card_list)

blue_card_collection = collections.Counter(blue_card_list)
red_card_collection = collections.Counter(red_card_list)

result_card_collection = blue_card_collection - red_card_collection

answer_collection = sorted(result_card_collection.items(), key=lambda x:x[1], reverse=True)
print(answer_collection[0][1])

### FIXED CODE ###

import collections

def insert_card(card_number, card_list):
    i = 0
    while i < card_number:
        card_list.append(input())
        i += 1


blue_card_number = int(input())
blue_card_list = []
insert_card(blue_card_number, blue_card_list)

red_card_number = int(input())
red_card_list = []
insert_card(red_card_number, red_card_list)

blue_card_collection = collections.Counter(blue_card_list)
red_card_collection = collections.Counter(red_card_list)

result_card_collection = blue_card_collection - red_card_collection

answer_collection = sorted(result_card_collection.items(), key=lambda x:x[1], reverse=True)
if answer_collection == []:
    print(0)
else:
    print(answer_collection[0][1])
import fanctions.gcd
a, b = map(int, input.split())
if gcd(a, b) != 1:
  print(b-a)
else:
  print(a+b)

### FIXED CODE ###

a, b = map(int, input().split())
if b%a==0:
  print(a+b)
else:
  print(b-a)
ss=input()
ss[3]=8
print(ss)

### FIXED CODE ###

print(input().replace("2017","2018"))
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12 and be!="00" and af!=="00":
  print("AMBIGUOUS")

elif int(af)<=12:
  if af=="00":
    print("NA")
  else:
    print("YYMM")
    
elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")
  
else:
  print("NA")

### FIXED CODE ###

s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12 and be!="00" and af!="00":
  print("AMBIGUOUS")

elif int(af)<=12 and af!="00":
    print("YYMM")
    
elif int(be)<=12 and be!="00":
    print("MMYY")
  
else:
  print("NA")
alpha='A'
if (alpha.islower){
  print(B)
}else{
  print(A)
}


### FIXED CODE ###

alpha=input()
if (alpha.isupper()):
  print('A')
else:
  print('a')
MOD = 1000000007

N,M = map(int,input().split())
A=[int(input()) for i in range(M)]



def binet_mod(n):
    if(n==0):
        return 0
    return((int(1/5**(1/2)*((((1+5**(1/2))/2)**n)-((1-5**(1/2))/2)**n)))%MOD)
    

l = 0
ans = 1

for i in range(M):
    ans = ans * binet_mod(A[i] - l)
    l = A[i] + 1
    

ans = (ans * binet_mod(N-l+1))%MOD
print(ans)

### FIXED CODE ###

MOD = 1000000007

N,M = map(int,input().split())
A=[int(input()) for i in range(M)]

T = [-1]*(N+1)

T[0] = 1
T[1] = 1

for i in (A):
    T[i] = 0

    


for i in range(2,N+1):
    if(T[i] == -1):
        T[i] = (T[i-1] + T[i-2])%MOD
        
print(T[N])
n = int(input())
A = list(map(int, input().split()))
def check(L):
  for i in range(1, len(L)):
    if L[i] < L[i - 1]:
      return False
  return True
for i in range(n):
  for j in range(i + 1, n):
    if check(A[0:i] + [A[j]] + A[i+1:j] + [A[i]] + A[j+1:]):
      print('YES')
      return
print('NO')

### FIXED CODE ###

def solve(n, A):
    def check(L):
        for i in range(1, len(L)):
            if L[i] < L[i - 1]:
                return False
        return True
    if check(A):
        return 'YES'
    for i in range(n):
        for j in range(i + 1, n):
            if check(A[0:i] + [A[j]] + A[i + 1:j] + [A[i]] + A[j + 1:]):
                return 'YES'
    return 'NO'

_n = int(input())
_A = list(map(int, input().split()))
print(solve(_n, _A))
n, m = map(int, input().split())

mod = 1_000_000_007

from collections import deque

d = deque()

for _ in range(m):
    d.append(int(input()))

old = 0
new = 1

for i in range(1, n+1):
    if len(d):
        if i != d[0]:
            old, new = new, (old+new) % mod
        else:
            old, new = new, 0
            d.popleft()
    else:
        old, new = new, (old+new) % mod



print(new)

### FIXED CODE ###

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

mod = 1000000007

from collections import deque

d = deque()

for _ in range(m):
    d.append(int(input()))

old = 0
new = 1

for i in range(1, n+1):
    if len(d):
        if i != d[0]:
            old, new = new, (old+new) % mod
        else:
            old, new = new, 0
            d.popleft()
    else:
        old, new = new, (old+new) % mod



print(new)
import math

n, k = map(int, input().split(" "))
aL = list(map(int, input().split(" ")))
aFL = [False for _ in range(n)]

crnt = 1
cnt1 = 0
while True:
    if aFL[crnt - 1]:
        break
    cnt1 += 1
    aFL[crnt - 1] = True
    crnt = aL[crnt - 1]

wCrnt = crnt
cnt2 = 0
while True:
    crnt = aL[crnt - 1]
    cnt2 += 1
    if crnt == wCrnt:
        break

gp = cnt1 - cnt2

cr = crnt
for i in range((k - gp) % n):
    cr = aL[cr]

print(aL[aL[cr - 1]])


### FIXED CODE ###

import math

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

fk = k
crnt = 1
st = set()
wl = []
key = crnt
cy = 0
mg = 0

for i in range(n):
    if crnt in st:
        key = crnt
        cy = i - wl.index(crnt)
        mg = wl.index(crnt)
        break
    st.add(crnt)
    wl.append(crnt)
    crnt = li[crnt - 1]

k -= mg
if cy != 0:
    k %= cy
crnt = key
if n > fk:
    k = fk
    crnt = 1
for i in range(k):
    crnt = li[crnt - 1]

print(crnt)
while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1 or total < 30:
        print('F')
    elif total < 50 and r < 50:
        print('D')
    elif total < 65:
        print('C')
    elif total < 80:
        print('B'):
    else:
        print('A')

### FIXED CODE ###

while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break
 
    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
    elif total < 50 and r < 50:
        print('D')
    elif total < 65:
        print('C')
    elif total < 80:
        print('B')
    else:
        print('A')
n = int(input())
x = input()

MAX = 2*10**5+1
ppc = [0]*MAX

def popcount(n):
  if ppc[n]>0:
    ppc[n]  
  if n == 0:
    return 0
  b = bin(n).count('1')  
  tmp = n%b
  ppc[n] = popcount(tmp) + 1
  return ppc[n]

for i in range(2*10**5):
  popcount(i+1)
  
bit = int('0b'+x,0)

for i in range(n,0,-1):
  tmp = bit ^ (1 << (i-1))
  bn = bin(tmp).count('1')      
  print(ppc[tmp%bn]+1)
  

### FIXED CODE ###

n = int(input())
X = input()

def goes_to_zero(n):
  cnt = 0
  while(n > 0):
    n %= bin(n).count('1')
    cnt += 1
  return cnt
  
c1 = X.count('1')
xint = int(X,2)
xtp = xint % (c1 + 1)
if (c1 - 1) == 0:  
  xtm = 0
else:
  xtm = xint % (c1 - 1)
  
for i in range(n)  :
  if X[i] == '0':
    print(goes_to_zero( (xtp + pow(2,n-1-i,(c1+1))) % (c1+1) ) + 1)
  else:
    if (c1-1) == 0:
      print(0)
    else:
      print(goes_to_zero( (xtm - pow(2,n-1-i,(c1-1)) ) % (c1-1) ) +1)
# coding: utf-8
n = int(input())
A = list(map(int, input().split()))
X = [0]*n
for a in A:
    X[a] += 1
s = 0
for x in X:
    s += x*(x-1)//2
for a in A:
    print(s-X[a]+1)

### FIXED CODE ###

# coding: utf-8
n = int(input())
A = list(map(int, input().split()))
X = [0]*(n+1)
for a in A:
    X[a] += 1
s = 0
for x in X:
    s += x*(x-1)//2
for a in A:
    print(s-X[a]+1)
w=int(input())
h=int(input())
x=int(input())
y=int(input())
r=int(input())
if w >=h >= x >= y >= r:
print("Yes")
else:
print("No")



### FIXED CODE ###

n=input().split()
w=int(n[0])
h=int(n[1])
x=int(n[2])
y=int(n[3])
r=int(n[4])
if (r <= x) & (x + r <= w) & (r <= y) & (r + y <= h):
   print("Yes")
else:
   print("No")
T = input()
if T[0] == "?" and len(T) > 1:
    ans = "P"
elif T[0] == "?" and len(T) == 1:
    ans = "D"
else:
    ans = T[0]

for i in range(1, len(T)):
    if T[i] == "?":
        if ans[i-1] == "P":
            ans = ans + "D"
        elif i == len(T) - 1:
            ans = ans + "D"
        elif ans[i+1] == "D":
            ans = ans + "P"
        else:
            ans = ans + "P"
    else:
        ans = ans + T[i]

print(ans)

### FIXED CODE ###

T = input()
ans = ""

for i in range(len(T)):
    if T[i] == "?":
        ans = ans + "D"
    else:
        ans = ans + T[i]

print(ans)
while True:
    N = input()
    if N == "0000":
        break
    ans = 0
    if all([1 if s == N[-1] else 0 for s in N[:-1]]):
        print("NA")
        continue
    while int(N) != 6174:
        a, b, c, d = N[0], N[1], N[2], N[3]
        S =  sorted([a, b, c, d])
        L = int([''.join(S[::-1])][0])
        S = int([''.join(S)][0])
        ans += 1
        N = str(L-S)
    print(ans)

### FIXED CODE ###

while True:
    N = input()
    if N == "0000":
        break
    ans = 0
    if int(N) % 1111 == 0:
        print("NA")
        continue
    while N != '6174':
        N = list(N)
        S = int(''.join(sorted(N)))
        L = int(''.join(sorted(N)[::-1]))
        ans += 1
        N = str(L-S).zfill(4)
    print(ans)
a,b,c=input()
if a=='7' or b=='7' or c=='7':
  print(Yes)
else:
  print(No)

### FIXED CODE ###

N=input()
if N[0]=='7' or N[1]=='7' or N[2]=='7':
    print('Yes')
else:
    print('No')
def c_splitting_pile(N, A):
    # Aの要素の総和をX、カードの山の先頭i枚の総和をxとすると、
    # |y-x|=|X-2x|である。各iについてこの値を計算すればよい
    total = sum(A)
    ans = float('inf')
    s = 0
    for i in range(N-1):
        s += A[i]
        ans = min(ans, abs(total - s * 2))
    return ans

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

### FIXED CODE ###

def Q3(x):
    N = x[0][0]
    lst = x[1][:]
    s = lst[0]
    allsum = sum(lst)
    minimum = abs(allsum - s * 2)
    
    for k in range(1, N - 1):
        s += lst[k]
        a = abs(allsum - s * 2)
        minimum = min(minimum, a)
    return minimum

l = [int(i) for i in input().split()]
m = [int(i) for i in input().split()]
n = [l,m]
print(Q3(n))
a,b = int(input().split())
if a+b==15:
  print('+')
elif a*b == 15:
  print('*')
else:
  print('x')

### FIXED CODE ###

a,b = map(int,input().split())
if a+b==15:
  print('+')
elif a*b == 15:
  print('*')
else:
  print('x')
N,R=map(int,input().split())
if (N>=10):
  print (R)
else :
  print (R+100*(10-K))

### FIXED CODE ###

N, R=map(int,input().split())
if (N>=10):
  print (R)
else :
  print (R+100*(10-N))
x = int,input()
if x < 1200:
    print('ABC')
else:
    print("ARC")

### FIXED CODE ###

x = input()
x = int(x)
if x < 1200:
    print('ABC')
else:
    print("ARC")
# import math
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
from itertools import permutations
# import numpy as np


# k,x = map(int, input().split())

n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
m = [i + 1 for i in range(n)]
c = 0
for i in permutations(m):
    c += 1
    # print(i)
    if list(i) == p:
        a = c
    if list(i) == q:
        b = c
print(abs(a - b))


### FIXED CODE ###

# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

k,x = map(int, input().split())
# n = int(input())
# a = list(map(int,input().split()))
ans = 'No'
if 500 * k >= x : ans = 'Yes'
print(ans)
A, B = map(int, input().split()))
print(A+B if B%A==0 else B-A)

### FIXED CODE ###

A, B = map(int, input().split())
print(A+B if B%A==0 else B-A)
S=input()
S=list(S)
for i in len(S):
  print("x", end="")

### FIXED CODE ###

S=input()
S=list(S)
for i in range(len(S)):
  print("x", end="")
class UnionFind():
  def __init__(self,n):
    self.parents = list(range(n))
    self.size = [1]*n
  
  def find(self,x):
    if self.parents[x] == x:
      return x
	
    self.parents[x] = self.find(self.parents[x])
    return self.parents[x]
  
  def union(self,x,y):
    x = self.find(x)
    y = self.find(y)
    
    if x==y:
      return
    
    if self.size[x]>self.size[y]:
      x,y=y,x
	
    self.size[x]+=self.size[y]
    self.parents[y] = x
  
  def sizeofset(self,x):
    return self.size[self.find(x)]


N,M=map(int,input().split())
uf = UnionFind(N)

cnt=(N)*(N-1)//2
L=[[int(x) for x in input().split()] for _ in range(M)]
ans=[]

for a,b in L[::-1]:
  ans.append(cnt)
  if uf.find(a-1)!=uf.find(b-1):
    cnt-= uf.sizeofset(a-1)*uf.sizeofset(b-1)
    uf.union(a-1,b-1)

for x in ans[::-1]:
  print(x)

### FIXED CODE ###

class UnionFind():
  def __init__(self,n):
    self.parents = list(range(n))
    self.size = [1]*n
  
  def find(self,x):
    if self.parents[x] == x:
      return x
	
    self.parents[x] = self.find(self.parents[x])
    return self.parents[x]
  
  def union(self,x,y):
    x = self.find(x)
    y = self.find(y)
    
    if x==y:
      return
    
    if self.size[x]<self.size[y]:
      x,y=y,x
	
    self.size[x]+=self.size[y]
    self.parents[y] = x
  
  def same(self,x,y):
    return self.find(x) == self.find(y)
  
  def sizeofset(self,x):
    return self.size[self.find(x)]


N,M=map(int,input().split())
uf = UnionFind(N+1)

cnt=(N)*(N-1)//2
L=[[int(x) for x in input().split()] for _ in range(M)]
ans=[]

for a,b in L[::-1]:
  ans.append(cnt)
  if not uf.same(a,b):
    cnt -= uf.sizeofset(a)*uf.sizeofset(b)
    uf.union(a,b)

for x in ans[::-1]:
  print(x)
N, K = map(int, input().split())
A = list(map(int, input().split()))

A_neg = []
A_pos = []

for i in range(N):
  if A[i] <= 0:
    A_neg.append(-A[i])
  else:
    A_pos.append(A[i])

A_neg.sort(reverse=True)
A_pos.sort(reverse=True)

ans = 1

if K == N:
  for i in range(N):
    ans *= (A[i]%1000000007)
    ans %= 1000000007
  print(ans)

elif K%2==1 and len(A_pos)==0:
  for i in range(1, K+1):
    ans *= ((-A_neg[-i])%1000000007)
    ans %= 1000000007
  print(ans)

else:
  if K%2==1:
    ans *= A_pos.pop(0)
    K -= 1
  buf = []
  if len(len(A_pos)>=2):
    for i in range(len(A_pos)//2):
      buf.append(A_pos[2*i]*A_pos[2*i+1])
  if len(len(A_pos)>=2):
    for i in range(len(A_neg)//2):
      buf.append(A_neg[2*i]*A_neg[2*i+1])
  buf.sort(reverse=True)
  for i in range(K//2):
    ans *= (buf[i]%1000000007)
    ans %= 1000000007
  print(ans)
  



### FIXED CODE ###

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

A_neg = []
A_pos = []

for i in range(N):
  if A[i] <= 0:
    A_neg.append(-A[i])
  else:
    A_pos.append(A[i])

A_neg.sort(reverse=True)
A_pos.sort(reverse=True)

ans = 1

if K == N:
  for i in range(N):
    ans *= (A[i]%1000000007)
    ans %= 1000000007
  print(ans)

elif K%2==1 and len(A_pos)==0:
  for i in range(1, K+1):
    ans *= ((-A_neg[-i])%1000000007)
    ans %= 1000000007
  print(ans)

else:
  if K%2==1:
    ans *= A_pos.pop(0)
    K -= 1
  buf = []
  for i in range(len(A_pos)//2):
    buf.append(A_pos[2*i]*A_pos[2*i+1])
  for i in range(len(A_neg)//2):
    buf.append(A_neg[2*i]*A_neg[2*i+1])
  buf.sort(reverse=True)
  for i in range(K//2):
    ans *= (buf[i]%1000000007)
    ans %= 1000000007
  print(ans)
N, A, B = map(int, input().split())

items = []
A_MAX = 0
B_MAX = 0
for _ in range(N):
    a, b, cost = map(int, input().split())
    items.append((a, b, cost))
    A_MAX += a
    B_MAX += b

A_MAX = int(A_MAX)
B_MAX = int(B_MAX)

dp = [[float('infinity')] * (A_MAX + 1) for _ in range(B_MAX + 1)]

dp[0][0] = 0
for a, b, cost in items:
    dp[b][a] = cost

for a, b, cost in items:
    for i in range(B_MAX + 1):
        for j in range(A_MAX + 1):
            if i - b >= 0 and j - a >= 0:
                dp[i][j] = min(dp[i][j], dp[i - b][j - a] + cost)

ans = float('infinity')
for k in range(1, B_MAX + 1):
    for l in range(1, A_MAX + 1):
        if dp[k][l] == float('infinity'):
            continue
        if A * dp[k] == dp[l] * B:
            ans = min(ans, dp[k][l])
if ans == float('infinity'):
    print(-1)
else:
    print(ans)

### FIXED CODE ###

import sys



n, ma, mb = map(int, input().split())
abc = []

for _ in range(n):
    a, b, cost = map(int, input().split())
    abc.append((a, b, cost))

def main():
    sa = 0
    sb = 0
    for i in range(n):
        sa += abc[i][0]
        sb += abc[i][1]

    res = [[float('infinity')] * (sb + 1) for _ in range(sa + 1)]
    res[0][0] = 0

    for a, b, c in abc:

        for j in range(sa, -1, -1):
            for k in range(sb, -1, -1):
                if j >= a and k >= b:
                    res[j][k] = min(res[j][k], res[j-a][k-b] + c)

    ans = float('infinity')
    for i in range(1, min(sa//ma, sb//mb) + 1):
        ans = min(ans, res[ma*i][mb*i])

    if ans == float('infinity'):
        return -1
    else:
        return ans

if __name__ == '__main__':
    ans = main()
    print(ans)
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = input()
a = ''
for item in S:
  a_index = alphabet.index(item) + n
  if a_index > 25:
    a_index = a_index - 26
  a += alphabet[a_index]
print(a)


### FIXED CODE ###

alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = input()
a = ''
for item in S:
  a_index = alphabet.index(item) + N
  if a_index > 25:
    a_index = a_index - 26
  a += alphabet[a_index]
print(a)
n, k = [int(s) for s in input().split()]
s = input()

print(s[:k-1] + lower(s[k-1]) + s[k:])


### FIXED CODE ###

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

newS = s[:k-1]+s[k-1].lower()+s[k:]

print(newS)
s=input()
if s[0] =="A" and s[2:-1].count("C") ==1:
  if s[1:].replace("C").islower:
    print("AC")
  else:
    print('WA')  
else:
  print('WA')

### FIXED CODE ###

s=input()
if s[0] =='A' and s[2:-1].count('C') ==1 and s[1:].replace('C', '').islower():
  print('AC')
else:
  print('WA')
n = int(input())
A = [0]*(n+1)
A[a] +=0   for a in input().split()

for e in A[1:]:
  print(e)

### FIXED CODE ###

import sys
input = sys.stdin.readline

n = int(input())
A = [int(a) for a in input().split()]

sub_list = [0] *n

for a in A:
  sub_list[a-1] +=1

for i in range(n):
  print(sub_list[i])