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

import sys

I = list(map(int, input().split()))
P = list(map(int, input().split()))
P = [i for i in P if 1 <= i and i <= 10**3]
N = I[0] # サイコロ数
K = I[1]
Q = []
R = []
r = 0

if not 1 <= K <= N <= 2*10**5:
    sys.exit()

for i in range(N):
    q = sum(range(1, P[i]+1)) / P[i]
    Q.append(q)
    for j in range(N-K+1):
        r = sum(Q[j:j+K])
        R.append(r)
print(max(R))

### FIXED CODE ###

import sys

N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
P = [i for i in P if 1 <= i and i <= 10**3]
Q = [] # 期待値リスト
S = [] # 累積和
T = [] # 隣接するK個の期待値
s=0

if not 1 <= K <= N <= 2*10**5:
    sys.exit()

for i in range(N):
    # q = sum(range(1, P[i]+1)) / P[i]
    q = (1 + P[i]) / 2
    Q.append(q)
    s += q
    S.append(s)
    if i == K-1:
        T.append(S[i])
    if i > K-1:
        T.append(S[i]-S[i-K])
print(max(T))
### BUGGY CODE ###

N, K = list(map(int,input().split()))
A = [int(a) for a in input().split()]

import itertools

B = list(itertools.combinations(A,K))


ansA=[]
for i in range(0, len(B)):
    ans = max(B[i])-min(B[i])
    ansA.append(ans)

print(sum(ansA)%(10**9+7))    


### FIXED CODE ###

import math
N, K = map(int, input().split())
A = [int(a) for a in input().split()]

A.sort()

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

mod = 10**9+7 #出力の制限
Ne = 10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, Ne + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )



maxi = 0
for i in range(K-1,N):
    maxi += A[i]*cmb(i, K-1, mod)

mini = 0
A.sort(reverse=True)
for j in range(K-1,N):
    mini += A[j]*cmb(j, K-1, mod)

print((maxi-mini)%mod)
### BUGGY CODE ###

# input
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x, y, c = [0] * M, [0] * M, [0] * M
for i in range(M):
    x[i], y[i], c[i] = map(int, input().split())
ans = float("inf")
for i in range(A):
    for j in range(B):
        cmax = 0
        for k in range(M):
            if i+1 == x[k] and j+1 == y[k]:
                cmax = max(cmax, c[k])
        res = a[i] + b[j] - cmax
        ans = min(ans, res)
print(ans)


### FIXED CODE ###

A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = min(a) + min(b)
for i in range(M):
    x, y, c = map(int, input().split())
    ans = min(ans, a[x-1] + b[y-1] - c)
print(ans)
### BUGGY CODE ###

n ,m = map(int, input().split())
L_R = []
for i in range(m):
    l, r = map(int, input().split())
    tmp = set()
    for i in range(l, r + 1):
        tmp.add(i)
    L_R.append(tmp)

result = L_R[0]
for target_set in L_R:
    result = result.intersection(target_set)

print(len(result))

### FIXED CODE ###

n ,m = map(int, input().split())
L = []
R = []
for i in range(m):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)
if max(L) <= min(R):
    print(min(R) - max(L) + 1)
else:
    print(0)
### BUGGY CODE ###

from collections import deque
MOD = 10**9 + 7

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

def GCP(a, b):
  if a < b:
    a, b = b, a
  while b > 0:
    a, b = b, a % b
  return a

def LCM(a, b):
  return a * b // GCP(a, b)

T = deque(A)
while len(T) > 1:
  T.append(LCM(T.pop(), T.pop()))

L = T[0]

ans = 0
for i in range(N):
  ans += L // A[i]
  ans %= MOD

print(ans)

### FIXED CODE ###

from collections import deque

def GCP(a, b):
  if a < b:
    a, b = b, a
  while b > 0:
    a, b = b, a % b
  return a

def LCM(a, b):
  return a * b // GCP(a, b)

def solve():
  MOD = 10**9 + 7

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

  T = deque(A)
  while len(T) > 1:
    T.append(LCM(T.pop(), T.pop()))

  L = T.pop()

  ans = 0
  for i in range(N):
    ans += L // A[i]

  print(ans % MOD)

solve()
### BUGGY CODE ###

import queue
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
ans = float('inf')
q = queue.Queue()

if s[0][0] == '#':
    q.put([0, 0, 1])
else:
    q.put([0, 0, 0])

