Harryxun/stf_run huggingface dataset:
# coding: utf-8
# ?????????????????¨????????????
class Dice(object):
	def __init__(self):
		# ????????¶???
		self.dice = (2, 5), (3, 4), (1, 6) # x, y, z
		self.ax = [[0, False], [1, False], [2, False]]
		self.axmap = [0, 1, 2]
		self.mm = {"N": (0, 2), "S": (2, 0), "E": (1, 2), "W": (2, 1), "R": (0, 1), "L": (1, 0)}

	def rotate(self, dir):
		def rot(k, r):
			t = self.axmap[r]
			self.axmap[k], self.axmap[r] = t, self.axmap[k]
			self.ax[t][1] = not self.ax[t][1]

		rot(*self.mm[dir])

	def front(self): return self.value(0, True)
	def rear(self): return self.value(0, False)
	def right(self): return self.value(1, True)
	def left(self): return self.value(1, False)
	def top(self): return self.value(2, True)
	def bottom(self): return self.value(2, False)
	def value(self, ax, d):
		a = self.ax[self.axmap[ax]]
		return self.dice[a[0]][a[1] if d else not a[1]]

if __name__=="__main__":
	dice = Dice()
	labels = raw_input().split()
	q = int(raw_input())
	def tf(p, f, d):
		for _ in range(4):
			if p==f(): break
			dice.rotate(d)

	for _ in range(q):
		a, b = raw_input().split()
		p = labels.index(a) + 1
		f = dice.top
		tf(p, f, "N")
		tf(p, f, "E")
		
		p = labels.index(b) + 1
		f = dice.front
		tf(p, f, "R")

		print(labels[dice.right()-1])

### FIXED CODE ###

# coding: utf-8
# ?????????????????¨????????????
class Dice(object):
	def __init__(self):
		# ????????¶???
		self.dice = (2, 5), (3, 4), (1, 6) # x, y, z
		self.ax = [[0, False], [1, False], [2, False]]
		self.axmap = [0, 1, 2]
		self.mm = {"N": (0, 2), "S": (2, 0), "E": (1, 2), "W": (2, 1), "R": (0, 1), "L": (1, 0)}

	def rotate(self, dir):
		def rot(k, r):
			t = self.axmap[r]
			self.axmap[k], self.axmap[r] = t, self.axmap[k]
			self.ax[t][1] = not self.ax[t][1]

		rot(*self.mm[dir])

	def front(self): return self.value(0, True)
	def rear(self): return self.value(0, False)
	def right(self): return self.value(1, True)
	def left(self): return self.value(1, False)
	def top(self): return self.value(2, True)
	def bottom(self): return self.value(2, False)
	def value(self, ax, d):
		a = self.ax[self.axmap[ax]]
		return self.dice[a[0]][a[1] if d else not a[1]]

if __name__=="__main__":
	dice = Dice()
	labels = input().split()
	q = int(input())
	def tf(p, f, d):
		for _ in range(4):
			if p==f(): break
			dice.rotate(d)

	for _ in range(q):
		a, b = input().split()
		p = labels.index(a) + 1
		f = dice.top
		tf(p, f, "N")
		if p!=f(): tf(p, f, "E")
		
		p = labels.index(b) + 1
		f = dice.front
		tf(p, f, "R")

		print(labels[dice.right()-1])
N = int(input())
A = list(map(int,input().split()))
B = 10**5*[0]
ans = 0

for a in A:
  if a<=10**5:
    B[a]+=1
  else:
    ans+=1

for n in range(10**5):
  if B[n]<n:
    ans+=B[n]
  elif n<B[n]:
    ans+=B[n]-n

print(ans)

### FIXED CODE ###

