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

from collections import defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 1)

class UnionFind:
    def __init__(self, size):
        self.parent = list(range(size + 1))

    def is_same_set(self, x: int, y: int) -> bool:
        return self.find_root(x) == self.find_root(y)

    def union_set(self, x: int, y: int):
        x = self.find_root(x)
        y = self.find_root(y)
        if x == y:
            return

        self.parent[x] = y

    def find_root(self, x: int):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find_root(self.parent[x])
            return self.parent[x]


def dfs(n, used, edges, uf: UnionFind):
    used[n] = True
    for a in edges[n]:
        if not used[a]:
            uf.union_set(n, a)
            dfs(a, used, edges, uf)


def main():
    N, K, L = map(int, input().split())
    d1 = defaultdict(list)
    for _ in range(K):
        p, q = map(int, input().split())
        p -= 1
        q -= 1
        d1[p].append(q)
        d1[q].append(p)

    d2 = defaultdict(list)
    for _ in range(L):
        r, s = map(int, input().split())
        r -= 1
        s -= 1
        d2[r].append(s)
        d2[s].append(r)

    uf1 = UnionFind(N)
    used1 = [False] * N
    for n in range(N):
        if not used1[n]:
            dfs(n, used1, d1, uf1)

    uf2 = UnionFind(N)
    used2 = [False] * N
    for n in range(N):
        if not used2[n]:
            dfs(n, used2, d2, uf2)

    used3 = [False] * N
    ans = [0] * N
    for n1 in range(N):
        if used3[n1]:
            continue
        num = 1
        l = [n1]
        for n2 in range(n1 + 1, N):
            if not used3[n2]:
                if uf1.is_same_set(n1, n2) and uf2.is_same_set(n1, n2):
                    used3[n2] = True
                    l.append(n2)
                    num += 1
        for n in l:
            ans[n] = num

    print(" ".join(map(str, ans)))


if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import Counter
import sys

sys.setrecursionlimit(10 ** 5 + 1)


class UnionFind:
    def __init__(self, size):
        self.parent = list(range(size))

    def is_same_set(self, x: int, y: int) -> bool:
        return self.find_root(x) == self.find_root(y)

    def union_set(self, x: int, y: int):
        x = self.find_root(x)
        y = self.find_root(y)
        if x == y:
            return

        self.parent[x] = y

    def find_root(self, x: int):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find_root(self.parent[x])
            return self.parent[x]


def main():
    N, K, L = map(int, input().split())
    uf1 = UnionFind(N)
    for _ in range(K):
        p, q = map(int, input().split())
        p -= 1
        q -= 1
        uf1.union_set(p, q)

    uf2 = UnionFind(N)
    for _ in range(L):
        r, s = map(int, input().split())
        r -= 1
        s -= 1
        uf2.union_set(r, s)

    groups = [(uf1.find_root(i), uf2.find_root(i)) for i in range(N)]
    c = Counter(groups)

    print(*(c[g] for g in groups))


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

n = int(input())
*a, = map(int, input().split())

a.insert(0, 0)
a.append(0)

d = [0]*(len(a)-1)
for i in range(len(a)-1):
    d[i] = abs(a[i]-a[i+1])

for i in range(len(d)-1):
    print(sum(d[:i]) + sum(d[i+2:]) + abs(a[i] - a[i+2]))


### FIXED CODE ###

n = int(input())
*a, = map(int, input().split())

a.insert(0, 0)
a.append(0)

s = 0
for i in range(len(a)-1):
    s += abs(a[i]-a[i+1])

for i in range(1, len(a)-1):
    print(s + abs(a[i-1]-a[i+1]) - (abs(a[i-1]-a[i]) + abs(a[i]-a[i+1])))
### BUGGY CODE ###

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

ans = "IMPOSSIBLE"

con = 0

for i in range(M):
  if ships[i][0] == 1:
    con += 1

for i in range(0,min(M,con + 1)):
  if ships[i][0] == 1:
    ship = ships[i][1]
    for j in range(con,M):
      if ships[j][0] == ship and ships[j][1] == N:
        ans = "POSSIBLE"
        break
    else:
      continue
    break
      
print(ans)

### FIXED CODE ###

def main():
  N,M = map(int,input().split())
  ships = [list(map(int,input().split())) for i in range(M)]
  start, goal = set(), set()
  for i in range(M):
    if ships[i][0] == 1:
      start.add(ships[i][1])
    if ships[i][1] == N:
      goal.add(ships[i][0])
  flg = start & goal
  print("POSSIBLE" if flg else "IMPOSSIBLE")
 