while not q.empty():
    a = q.get()
    if ans <= a[2]:
        continue
    
    if a[0] == h-1 and a[1] == w-1:
        ans = min(ans, a[2])
        
    if a[0]+1 < h and a[1]+1 < w:
        if s[a[0]+1][a[1]] == '.' and s[a[0]][a[1]+1] == '.':
            q.put([a[0]+1, a[1], a[2]])
            q.put([a[0], a[1]+1, a[2]])
        elif s[a[0]+1][a[1]] == '.' and s[a[0]][a[1]+1] == '#':
            q.put([a[0]+1, a[1], a[2]])
        elif s[a[0]+1][a[1]] == '#' and s[a[0]][a[1]+1] == '.':
            q.put([a[0], a[1]+1, a[2]])
        else:
            q.put([a[0]+1, a[1], a[2]+1])
            q.put([a[0], a[1]+1, a[2]+1])
    elif a[0]+1 < h:
        if s[a[0]+1][a[1]] == '.':
            q.put([a[0]+1, a[1], a[2]])
        else:
            q.put([a[0]+1, a[1], a[2]+1])
    elif a[1]+1 < w:
        if s[a[0]][a[1]+1] == '.':
            q.put([a[0], a[1]+1, a[2]])
        else:
            q.put([a[0], a[1]+1, a[2]+1])
        
print(ans)


### FIXED CODE ###

import queue
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
ans = float('inf')
q = queue.Queue()
vals = [[float('inf')]*w for _ in range(h)]
vals[0][0] = 0
q.put([0, 0])

while not q.empty():
    a = q.get()
    for i, j in ((1, 0), (0, 1)):
        x, y = a[0]+i, a[1]+j
        if 0 <= x < h and 0 <= y < w:
            if s[x][y] == '#' and s[a[0]][a[1]] == '.':
                if vals[x][y] > vals[a[0]][a[1]]+1:
                    vals[x][y] = vals[a[0]][a[1]]+1
                    q.put([x, y])
            elif vals[x][y] > vals[a[0]][a[1]]:
                vals[x][y] = vals[a[0]][a[1]]
                q.put([x, y])
ans = vals[-1][-1]
if s[0][0] == '#':
    ans += 1

print(ans)
### BUGGY CODE ###

S = input()
Q = int(input())

is_reversed = False

for _ in range(Q):
    q = input().split(" ")
    if q[0] == "1":
        is_reversed = not is_reversed
    else:
        if q[1] == "1":
            if is_reversed:
                S += q[2]
            else:
                S = q[2] + S
        else:
            if is_reversed:
                S = q[2] + S
            else:
                S += q[2]
            
if is_reversed:
    S = ''.join(list(reversed(S)))

print(S)

### FIXED CODE ###

from collections import deque

S = input()
Q = int(input())

is_reversed = False

S = deque(S)

for _ in range(Q):
    q = input().split(" ")
    if q[0] == "1":
        is_reversed = not is_reversed
    else:
        if q[1] == "1":
            if is_reversed:
                S.append(q[2])
            else:
                S.appendleft(q[2])
        else:
            if is_reversed:
                S.appendleft(q[2])
            else:
                S.append(q[2])

S = list(S)
if is_reversed:
    S = ''.join(list(reversed(S)))
else:
    S = ''.join((S))

print(S)
### BUGGY CODE ###

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

result = 0
for i in range(N):
    for j in range(i+1, N):
        result += (A[i] * A[j])
print(result % (10**9 + 7))


### FIXED CODE ###

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

A_sum = sum(A)
result = 0
for i in range(N):
    A_sum -= A[i]
    result += A[i] * A_sum % (10**9 + 7)
print(result % (10**9 + 7))
### BUGGY CODE ###

n=int(input())
import fractions
total=0
for A in range(1,n+1):
  for B in range(1,n+1):
    for C in range(1,n+1):
      a=[A,B,C]
     
      ans = a[0]
      for i in range(1,3):
        ans=fractions.math.gcd(ans,a[i])
       
      total=total+ans
print(total)  

### FIXED CODE ###

n=int(input())
import fractions
total=0
for A in range(1,n+1):
  for B in range(1,n+1):
    for C in range(1,n+1):
      a=[A,B,C]
     
      ans = a[0]
      for i in range(1,3):
        ans=fractions.math.gcd(ans,a[i])
       
      total=total+ans
print(total)
### BUGGY CODE ###