from collections import *
input()
print(sum(v if k>v else v-k for k,v in Counter(map(int,input().split())).items()))
from itertools import product
from collections import deque
import numpy as np
class Grid():
    def __init__(self, grid, w=0, h=0, function=lambda x: x):
        self.w = w = w if w else len(grid[0])
        self.h = h = h if h else len(grid)
        dtype = type(function(grid[0][0]))
        self.grid = np.empty((h, w), dtype=dtype)
        for i, row in zip(range(h), grid):
            for j, val in zip(range(w), row):
                self.grid[i][j] = function(val)
    
    def is_valid_x(self, x):
        return 0 <= x < self.w
    def is_valid_y(self, y):
        return 0 <= y < self.h
    def is_valid_xy(self, x, y):
        return self.is_valid_x(x) and self.is_valid_y(y) 
    
    def __iter__(self):
        return iter(self.grid)
    def __repr__(self):
        return '\n'.join([' '.join(map(str, row)) for row in self.grid])
    def __getitem__(self, x):
        return self.grid[x]
    def __setitem__(self, x, val):
        self.grid[x] = val

X = iter(open(0).readlines())
h, w = map(int, next(X).split())
ch, cw = map(int, next(X).split())
dh, dw = map(int, next(X).split())
dp = Grid([x.strip() for x in X], function=lambda x: 10**6 if x == '.' else -1)

def dfs(stack):
    if not stack:
        return
    x, y, d = stack[0]
    dp[y, x] = d
    stack2 = []
    while stack:
        x, y, d = stack.pop()
        if dp[y, x] < d:
            continue
        for dx, dy in zip([1, 0, -1, 0], [0, 1, 0, -1]):
            nx, ny = x+dx, y+dy
            if dp.is_valid_xy(nx, ny) and dp[ny, nx] > d:
                dp[ny, nx] = d
                stack.append((nx, ny, d))
        for dx, dy in product(range(-2, 3), repeat=2):
            if abs(dx) + abs(dy) < 2:
                continue
            nx, ny = x+dx, y+dy                
            if dp.is_valid_xy(nx, ny) and dp[ny, nx] > d+1:
                dp[ny, nx] = d+1
                stack2.append((nx, ny, d+1))
        dfs(stack2)

dfs([(cw-1, ch-1, 0)])
if dp[dh-1, dw-1] == 10**6:
    print(-1)
else:
    print(dp[dh-1, dw-1])

### FIXED CODE ###

from collections import deque
from itertools import product
h, w = list(map(int,input().split()))
sy, sx = list(map(int,input().split()))
gy, gx = list(map(int,input().split()))
sx, sy, gx, gy = sx-1, sy-1, gx-1, gy-1
 
G = [list(input()) for _ in range(h)]
D = [[10**6]*w for _ in range(h)]
D[sy][sx] = 0
Q = deque([(sy, sx)])
while Q:
    y, x = Q.pop()
    for dy, dx in product(range(-2, 3), repeat=2):
        ny, nx = y+dy, x+dx
        if dx==dy==0:
            G[y][x] = '#'
            continue
        elif ny<0 or h<=ny or nx<0 or w<=nx:
            continue
        elif G[ny][nx] == '#':
            continue
        elif abs(dy)+abs(dx)<=1:
            G[ny][nx] = '#'
            D[ny][nx] = D[y][x]
            Q.append((ny, nx))
        elif D[ny][nx] == 10**6:
            D[ny][nx] = D[y][x]+1
            Q.appendleft((ny, nx))
            
if D[gy][gx] == 10**6:
    print(-1)
else:
    print(D[gy][gx])
n = int(input())
h = list(map(int, input().split()))

ans = 0
start_flg = True
for i in range(n-1):
    if start_flg:
        temp = 0

    if h[i] >= h[i+1]:
        temp += 1
        start_flg = False
    else:
        ans = max(ans, temp)
        start_flg = True
ans = max(ans, temp)

print(ans)


### FIXED CODE ###

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

ans = 0
temp = 0
start_flg = True
for i in range(n-1):
    if start_flg:
        temp = 0

    if h[i] >= h[i+1]:
        temp += 1
        start_flg = False
    else:
        ans = max(ans, temp)
        start_flg = True
ans = max(ans, temp)

print(ans)
s = input().strip()
k = int(input())

count = 0
for i in range(k):
    c = s[i]
    if c != '1':
        print(c)
    else:
        count += 1
else:
    print('1')

### FIXED CODE ###

s = input().strip()
k = int(input())