main()
### BUGGY CODE ###

import math
n=int(input())

while True:
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            break
    n += 1

    
print(n)

### FIXED CODE ###

import math
n=int(input())

def prime(n):
    if n <= 1:
        return False
    
    for k in range(2, int(math.sqrt(n))+1):
        if n%k ==0:
            return False
    return True
    
while not(prime(n)):
    n += 1

    
print(n)
### BUGGY CODE ###

import sys
a,b = map(int,input().split())
if(a%b==0):
    print(-1)
    sys.exit(0)
for i in range(10**18):
    if(i%a==0 and i%b):
        print(i)
        sys.exit(0)
print(-1)

### FIXED CODE ###

import sys
a,b = map(int,input().split())
if(a%b==0):
    print(-1)
else:
    print(a)
### BUGGY CODE ###

from math import sqrt

x = int(input())
sqrt_x = int(x)

ans = 1

for b in range(1, sqrt_x):
  
  for p in range(2, sqrt_x+1):
  
    exp = (b)**(p)

    if exp<=x and ans<=exp:
      ans = exp

print(ans)

### FIXED CODE ###

X = int(input())

score =0
half_x = round(X/2)

answer = 0

if X < 3:
    print(1)

elif X <= 8:
    print(2)

else:
    while 1 < half_x:
        half_x -= 1
        
        for p in range(2, 10):
            
            score = pow(half_x,p)
            if score > X:
                continue
        
            if answer < score:
                answer = score
                
    print(answer)
### BUGGY CODE ###

#coding: UTF-8
#@document_it
def document_it(func):
  def new_function(*args,**kwargs):
    print('Running function:', func.__name__)
    print('Positional arguments:', args)
    print('Kewword arguments:', kwargs)
    result = func(*args,**kwargs)
    print('Result:', result)
    return result
  return new_function

#@document_it
def binsearch(v,list,length=None,offset=0):
    if list == []:
        return -1
    if length == None:
        length = len(list)
    w = length//2
    if v == list[w]:
        return w + offset
    elif v < list[w]:
        return binsearch(v,list[0:w],offset=offset)
    else:
        return binsearch(v,list[w+1:],offset=w+1+offset)

n = int(input())
S = list(map(int,input().split()))
q = int(input())
T = list(map(int,input().split()))
ans = 0

for t in T:
  if binsearch(t,S,n) != -1:
    ans += 1

print(ans)
    
    
  


### FIXED CODE ###

#coding: UTF-8
#@document_it

def document_it(func):
  def new_function(*args,**kwargs):
    print('Running function:', func.__name__)
    print('Positional arguments:', args)
    print('Kewword arguments:', kwargs)
    result = func(*args,**kwargs)
    print('Result:', result)
    return result
  return new_function

#@document_it
def bsearch(v,list,l=None):
  if l == 0 or list == []:
    return False
  if l==None:
    l = len(list)
  
  import math
  T = math.ceil(math.log2(l))
  t = 0
  wid = l
  offset = 0
  while t <= T:
    if wid == 0:
        return False
    pos = wid//2 + offset
    w = list[pos]
    if wid == 1:
        if v == w:
            return True
        else:
            return False
    else:
        if v == w:
            return True
        elif v < w:
            wid = wid//2
        else:
            wid = wid//2 - 1 + wid%2
            offset = pos + 1
    t+=1



def exe():
    n = int(input())
    S = list(map(int,input().split()))
    q = int(input())
    T = map(int,input().split())
    ans = 0

    for t in T:
        if bsearch(t,S,n):
            ans += 1

    print(ans)

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

import bisect

n, m = map(int, input().split())
lst = []
for i in range(n):
    a, b = map(int, input().split())
    lst.append([a, b])

lst.sort(key=lambda x:(x[1]), reverse=True)
lst.sort(key=lambda x:(x[0]), reverse=False)

# print(lst)

ans = 0
ind = 0
kouho = []
for i in range(1, m+1):
    tugi = True
    while tugi:
        if ind >= n:
            break
        if lst[ind][0] == i:
            bisect.insort(kouho, lst[ind][1])
            ind += 1
        else:
            tugi = False
    if kouho != []:
        ans += kouho.pop()

print(ans)

### FIXED CODE ###

import heapq

n, m = map(int, input().split())
lst = []
for i in range(n):
    a, b = map(int, input().split())
    lst.append([a, b])

lst.sort(key=lambda x:(x[1]), reverse=True)
lst.sort(key=lambda x:(x[0]), reverse=False)