def run():
  N, K = map(int, input().split())
  ps = list(map(int, input().split()))
  dp = [0]*(N-K+1)
  ans = 0
  dp[0] = sum(ps[0:K])
  for n in range(1, N-K+1):
    dp[n] = max(dp[n-1], sum(ps[n:n+K]))
  print((dp[-1]+K)/2)

if __name__ == '__main__':
    run()

### FIXED CODE ###

def run():
  N, K = map(int, input().split())
  ps = list(map(int, input().split()))
  dp = [0]*(N-K+1)
  ans = 0
  dp[0] = sum(ps[0:K])
  for n in range(1, N-K+1):
    dp[n] = dp[n-1]+ps[n+K-1]-ps[n-1]
  print((max(dp)+K)/2)

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



def p(k,w,maxP):
    count = 1
    tmpList = []
    for x in w:
        if sum(tmpList)+x <= maxP:
            tmpList.append(x)
        else:
            count += 1
            tmpList = []
            tmpList.append(x)
    
    if count > k :
        result = False
    else:
        result = True

    return result


def pout(k,w,maxP):
    count = 1
    tmpList = []
    mP = 0
    for x in w:
        if sum(tmpList)+x <= maxP:
            tmpList.append(x)
            mP = max(sum(tmpList),mP)
        else:
            count += 1
            tmpList = []
            tmpList.append(x)
            mP = max(sum(tmpList),mP)
    
    if count > k :
        result = False
    else:
        result = True

    return result, count, mP


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


w = []

for _ in range(n):
    w.append((int)(input()))
rangeMax = 10000*10000
rangeMin = 1

while _:
    rangeMid = (rangeMax + rangeMin)//2
    '''print(p(k,w,rangeMid))
    print(p(k,w,rangeMid+1))
    print("---")
    '''
    if p(k,w,rangeMid) == False and p(k,w,rangeMid+1) == False:
        rangeMin = rangeMid
    elif p(k,w,rangeMid) == True and p(k,w,rangeMid+1) == True:
        rangeMax = rangeMid
    else:
        break

print(pout(k,w,rangeMid+1)[2])

### FIXED CODE ###



def p(k,w,maxP):
    count = 1
    tmpWeight = 0
    for x in w:
        if tmpWeight+x <= maxP:
            tmpWeight += x
        else:
            count += 1
            if count > k :
                return False
            tmpWeight = x
    

    return True




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


w = []

for _ in range(n):
    w.append((int)(input()))
rangeMax = sum(w)
rangeMin = max(w)
rangeMid = 0
while rangeMin < rangeMax:
    rangeMid = (rangeMax + rangeMin)//2
    '''print(p(k,w,rangeMid))
    print(p(k,w,rangeMid+1))
    print("---")
    '''
    if p(k,w,rangeMid) == True:
        rangeMax = rangeMid
    else:
        rangeMid += 1
        rangeMin = rangeMid

print(rangeMid)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
def func(a):
    global alist
    cnt = 1
    for i in range(len(alist)):
        if abs(alist[i][0]) > abs(int(a)):
            alist[i][1] += 1
        else:cnt += 1
    alist.append([int(a),cnt])

    return int(a)



alist = []
n,k = map(int,input().split())
x = list(map(func,input().split()))#sort済み
anslist = []
for i in range(len(alist)):
    if alist[i][1] <= k:
        anslist.append(alist[i][0])

anslist.sort()
#print(alist)
#print(anslist)
if anslist[0] >= 0 and anslist[-1] >= 0:
    print(anslist[-1])

elif anslist[0] <= 0 and anslist[-1] <= 0:
    print(-anslist[0])

else:
    if anslist[-1] > -anslist[0]:
        print(-2*anslist[0] + anslist[-1])
    else:
        print(2*anslist[-1] - anslist[0])






### FIXED CODE ###

n,k = map(int,input().split())
x = list(map(int,input().split()))
ans = float('inf')
for i in range(n-k+1):
    left = i
    right = i+k-1
    ans = min(ans, min(abs(x[left])+abs(x[right]-x[left]),abs(x[right])+abs(x[left]-x[right])))
print(ans)
### BUGGY CODE ###

s = input()
n = len(s)
res = dict()
res[0] = 1

T = 0
for i in range(n):
    T += int(s[-1-i])*(10**i)%2019
    T = T%2019
    if res.get(T) == None:
        res[T] = 1
    else:
        res[T] += 1
cnt = 0
for d in res:
    if not res[d] == 1:
        cnt += int(res[d]*(res[d]-1)/2)
print(cnt)

### FIXED CODE ###