count = 0
for i in range(len(s)):
    c = s[i]
    if c != '1':
        if k <= count:
            print('1')
        else:
            print(c)
        break
    else:
        count += 1
else:
    print('1')
s=input()
A=str(A+s[8]+C)
print(str(A))

### FIXED CODE ###

s=input()
print("A"+s[8]+"C")
N = input()
S,T = input().split()

a = []
for i in range(N):
  a.append(S[i])
  a.append(T[i])
print(a)

### FIXED CODE ###

N = int(input())
S,T = input().split()
 
a = ""
for i in range(N):
  a+=S[i]+T[i]
print(a)
N = int(input())

A = []
for _ in range(N):
  A.append(int(input())-1)

count = []
n = 0
for k in range(N+1):
  if A[n] == 1:
    break
 
  elif A[n] in count:
    ans = -1
    break
  
  else:
    count.append(A[n])
    ans = k+1
    n = A[n]
 
print(ans)


### FIXED CODE ###

n = int(input())
al = []
for i in range(n):
    a = int(input())
    al.append(a)
 
al.insert(0, 0)
ans = -1
push = 1
for i in range(1, n+2):
    light = al[push]
    push = light
    if light == 2:
        ans = i
        break
print(ans)
S=map(int,input().split())
s=set(S)
if len(s)==2:
  print('Yes')
else:
  print('No)


### FIXED CODE ###

a,b,c=map(int,input().split())
S=[a,b,c]
s=set(S)
if len(s)==2:
  print('Yes')
else:
  print('No')
S = input()
ans = 0
for j in range(len(S)):
    for i in range(j-2):
        if i < j:
            if int(S[i:j+1])%2019 == 0:
                ans = ans + 1
print(ans)

### FIXED CODE ###

S, W = map(int, input().split())
if S <= W:
    print('unsafe')
else:
    print('safe')
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
S = input()

# find the largest subsequence
packet = []
direction = [S[0]]
seq = 1
for i in range(1, N - 1):
    if S[i] == direction[-1]:
        seq += 1
    else:
        packet.append(seq)
        seq = 1
        direction.append(S[i])
if S[N - 1] == direction[-1]:
    seq += 1
    packet.append(seq)
else:
    packet.append(seq)
    seq = 1
    direction.append(S[N - 1])
    packet.append(seq)

#print(packet)


start_color = S[0]
packet_len = len(packet)

max_sum = packet[0] + packet[1]
max_idx = 0
for i in range(1, packet_len - 1):
    if max_sum < packet[i - 1] + packet[i] + packet[i + 1]:
        max_sum = packet[i - 1] + packet[i] + packet[i + 1]
        max_idx = i
if max_sum < packet[packet_len - 2] + packet[packet_len - 1]:
    max_idx = packet_len - 1


for _ in range(K):
    if packet_len == 1:
        print(packet_len - 1)
        exit()
    #print(max_idx)

    if max_idx == 0:
        val = packet[0] + packet[1]
        packet = [val] + packet[2:]
        packet_len -= 1

    elif max_idx == packet_len - 1:
        val = packet[-1] + packet[-2]
        packet = packet[:packet_len - 2] + [val]
        packet_len -= 1
        max_idx = packet_len - 2
    else:
        val = packet[max_idx - 1] + packet[max_idx] + packet[max_idx + 1]
        packet = packet[:max_idx - 1] + [val] + packet[max_idx + 2:]
        packet_len -= 2
        max_idx = max_idx - 1

    #print(packet)

ans = 0
for v in packet:
    ans += v - 1
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
S = input()

# find the largest subsequence
packet = []
packet_len = 1
direction = S[0]
seq = 1
for i in range(1, N - 1):
    if S[i] == direction:
        seq += 1
    else:
        packet.append(seq)
        seq = 1
        direction = S[i]
        packet_len += 1

if S[N - 1] == direction:
    seq += 1
    packet.append(seq)
else:
    packet.append(seq)
    seq = 1
    direction = S[N - 1]
    packet.append(seq)
    packet_len += 1

#print(packet)
#print(packet_len)

# There is no need to choose the 'most invertible' index (i.e. max_idx) !!!
# Also, there is no need to rewrite the packet

num = 2 * K + 1
if packet_len == 1 or packet_len == 2 or num >= packet_len:
    print(N - 1)
elif num < packet_len:
    rem = packet_len - num
    print(N - rem - 1)
from math import gcd

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


### FIXED CODE ###

def lcm(X,Y):
    x=X
    y=Y
    if y>x:
        x,y=y,x
    while x%y!=0:
        x,y=y,x%y
    return X*Y//y

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

LCM = A[0]
for i in range(0,N-1,1):
    LCM = lcm(LCM,A[i+1])
B = [0 for i in range(0,N,1)]
for i in range(0,N,1):
    B[i]= (LCM%MOD)*pow(A[i],MOD-2,MOD)%MOD

ans = 0
for i in range(0,N,1):
    ans = (B[i] + ans)%MOD

print(ans)
N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) for x in range(len(L)+1)]
TF = [i < X for i in accumL]
print(TF.index(False))