ans = 0
ind = 0
kouho = []
for i in range(1, m+1):
    tugi = True
    while tugi:
        if ind >= n:
            break
        if lst[ind][0] == i:
            heapq.heappush(kouho, -lst[ind][1])
            ind += 1
        else:
            tugi = False
    try:
        ans += heapq.heappop(kouho) * (-1)
    except:
        IndexError

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

def mpow(a,b,m):
    ans=1
    while b >0 :
        if b&1:
            ans = (ans*a)%m
        a=(a*a)%m
        b=b>>1

    return ans

def calcmod(X,m,N):
    mod=0
    for i in range(N):
        if X&(1<<i) > 0:
            mod += mpow(2,i,m)
            mod%=m
    return mod

def popcount(m):
    return bin(m).count("1")


def findsteps(mm):
    cnt=0
    while mm !=0:
        cnt+=1
        mm=mm%popcount(mm)
    return cnt
N=int(input())
X=int(input(),2)

##we need to find X%(m-1) and X%(m+1)
m=popcount(X)
m1=m+1
m2=m-1
firstmod=calcmod(X,m1,N)
if m2 !=0:
    secondmod=calcmod(X,m2,N)
fans=[0 for i in range(N)]
k=0
for i in range(N-1,-1,-1):
    if X & (1<<i) >0:
        ##the bit was set
        ##we need to find X%(m-1) - (2^i)%(m-1)
        if m2 == 0:
            ans=0
        else:
            mm=secondmod - mpow(2,i,m2)
            if mm < 0:
                mm+=m2
            mm=mm%m2
            ans=1+findsteps(mm)
    else:
        mm = firstmod + mpow(2,i,m1)
        mm=mm%m1
        ans=1+findsteps(mm)
    fans[k] = ans
    k+=1
        ##the bit was not set
for i in fans:
    print(i)

### FIXED CODE ###

def mpow(a,b,m):
    ans=1
    while b >0 :
        if b&1:
            ans = (ans*a)%m
        a=(a*a)%m
        b=b>>1

    return ans

def calcmod(X,m,N):
    mod=0
    X=X[::-1]
    # print(X)
    for i in range(N):
        if X[i] == '1':
        # if X & (1<<i) >0:
            mod += mpow(2,i,m)
            mod%=m
    return mod

def popcount(m):
    return bin(m).count("1")


def findsteps(mm):
    cnt=0
    while mm !=0:
        cnt+=1
        mm=mm%popcount(mm)
    return cnt
N=int(input())
x=input()
X=int(x,2)

##we need to find X%(m-1) and X%(m+1)
m=popcount(X)
m1=m+1
m2=m-1
firstmod=calcmod(x,m1,N)
if m2 !=0:
    secondmod=calcmod(x,m2,N)
fans=[0 for i in range(N)]
k=0
for i in range(N-1,-1,-1):
    if X & (1<<i) >0:
        ##the bit was set
        ##we need to find X%(m-1) - (2^i)%(m-1)
        if m2 == 0:
            ans=0
        else:
            mm=secondmod - mpow(2,i,m2)
            if mm < 0:
                mm+=m2
            mm=mm%m2
            ans=1+findsteps(mm)
    else:
        mm = firstmod + mpow(2,i,m1)
        mm=mm%m1
        ans=1+findsteps(mm)
    fans[k] = ans
    k+=1
        ##the bit was not set
for i in fans:
    print(i)
### BUGGY CODE ###

S = input().strip()
A = [0 for _ in range(len(S))]
A[-1] = int(S[-1])%3
for i in range(2,len(S)+1):
    A[-i] = (A[-i+1]+int(S[-i]))%3
B = [0 for _ in range(len(S))]
B[-1] = int(S[-1])%673
for i in range(2,len(S)+1):
    B[-i] = (int(S[-i])*10**(i-1)+B[-i+1])%673
C = {}
for i in range(len(S)):
    a = A[i]
    b = B[i]
    if (a,b) not in C:
        C[(a,b)] = 0
    C[(a,b)] += 1
if (0,0) in C:
    C[(0,0)] += 1
cnt = 0
for c in C:
    n = C[c]
    cnt += (n*(n-1))//2
print(cnt)

### FIXED CODE ###

S = input().strip()
A = [0 for _ in range(len(S))]
A[-1] = int(S[-1])%3
for i in range(2,len(S)+1):
    A[-i] = (A[-i+1]+int(S[-i]))%3