import collections
s = input()
n = len(s)
mod_list = [0]

T = 0
for i in range(n):
    T += int(s[-1-i])*pow(10, i, 2019)%2019
    T = T%2019
    mod_list.append(T)

res = collections.Counter(mod_list)
cnt = 0
for d in res.values():
    cnt += int(d*(d-1)/2)
print(cnt)
### BUGGY CODE ###

h,w,d=map(int,input().split())
D=dict()
for i in range(h):
  A=[int(i) for i in input().split()]
  for j in range(w):
    D[A[j]]=[i+1,j+1]
def Dist(x,y):
  return abs(D[x][0]-D[y][0])+abs(D[x][1]-D[y][1])
q=int(input())
for i in range(q):
  l,r=map(int,input().split())
  ans=0
  rep=(r-l)//d
  for j in range(rep):
    ans+=Dist(l+j*d,l+(j+1)*d)
  print(ans)


### FIXED CODE ###

h,w,d=map(int,input().split())
D=dict()
for i in range(h):
  A=[int(i) for i in input().split()]
  for j in range(w):
    D[A[j]]=[i+1,j+1]
def Dist(x,y):
  return abs(D[x][0]-D[y][0])+abs(D[x][1]-D[y][1])
T=[[0 for _ in range((h*w)//d)] for _ in range(d)]
for i in range(d):
  for j in range((h*w)//d):
    if i+1+d*(j+1)>h*w:
      continue
    elif j==0:
      T[i][j]=Dist(i+1,i+1+d)
    else:  
      T[i][j]=T[i][j-1]+Dist(i+1+d*j,i+1+d*(j+1))
q=int(input())
for i in range(q):
  l,r=map(int,input().split())
  x=l%d
  if r==x:
    print(0)
  elif l==x and x!=0:
    print(T[x-1][(r-x)//d-1])
  elif l==x and x==0:
    print(T[x-1][(r-x)//d-2])
  else:
    ll=(l-x)//d-1
    rr=(r-x)//d-1
    if x==0:
      ll-=1
      rr-=1
    print(T[x-1][rr]-T[x-1][ll])
### BUGGY CODE ###

n = int(input())
a = input().split()

b = []

ct = 0
for i in range(n):
    if (ct%2) ==0:
        b .append(a[i])
    else:
        b.insert(0,a[i])
    ct += 1


if((n%2)==0):
    print(" ".join([i for i in b]))
else:
    print(" ".join([i for i in b[::-1]])) 

### FIXED CODE ###

n = int(input())
a = input().split()

b = [0]*n

if (n%2) == 0:
    for i in range(n):
        if(i<(n//2)):
            b[i] = a[n-(2*i)-1]
        else:
            b[i] = a[(i-(n//2))*2]
else:
    for i in range(n):
        if(i<(n//2)):
            b[i] = a[n-(2*i)-1]
        elif i == (n//2):
            b[i]= a[0]
        else:
            b[i] = a[(i-(n//2)-1)*2+1]


print(" ".join([i for i in b]))
### BUGGY CODE ###

import collections

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

S_C=collections.Counter(S).most_common()

keys,values=zip(*S_C)
ans=[]
for i in range(len(values)):
	if values[i]==max(values):
		ans.append(keys[i])

ans=sorted(ans)

for h in range(len(ans)):
	print(ans[h])

### FIXED CODE ###

N=int(input())
Sdict={}

for i in range(N):
	s=input()
	if s in Sdict:
		Sdict[s]+=1
	else:
		Sdict[s]=1

vmax=max(Sdict.values())

#Sdict_sorted=sorted(Sdict.items(), key=lambda x:x[1])
#print(Sdict_sorted)

anskeys = [k for k, v in Sdict.items() if v == vmax]
for ans in sorted(anskeys):
	print(ans)
### BUGGY CODE ###

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

A_arr = sorted(A_arr, reverse=True)
two_arr = []
for i in range(1,31):
    two_arr.append(2**i)

count = 0
while len(A_arr) != 0:
    v_max = A_arr.pop(0)
    v_pair = 2**v_max.bit_length() - v_max
    if v_pair in A_arr:
        A_arr.remove(v_pair)
        count += 1
    else:
        pass

print(count)

### FIXED CODE ###

from collections import Counter
N = int(input())
A_arr = list(map(int, input().split()))

A_arr = sorted(A_arr, reverse=True)
C_arr = Counter(A_arr)

count = 0
for i in range(N):
    v_max = A_arr[i]
    if C_arr[v_max] == 0:
        continue
    C_arr[v_max] -= 1
    v_pair = 2**v_max.bit_length() - v_max
    if C_arr[v_pair] > 0:
        C_arr[v_pair] -= 1
        count += 1
    else:
        pass

print(count)
### BUGGY CODE ###

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

ans = 0
for i in range(N):
    for j in range(i + 1, N):
        ans = (ans + A[i] * A[j]) % (10 ** 9 + 7)
print(ans)


### FIXED CODE ###

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

reversed_cumsum = []
tmp = 0
for i in range(N):
    tmp += A[N - 1 - i]
    reversed_cumsum.append(tmp)
cumsum = reversed_cumsum[::-1]

ans = 0
for i in range(N - 1):
    ans = (ans + A[i] * cumsum[i + 1]) % (10 ** 9 + 7)
print(ans)
### BUGGY CODE ###

n = int(input())

ans = 0

for i in range(1, n):
    ans += i

print(ans)

### FIXED CODE ###

n = int(input())

print(n*(n-1)//2)
### BUGGY CODE ###

import bisect


N,M=map(int,input().split())
la=list(map(int,input().split()))
la.sort()
for i in range(M):
    #la.sort()
    #la[N-1]/=2
    ll=la[N-1]/2
    la.pop()
    #la.insert(nibutan(0,N-2,la,ll),ll)
    bisect.insort_left(la,ll,0,N-1)

ans=0
for i in range(N):
    ans+=int(la[i])
print(ans)


### FIXED CODE ###

import heapq
N,M=map(int,input().split())
la=list(map(lambda x:-int(x),input().split()))
heapq.heapify(la)
#la.sort()
for i in range(M):
    ll=heapq.heappop(la)/2
    heapq.heappush(la,ll)
ans=0
for i in range(N):
    ans+=int(-heapq.heappop(la))
print(ans)
### BUGGY CODE ###

n = int(input())
s = input()

cnt = 0
for i in range(10):
    find = 0
    for j in range(n-2):
        if find == 1:
            break
        if s[j] == str(0):
            for k in range(j+1,n-1):
                if find == 1:
                    break
                if s[k] == str(0):
                    for l in range(k+1,n):
                        if s[l] == str(i):
                            find = 1
                            break
    if find == 1:
        cnt += 1

for i in range(10,100):
    find = 0
    for j in range(n-2):
        if find == 1:
            break
        if s[j] == str(0):
            for k in range(j+1,n-1):
                if find == 1:
                    break
                if s[k] == str(i)[0]:
                    for l in range(k+1,n):
                        if s[l] == str(i)[1]:
                            find = 1
                            break
    if find == 1:
        cnt+=1

for i in range(100,1000):
    find = 0
    for j in range(n-2):
        if find == 1:
            break
        if s[j] == str(i)[0]:
            for k in range(j+1,n-1):
                if find==1:
                    break
                if s[k] == str(i)[1]:
                    for l in range(k+1,n):
                        if s[l] == str(i)[2]:
                            find = 1
                            break
    if find == 1:
        cnt += 1

print(cnt)

### FIXED CODE ###

n = int(input())
s = input()

cnt = 0
for i in range(10):
    s_ = s
    if str(0) in s_:
        s_ = s_[s_.index(str(0))+1:]
        if str(0) in s_:
            s_ = s_[s_.index(str(0))+1:]
            if str(i) in s_:
                cnt += 1

for i in range(10,100):
    s_ = s
    if str(0) in s_:
        s_ = s_[s_.index(str(0))+1:]
        if str(i)[0] in s_:
            s_ = s_[s_.index(str(i)[0])+1:]
            if str(i)[1] in s_:
                cnt += 1

for i in range(100,1000):
    s_ = s
    if str(i)[0] in s_:
        s_ = s_[s_.index(str(i)[0])+1:]
        if str(i)[1] in s_:
            s_ = s_[s_.index(str(i)[1])+1:]
            if str(i)[2] in s_:
                cnt += 1  

print(cnt)
### BUGGY CODE ###


H,W,M=map(int,input().split())
height=[0]*H
width=[0]*W
bomb=[0]*M
bset=set()
for k in range(M):
    bomb[k]=[0]*2
for j in range(M):
    h,w=map(int,input().split())
    bset.add((h-1,w-1))
    bomb[j][0]=h-1
    bomb[j][1]=w-1
    height[h-1]+=1
    width[w-1]+=1
ans=0
#print(bomb)
#print(height)
#print(width)
hmax=max(height)
wmax=max(width)
flag=0
for i in range(H):
    if height[i]==hmax:
        for h in range(W):
            if width[h]==wmax:
                if (i,h) not in bset:
                    flag=1
                    break
if flag==1:
    print(hmax+wmax)
else:
    print(hmax+wmax-1)

### FIXED CODE ###

H,W,M=map(int,input().split())
height=[0]*H
width=[0]*W
#bomb=[0]*M
bset=set()
#for k in range(M):
    #bomb[k]=[0]*2
for j in range(M):
    h,w=map(int,input().split())
    bset.add((h-1,w-1))
    #bomb[j][0]=h-1
    #bomb[j][1]=w-1
    height[h-1]+=1
    width[w-1]+=1
#print(bomb)
#print(height)
#print(width)
hmax=max(height)
wmax=max(width)
hindex=0
windex=0
for i in range(H):
    if height[i]==hmax:
        #print(i)
        hindex+=1
for h in range(W):
    if width[h]==wmax:
        #print(h)
        windex+=1
kouho=hindex*windex
equalbomb=0
for p in bset:
    if height[p[0]]==hmax and width[p[1]]==wmax:
        #print(p)
        equalbomb+=1

if kouho==equalbomb:
    print(hmax+wmax-1)
else:
    print(hmax+wmax)
### BUGGY CODE ###

n = int(input())
S = [input() for _ in range(n)]
SetS = sorted(set(S))
Hit = [0]*n
for i, item in enumerate(SetS):
    Hit[i] = S.count(item)
Ind = [i for i, x in enumerate(Hit) if x == max(Hit)]
for ind in Ind:
    print(SetS[ind])

### FIXED CODE ###

n = int(input())
S = [input() for _ in range(n)]

from collections import Counter

C = Counter(sorted(S))

ans = []
numMax = C.most_common()[0][1]
for key, num in C.most_common():
    if num == numMax:
        ans.append(key)
[print(a) for a in sorted(ans)]
### BUGGY CODE ###

#!/usr/bin/env python3

N = input()
cnt = 0

for n in N:
    cnt += int(N)

if cnt % 9 == 0:
    print('Yes')
else:
    print('No')




### FIXED CODE ###

#!/usr/bin/env python3

N = input()
cnt = 0
for i in range(len(N)):
    cnt += int(N[i]) % 9

if cnt % 9 == 0:
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

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


def dfs(pos, value, weight):
    if pos == n:
        if weight <= W:
            return value
        else:
            return 0
    ret1 = dfs(pos + 1, value + wv[pos][1], weight + wv[pos][0])
    ret2 = dfs(pos + 1, value, weight)

    return max(ret1, ret2)


print(dfs(0, 0, 0))


### FIXED CODE ###

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

inf = 10 ** 10
dp = [[inf] * (10**5+3) for _ in range(n+1)]
dp[0][0] = 0
for i in range(n):
    weight, value = map(int, input().split())
    for j in range(10**5 + 3):
        if j - value >= 0:
            dp[i+1][j] = min(
                dp[i][j - value] + weight,
                dp[i][j]
            )
        else:
            dp[i+1][j] = dp[i][j]
for i in reversed(range(10**5+3)):
    if dp[n][i] <= w:
        print(i)
        break
### BUGGY CODE ###

import numpy as np
S = input()
count = 0
l = [0]*2019
l[0] = 1
l = np.array(l)

for i in range(1,len(S)+1):
    n =(int(S[len(S)-i:])%2019)
    l[n] += 1
    

for j in range(2019):
    if l[j] >= 2:
        count += l[j]*(l[j]-1)//2

print(count)


### FIXED CODE ###

S = input()
count = 0
l = [0]*2019
l[0] = 1
mod = 2019
tmp = 0

for i in range(1,len(S)+1):
    tmp = (tmp + int(S[len(S)-i])*pow(10,i-1,mod))%mod
    l[tmp] += 1
    

for j in range(2019):
    if l[j] >= 2:
        count += l[j]*(l[j]-1)//2

print(count)
### BUGGY CODE ###

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

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


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n = I()
    a = LI()
    for i in range(1,n):
        print(a.count(i))
    print(0)
    return


if __name__ == "__main__":
    solve()

### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

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


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n = I()
    a = LI()
    ca = Counter(a)
    for i in range(1,n):
        print(ca[i])
    print(0)
    return


if __name__ == "__main__":
    solve()