### FIXED CODE ###

N,X = map(int, input().split())
L = [x for x in map(int, input().split())]
accumL = [sum(L[:x]) <= X for x in range(len(L)+1)]
if accumL[-1] == True:
  print(N + 1)
else:
  print(accumL.index(False))
l = input().split()
cnt = 0
while len([True for x in l if l%2==0]):
  l = [x/2 for x in l]
  cnt += 1
print(cnt)

### FIXED CODE ###

n = input()
l = [int(x) for x in input().split()]
cnt = 0
while len([True for x in l if x%2==0]) == len(l):
  l = [x/2 for x in l]
  cnt += 1
print(cnt)
def main():
    N = int(input())
    lst = [input().split()for i in range(N)]
    Y = 0

    for i in range(0, N):
        if lst[i][1] == "JPY":
            Y += float(lst[i][0])
        else:
            Y += float(lst[i][0])*380000.0
    print(Y)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    import datetime
    s = str(input())
    S = datetime.datetime.strptime(s, "%Y/%m/%d")
    if(S <= datetime.datetime(2019, 4, 30)):
        print("Heisei")
    else:
        print("TBD")


if __name__ == "__main__":
    main()
import pandas
import math
import numpy
import collections

x = input()
TF =  x.isupper() and x.isalpha()
if(TF):
    li = [i for i in x]
    count_dict = collections.Counter(li)
    list = [v for k, v in count_dict.items()]
    
    if(list == [2,2]):
        print(True)
    else:
        print(False)
print(False)
        

### FIXED CODE ###

import collections

x = input()
TF =  x.isupper() and x.isalpha()
flg  = 0
if(TF):
    li = [i for i in x]
    count_dict = collections.Counter(li)
    list = [v for k, v in count_dict.items()]
    if(list == [2,2]):
        print("Yes")
        flg = 1
if(flg == 0):
    print("No")
N,M=map(int,input().split())
h=list(map(int,input().split()))
t=[0]*N
for i in range(M):
    A,B=map(int,input().split())
    t[A-1] = max(t[A-1], H[B-1])
    t[B-1] = max(t[B-1], H[A-1])

ct=0
for j in range(N):
    if H[j]>[j]:
        ct+=1
print(ct)


### FIXED CODE ###

N,M=map(int,input().split())
h=list(map(int,input().split()))
t=[0]*N
for i in range(M):
    A,B=map(int,input().split())
    t[A-1] = max(t[A-1], h[B-1])
    t[B-1] = max(t[B-1], h[A-1])

ct=0
for j in range(N):
    if h[j]>t[j]:
        ct+=1
print(ct)
from bisect import bisect

n,h=map(int,input().split())
a=[]
b=[]
a_max=0
b_max=0
for i in range(n):
  x,y=map(int,input().split())
  a.append(x)
  b.append(y)
  a_max=max(a_max,x)
  b_max=max(b_max,y)

if a.index(a_max)==b.index(b_max):
  a=sorted(a)
  a_max=a[-2]

b=sorted(b)
lim_inx=bisect(b,a_max)