B = [0 for _ in range(len(S))]
B[-1] = int(S[-1])%673
a = 1
for i in range(2,len(S)+1):
    a = (a*10)%673
    B[-i] = (int(S[-i])*a+B[-i+1])%673
C = {}
for i in range(len(S)):
    a = A[i]
    b = B[i]
    if (a,b) not in C:
        C[(a,b)] = 0
    C[(a,b)] += 1
if (0,0) in C:
    C[(0,0)] += 1
cnt = 0
for c in C:
    n = C[c]
    cnt += (n*(n-1))//2
print(cnt)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
"""
C - K-th Substring
https://beta.atcoder.jp/contests/abc097/tasks/arc097_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(s, K):
    l = len(s)
    substrings = []

    for i in range(l):
        for j in range(l+1):
            t = s[i:j]
            if len(t) and t not in substrings:
                substrings.append(t)
                substrings.sort()
                if len(substrings) > 5 and substrings[-1] == t:
                    substrings.pop()
                    break
    return substrings[K - 1]


def main(args):
    s = input().strip()
    K = int(input())
    ans = solve(s, K)
    print(ans)

if __name__ == '__main__':
    main(sys.argv[1:])


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
C - K-th Substring
https://beta.atcoder.jp/contests/abc097/tasks/arc097_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(s, K):
    l = len(s)
    substrings = set()
    for i in range(l):
        for j in range(i+K+1):
            t = s[i:j]
            if len(t):
                substrings.add(t)
    ans = list(substrings)
    ans.sort()
    return ans[K - 1]


def main(args):
    s = input().strip()
    K = int(input())
    ans = solve(s, K)
    print(ans)

if __name__ == '__main__':
    main(sys.argv[1:])
### BUGGY CODE ###

import math
N, M, V, P = map(int, input().split())
A_ = list(map(int, input().split()))
A = sorted(A_)
temp = 0
for i in range(N):
  points = V - P - i
  if points < 0:
    points = 0
  requires = 0
  for j in range(i+1, N-P):
    requires += A[N-P] - A[j]
  kabe = N - P - i
  if kabe == 0:
    temp = i
    break
  else:
    wall = points * M - requires
    if wall < 0:
      wall = 0
    wall_2 = math.ceil(wall / kabe)
    wall_3 = A[N-P] + wall_2
    i_points = A[i] + M
    if i_points >= wall_3:
      temp = i
      break
print(N - temp)

### FIXED CODE ###

import math
N, M, V, P = map(int, input().split())
A_ = list(map(int, input().split()))
A = sorted(A_)
temp = 0
requires = 0
for i in range(N-P):
  requires += A[N-P] - A[i]
for i in range(N):
  points = V - P - i
  if points < 0:
    points = 0
  requires -= A[N-P] - A[i]
  kabe = N - P - i
  if kabe == 0:
    temp = i
    break
  else:
    wall = points * M - requires
    if wall < 0:
      wall = 0
    wall_2 = math.ceil(wall / kabe)
    wall_3 = A[N-P] + wall_2
    i_points = A[i] + M
    if i_points >= wall_3:
      temp = i
      break
print(N - temp)
### BUGGY CODE ###

# coding: utf-8
from scipy.sparse.csgraph import floyd_warshall
from scipy.sparse import lil_matrix
import numpy

N,M,L=map(int, raw_input().split())
RG=lil_matrix((N,N))

for i in range(M):
    f,t,c = map(int, raw_input().split())
    RG[(f-1,t-1)] = c
    RG[(t-1,f-1)] = c

Rd = floyd_warshall(RG.tocsr())

vf = numpy.vectorize(lambda x: 1.0 if x <= L else float('inf'))

Fd = floyd_warshall(vf(Rd), directed=False)

Q=int(raw_input())
for i in range(Q):
    s, t = map(int, raw_input().split())
    v = Fd[s-1][t-1]
    if s == t:
        print (str(0))
    elif v == float('inf'):
        print (str(-1))
    else:
        print (str(int(v-1)))


### FIXED CODE ###

# coding: utf-8
from scipy.sparse.csgraph import floyd_warshall

N,M,L=map(int, input().split())
RG=[[0 for i in range(N)] for j in range(N)]

for i in range(M):
    f,t,c = map(int, input().split())
    if c <= L:
        RG[f-1][t-1] = c
        RG[t-1][f-1] = c

Rd = floyd_warshall(RG, directed=False)

FG=[[0 for i in range(N)] for j in range(N)]
for i in range(N):
    for j in range(i+1, N):
        if Rd[i][j] <= L:
            FG[i][j] = 1
            FG[j][i] = 1

Fd = floyd_warshall(FG, directed=False)

Q=int(input())
for i in range(Q):
    s, t = map(int, input().split())
    v = Fd[s-1][t-1]
    if s == t:
        print (str(0))
    if v == float('inf'):
        print (str(-1))
    else:
        print (str(int(v-1)))
### BUGGY CODE ###

import math

MOD = 10**9+7


def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0


def modinv(a):
    g, x, y = xgcd(a, MOD)
    return x % MOD


fact = [1] * 200100
for i in range(1, 100100):
    fact[i] = fact[i-1] * i % MOD


def comb(n, r):
    if n < r or r < 0:
        return 0
    else:
        return fact[n] * modinv(fact[n - r]) * modinv(fact[r]) % MOD


n = int(input())
a = list(map(int, input().split()))
x = sum(a) - n*(n+1)//2

l = 0
while a[l] != x:
    l += 1
r = 0
while a[n - r] != x:
    r += 1
c = n + 1 - l - r - 2

for k in range(1, n + 2):
    ans = comb(n+1, k) - comb(l + r, k - 1)
    if ans < 0:
        ans += MOD
    print(ans)


### FIXED CODE ###

import math

MOD = 10**9+7


def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0


def modinv(a):
    g, x, y = xgcd(a, MOD)
    return x


fact = [1] * 100100
for i in range(1, 100100):
    fact[i] = fact[i-1] * i % MOD


def comb(n, r):
    if n < r or r < 0:
        return 0
    else:
        return fact[n] * modinv(fact[n - r]) * modinv(fact[r]) % MOD


n = int(input())
a = list(map(int, input().split()))
x = sum(a) - n*(n+1)//2

l = 0
while a[l] != x:
    l += 1
r = 0
while a[n - r] != x:
    r += 1
c = n + 1 - l - r - 2

for k in range(1, n + 2):
    ans = comb(n+1, k) - comb(l + r, k - 1)
    if ans < 0:
        ans += MOD
    print(ans)
### BUGGY CODE ###

def make_divisors(n):
    i = 1
    flg = True
    while i*i <= n:
        if n % i == 0:
            if i in s and i != n:
                flg = False
                break
            ii = n//i
            if i != ii:
                if ii in s and ii != n:
                    flg = False
                    break
        i += 1
    return flg

def main():
    cnt = 0
    from collections import Counter
    c = Counter(a)
    for i in range(n):
        if c[a[i]] > 1:
            continue
        if make_divisors(a[i]):
            cnt += 1
    print(cnt)

if __name__ == '__main__':
    n = int(input())
    a = list(map(int,input().split()))
    s = set(a)
    main()

### FIXED CODE ###

def main():
    n = int(input())
    a = list(map(int,input().split()))
    ans = set(a)
    ma = max(a)
    from collections import Counter
    c = Counter(a)
    for i in range(n):
        t = a[i]
        if c[t] > 1 and t in ans:
            ans.remove(t)
            continue
        j = 2
        tmp = t*j
        while tmp <= ma:
            if tmp in ans:
                ans.remove(tmp)
            j += 1
            tmp = t*j
    print(len(ans))

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

# たぶんTLE
N = int(input())
S = tuple(''.join(sorted(list(input()))) for i in range(N))
ans = 0
for i in list(set(S)):
    m = S.count(i)
    ans += m*(m-1)//2
print(ans)  

### FIXED CODE ###

N = int(input())
S = sorted(''.join(sorted(list(input()))) for i in range(N))
# N(10+log_2(10)+10)
ans = 0
sep = []
for i in range(N-1): # N*4
    if  S[i] != S[i+1]:
        sep.append(i+1)
sep.append(N)
# print(sep)
count = []
prev = 0
for i in sep: # len(set(N))*2 <= N*2
    count.append(i-prev)
    prev = i
# print(count)
for i in count: # N*2 (similarly)
    ans += i*(i-1)//2
print(ans)
### BUGGY CODE ###

from fractions import gcd
from functools import reduce
n = int(input())
L = list(map(int,input().split()))
def GCD1(a,b):
    return gcd(a,b)
def GCD2(L):
    return reduce(GCD1,L)

liL = [0]*(n)
liR = [0]*(n)
for i in range(1,n+1):
    if len(L[:i-1]) == 0:
        liL[i-1] = 0
        liR[i-1] = (GCD2(L[i:]))
    elif len(L[i:]) == 0:
        liR[i-1] = 0
        liL[i-1] = (GCD2(L[:i-1]))
    else:
        liL[i-1] = (GCD2(L[:i-1]))
        liR[i-1] = (GCD2(L[i:]))
    #print(L[:i-1],L[i:])
    #print(liL,liR)
#print(liL,liR)
ans = 0
for a,b in zip(liL,liR):
    ans = max(ans,GCD1(a,b))
print(ans)

### FIXED CODE ###

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

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

l = [0]*(n+1)
r = [0]*(n+1)
for i in range(n):
    l[i+1] = gcd(l[i],L1[i])
    r[n-(i+1)] = gcd(r[n-i],L1[n-(i+1)])

ans = 0
for i in range(n):
    ans = max(ans,gcd(l[i],r[i+1]))
print(ans)
### BUGGY CODE ###

a, b, k = map(int, input().split())

for i in range(k):
  
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
  else:
    pass
  
print(a, b)

### FIXED CODE ###

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

if 0 <= K < A:
    A -= K
elif A <= K <= A + B:
    B -= (K - A)
    A = 0
else:
    A = 0
    B = 0

print(A, B)
### BUGGY CODE ###

import sys
import collections
input = lambda: sys.stdin.readline().rstrip()
 
def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    d = sorted([k for k, v in cnt.items() if v == max(cnt.values())])
    for i in d:
        print(i)    
 
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import collections
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    s = [input() for _ in range(n)]
    cnt = collections.Counter(s)
    values, counts = zip(*cnt.most_common())
    d = sorted(values[:counts.count(counts[0])])
    print(*d, sep='\n')

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

n = int(input())
table = [0] * (n + 1)
ans = 0
for i in range(1, n + 1):
    # こいつが地獄のように遅い
    # for v in tes.values():
    #     tmp *= (v + 1)
    # print(i, tmp)
    # 1からnまでの約数の個数を数えるズバリのやつがあるらしい エラトステネスを使ってるらしい
    # http://sucrose.hatenablog.com/entry/2016/11/06/234635
    for j in range(i, n + 1, i):
        table[j] += 1
for i in range(1, n + 1):
    ans += i * table[i]
print(ans)


### FIXED CODE ###

n = int(input())
table = [0] * (n + 1)
ans = 0
for i in range(1, n + 1):
    # こいつが地獄のように遅い
    # for v in tes.values():
    #     tmp *= (v + 1)
    # print(i, tmp)
    # 1からnまでの約数の個数を数えるズバリのやつがあるらしい エラトステネスを使ってるらしい
    # http://sucrose.hatenablog.com/entry/2016/11/06/234635
    for j in range(i, n + 1, i):
        table[j] += 1
for i in range(1, n + 1):
    ans += i * table[i]
print(ans)
### BUGGY CODE ###

s = input()
n = len(s)
ans = 0
for i in range(len(s) - 4):
  for j in range(i + 4, len(s) + 1):
    if int(s[i : j]) % 2019 == 0:
      ans += 1
print(ans)

### FIXED CODE ###

s = input()[::-1]
current = 0
a = [0] * 2019
a[0] = 1
digit = 1
for i in s:
  current += int(i) * digit
  digit *= 10
  digit %= 2019
  current %= 2019
  a[current] += 1
ans = 0
for i in a:
  ans += i * (i - 1) // 2
print(ans)
### BUGGY CODE ###

import collections
S=input()
l=len(S)
T=0
A=[0]
for i in range(l):
    T+=int(S[l-i-1])*(10**i)
    A.append(T%2019)
c=collections.Counter(A)
C=c.values()
ccc=map(lambda x:x*(x-1)//2,C)
print(sum(ccc))
















### FIXED CODE ###

s = input()[::-1] # 入力文字列を逆順でsに格納

counts = [0] * 2019
counts[0] = 1

num, d = 0, 1

for char in s:
    num += int(char) * d
    num %= 2019
    d *= 10
    d %= 2019
    counts[num] += 1

ans = 0
for cnt in counts:
    ans += cnt * (cnt - 1) // 2

print(ans) # 答えの出力
### BUGGY CODE ###

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

for i in range(Q):
  for j in range(N):
    if j == A[i]-1:
      start[j] += 0
    else:
      start[j] -= 1
        
for i in range(N):
  if start[i] > 0:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

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

start = [K - Q] * N

for i in range(Q):
  a = int(input())
  start[a-1] += 1
     
for i in range(N):
  if start[i] > 0:
    print('Yes')
  else:
    print('No')