cnt=0
total=0
inx=n-1
while total<=h:
  if inx>=lim_inx:
    total+=b[inx]
    cnt+=1
    inx-=1
  else:
    if (h-total)%a_max==0:
      cnt+=(h-total)//a_max
    else:
      cnt+=(h-total)//a_max+1
    print(cnt)
    exit()
print(cnt)

### FIXED CODE ###

from bisect import bisect

n,h=map(int,input().split())
b=[]
a_max=0
for i in range(n):
  x,y=map(int,input().split())
  b.append(y)
  a_max=max(a_max,x)

b=sorted(b)
lim_inx=bisect(b,a_max)

cnt=0
total=0
inx=n-1
while total<h:
  if inx>=lim_inx:
    total+=b[inx]
    cnt+=1
    inx-=1
  else:
    if (h-total)%a_max==0:
      cnt+=(h-total)//a_max
    else:
      cnt+=(h-total)//a_max+1
    print(cnt)
    exit()
print(cnt)
A=int(input())
B=int(input())
C=int(input())
X=int(input())

a=A/50
b=B/50
c=C/50
x=X/50

count=0

for i in range(a+1):
  for l in range(b+1):
    if 0<=x-a*10-b*2<=c:
      count+=1
      
print(count)


### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
X=int(input())


x=X/50

count=0

for i in range(a+1):
  for l in range(b+1):
    if 0<=x-i*10-l*2<=c:
      count+=1
      
print(count)
N,L=(map(int,input().split()))

Nazi=[]

for i in range(N+1):
    azi=L+i-1
    Nazi.append(azi)
del Nazi[0]

sum=0
if L>0:
    del Nazi[0]
    print(sum(Nazi))
else:
    for i in Nazi:
       sum+=i
    sum=(sum-Nazi[-1])
    print(sum)

### FIXED CODE ###

N,L=input().split()


ApplesTaste=[]
for i in range(int(N)):
    taste=int(L)+i
    ApplesTaste.append(taste)


hu=0
zero=0
for i in ApplesTaste:
    
    if i is 0:
        zero+=1
    if i < 0:
        hu+=1

#0がある
if zero is 1:
    point=ApplesTaste.index(0)
    del ApplesTaste[point]
    print(sum(ApplesTaste))

#0がなく全部負
elif hu > 0 and zero is 0:
    point=len(ApplesTaste)-1
    
    del ApplesTaste[point]
    print (sum(ApplesTaste))

else:
    del ApplesTaste[0]
    print(sum(ApplesTaste))
N,  M = [int(i) for i in input().split()]
cities = {}
for i in range(M):
    cities[i+1] = 0
for i in range(M):
    for c in [int(i) for i in input().split()]:
        cities[c] += 1
for key, val in sorted(cities.items()):
    print(val)

### FIXED CODE ###

N,  M = [int(i) for i in input().split()]
cities = {}
for i in range(N):
    cities[i+1] = 0
for i in range(M):
    for c in [int(i) for i in input().split()]:
        cities[c] += 1
for key, val in sorted(cities.items()):
    print(val)
N,A,B=map(int,input().split())
a=N//(A+B)
if N%(A+B)==0:
    print(a*A)
elif N%(A+B)>=A:
    print(a*A+A))
elif N%(A+B)<A:
    print(a*A+(N%(A+B)))

### FIXED CODE ###

n,a,b=map(int,input().split())
i=n%(a+b)
if i>a:
    print(a*(n//(a+b))+a)
else:
    print(a*(n//(a+b))+i)
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n=ni()


cnt=[0]*(n+1)

for x in range(1,n+1):
  if x**2+x>n+1:
    break
  for y in range(x,n+1):
    if x**2+y**2+x*y+x+y>n+1:
      break
    for z in range(y,n+1):
      num = x**2+y**2+z**2+x*y+y*z+x*z
      if num > n+1:
        break
      if x==y==z:
        cnt[num]+=1
      elif x==y:
        cnt[num]+=3
      elif y==z:
        cnt[num]+=3
      elif x==z:
        cnt[num]+=3
      else:
        cnt[num]+=6

for i in range(1,n+1):
  print(cnt[i])


### FIXED CODE ###

ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n=ni()


cnt=[0]*(n+1)

for x in range(1,n+1):
  if x**2+x>n:
    break
  for y in range(x,n+1):
    if x**2+y**2+x*y+x+y>n:
      break
    for z in range(y,n+1):
      num = x**2+y**2+z**2+x*y+y*z+x*z
      if num > n:
        break
      if x==y==z:
        cnt[num]+=1
      elif x==y:
        cnt[num]+=3
      elif y==z:
        cnt[num]+=3
      elif x==z:
        cnt[num]+=3
      else:
        cnt[num]+=6

for i in range(1,n+1):
  print(cnt[i])
import math

p = [2]
    
def isprime(x):
    if x == 2:
        return True
    if x == 3:
        return True
    if max(p) < x**0.5:
        for j in range(max(p), math.floor(x**0.5) + 1):
            if all([j % k != 0 for k in p]):
                p.append(j)
    i = 0
    while i <= len(p)-1:
        if x%p[i] == 0:
            return False
        if p[i] > x**0.5:
            break;
        i += 1
    return True


n = int(input())
res = 0
for i in range(n):
    k = int(input())
    if isprime(k):
        res += 1
print(res, p)

for i in range(n):
    k = int(input())
    if isprime(k):
        res += 1
print(res)

### FIXED CODE ###

import math

p = [2]
    
def isprime(x):
    if x == 2:
        return True
    if x == 3:
        return True
    if max(p) < x**0.5:
        for j in range(max(p), math.floor(x**0.5) + 1):
            if all([j % k != 0 for k in p]):
                p.append(j)
    i = 0
    while i <= len(p)-1:
        if x%p[i] == 0:
            return False
        if p[i] > x**0.5:
            break;
        i += 1
    return True


n = int(input())
res = 0
for i in range(n):
    k = int(input())
    if isprime(k):
        res += 1
print(res)
import numpy as np
r = int(input())
print("{} {}".format((np.pi)*r**2 , 2*np.pi*r))


### FIXED CODE ###

pi = 3.141592653589793
r = float(input())
print("{0:.6f} {1:.6f}".format(pi*r**2 , 2*pi*r))
S = input()
a = s.find('a')  # indexは1(2文字目)
b = s.find('b')  # indexは1(2文字目)
c = s.find('c')  # indexは1(2文字目)

if a != b != c :
    print('Yes')
else :
    print('No')
    

### FIXED CODE ###

S = str(input() )
if ('a' in S) == ('b' in S) == ('c' in S) == True: 
    print('Yes')
else :
    print('No')
S = input().split("/")
 
if int(S[5]) < 5 and int(s[4]) ==0 :
	print('Heisei')
else :
	print('TBD')

### FIXED CODE ###

s = input()

if s <= "2019/04/30":
    print("Heisei")
else:
    print("TBD")
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = []
d = []
co = 0
for i in range(a[0]):
	c.append(abs(b[i]-a[1]))
	if b[i]-a[1] > 0 and co == 0:
		c.insert(i,0)
		co += 1
if co == 0:
	c.append(0)

for i in range(len(c)-1):
	d.append(abs(c[i+1]-c[i]))
k = min(d)
for i in range(len(d)):
	if d[i] % k != 0:
		d[0] = 1
		break
print(d[0])

### FIXED CODE ###

import functools
import fractions
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = []
d = []
co = 0
for i in range(a[0]):
	c.append(abs(b[i]-a[1]))
	if b[i]-a[1] > 0 and co == 0:
		c.insert(i,0)
		co += 1
if co == 0:
	c.append(0)

for i in range(len(c)-1):
	d.append(abs(c[i+1]-c[i]))
print(functools.reduce(fractions.gcd, d))
a, b = map(int, raw_input().split());

print '%d %d' % (2*(a+b), a*b)

### FIXED CODE ###

a, b = map(int, raw_input().split())

print a*b, 2*(a+b)
n,k=map(int,input().split())
cst=list(map(int,input().split()))
arr=[0]*10
arr[0]=0
arr[1]=abs(cst[1]-cst[0])
if n==2:
    print(arr[1])
else:
    for i in range(2, n):
        #arr[i] = min(abs(cst[i - 1] - cst[i]) + arr[i - 1], abs(cst[i - 2] - cst[i]) + arr[i - 2])
        #t=cst.index(min(cst[max(i-k,0):i]))
        arr[i]=min(abs(cst[max(i-j,0)]-cst[i])+arr[i-j] for j in range(1,k+1))
    print(arr[n-1])

#print(arr)

### FIXED CODE ###

import sys

def input():
    return sys.stdin.readline().strip()

def main():
    n, k = map(int, input().split())
    cst = list(map(int, input().split()))
    arr = [0] * n
    arr[1] = abs(cst[1] - cst[0])
    for i in range(2, n):
        arr[i] = min(abs(cst[j] - cst[i]) + arr[j] for j in range(max(i - k, 0), i))
    print(arr[n - 1])
if __name__ == '__main__':
    main()
import itertools
from math import ceil

def main():
    n = int(input())
    ans = 10**9
    u = []
    r = []
    d = []
    l = []
    for _ in range(n):
        k = input().split()
        x,y = int(k[0]),int(k[1])
        if(k[2] == "U"):
            u.append((x,y))
        elif(k[2] == "R"):
            r.append((x,y))
        elif(k[2] == "D"):
            d.append((x,y))
        elif(k[2] == "L"):
            l.append((x,y))

    prd = list(itertools.product(l,r))
    for j in prd:
        one = j[0]
        two = j[1]
        if(one[1] == two[1] and one[0] > two[0]):
            dif = abs(one[0] - two[0])
            if(dif % 2 == 0):
                ans = min(ans,dif//2*10)
            
    prd = list(itertools.product(u,d))
    for j in prd:
        one = j[0]
        two = j[1]
        if(one[0] == two[0] and one[1] < two[1]):
            dif = abs(one[1] - two[1])
            if(dif % 2 == 0):
                ans = min(ans,dif//2 * 10)

    prd = list(itertools.product(u,r))
    for j in prd:
        one = j[0]
        two = j[1]
        if(one[0]-two[0] == two[1]-one[1] and one[0]-two[0] > 0 and one[1] - two[1] < 0):
            ans = min(ans,(one[0]-two[0])*10)

    prd = list(itertools.product(u,l))
    for j in prd:
        one = j[0]
        two = j[1]
        if(-one[0] + two[0] == one[1] - two[1] and one[0]-two[0] < 0 and one[1] - two[1] < 0):
            ans = min(ans,(two[0]-one[0])*10)
    
    prd = list(itertools.product(d,r))
    for j in prd:
        one = j[0]
        two = j[1]
        if(one[0]-two[0] == one[1]-two[1] and one[0]-two[0] > 0 and one[1] - two[1] < 0):
            ans = min(ans,(-two[0] + one[0])*10)

    prd = list(itertools.product(d,l))
    for j in prd:
        one = j[0]
        two = j[1]
        if(two[0]-one[0] == one[1] - two[1] and one[0]-two[0] < 0 and one[1] - two[1] > 0):
            ans = min(ans,(two[0] - one[0])*10)
    if(ans == 10**9):
        print("SAFE")
        return
    else:
        print(ans)
        return

if __name__ == "__main__":
    main()

### FIXED CODE ###

n=int(input())

def main():
    if(n<600):
        print(8)
        return
    elif(n<800):
        print(7)
        return
    elif(n<1000):
        print(6)
        return
    elif(n<1200):
        print(5)
        return
    elif(n<1400):
        print(4)
        return
    elif(n<1600):
        print(3)
        return
    elif(n<1800):
        print(2)
        return
    else:
        print(1)
        return
if __name__=="__main__":
    main()
n = input()
#a = list(map(int, input().split()))
a = np.array([int(i) for i in input().split()])
for i in range(int(n)):
    print(a.count(i+1))


### FIXED CODE ###

num = int(input())
h_numbers = list(map(int, input().split()))
s = [0] * num
for i in h_numbers:
    s[i-1] += 1
[print(i) for i in s]