Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
judge = 0
side = []
while judge != 2 and len(A) > 1:
	MAX_A = A[len(A) -1]
	if MAX_A == A[len(A) - 2]:
		side.append(MAX_A)
		judge += 1
		del A[len(A) - 1]
		del A[len(A) - 2]
	else:
		del A[len(A) -1]

print(side[0] * side[1])
		
	

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
judge = 0
side = []
while judge != 2 and len(A) > 1:
	MAX_A = A[len(A) -1]
	if MAX_A == A[len(A) - 2]:
		side.append(MAX_A)
		judge += 1
		del A[len(A) - 2]
		del A[len(A) - 1]
	else:
		del A[len(A) -1]

if judge == 2:
	print(side[0] * side[1])
else:
	print(0)
Buggy python submission (verdict: Runtime Error):
A , op , B = input().split()
if op == "+":
	print(int(A) + int(B))
else:
	print(int(A) - int(B)

Fixed submission:
A , op , B = input().split()
if op == "+":
	print(int(A) + int(B))
else:
	print(int(A) - int(B))

Buggy python submission (verdict: Runtime Error):
A , op , B = map(int,input().split())
if op == "+":
	print(int(A) + int(B))
else:
	print(int(A) - int(B))

Fixed submission:
A , op , B = input().split()
if op == "+":
	print(int(A) + int(B))
else:
	print(int(A) - int(B))
Buggy python submission (verdict: Runtime Error):
N, M , X = list(map(int,input().split()))

c = [[]]*N
a = [[[]]*M]*N

for n in range(N):
    temp = list(map(int,input().split()))
    c[n] = temp[0]
    a[n] = temp[1:N+1]


ans = 10**7

for i in range(2 ** N):
    price = 0
    intelligence = [0 for _ in range(M)]
    for j in range(N):
        if ((i >> j) & 1):
            price += c[j]
            for k in range(M):
                intelligence[k] += a[j][k]
    flag = 1
    for k in range(M):
        if intelligence[k] < X:
            flag = 0
    if flag == 1:
        ans = min(ans,price)

if ans == 10**7:
    print(-1)
else:
    print(ans)


Fixed submission:
N, M , X = list(map(int,input().split()))

c = [[]]*N
a = [[[]]*M]*N

for n in range(N):
    temp = list(map(int,input().split()))
    c[n] = temp[0]
    a[n] = temp[1:M+1]


ans = 10**7

for i in range(2 ** N):
    price = 0
    intelligence = [0 for _ in range(M)]
    for j in range(N):
        if ((i >> j) & 1):
            price += c[j]
            for k in range(M):
                intelligence[k] += a[j][k]
    flag = 1
    for k in range(M):
        if intelligence[k] < X:
            flag = 0
    if flag == 1:
        ans = min(ans,price)

if ans == 10**7:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
H,N = list(map(int,input().split()))

a = [0]*N
b = [0]*N

for i in range(N):
	a[i],b[i] = list(map(int,input().split()))

inf = float("inf")
dp = [inf]*(H+1)
dp[0] = 0
dp[1] = min(b)

for h in range(1,H+1):
	for n in range(N):
		h_temp = h-a[n]
		dp[h] = min(dp[h],dp[h_temp]+b[n])
print(dp[H])

Fixed submission:
H,N = list(map(int,input().split()))

a = [0]*N
b = [0]*N

for i in range(N):
	a[i],b[i] = list(map(int,input().split()))

inf = float("inf")
dp = [inf]*(H+1)
dp[0] = 0
dp[1] = min(b)

for h in range(1,H+1):
	for n in range(N):
		h_temp = h-a[n]
		if h_temp <= 0:
			dp[h] = min(dp[h],b[n])
		else:
			dp[h] = min(dp[h],dp[h_temp]+b[n])
print(dp[H])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = list(map(int,input().split()))

p_temp = float("inf")

ans = N
for i in range(N):
	flag = 0
	for j in range(i):
		if p[j] <= p[i]:
			flag = 1
	ans -= flag
print(ans)

Fixed submission:
N = int(input())
p = list(map(int,input().split()))

p_min = [0]*N

p_min[0] = N+1
for i in range(1,N):
	p_min[i] = min(p[i-1],p_min[i-1])

ans = 0

for i in range(N):
	if p_min[i] >= p[i]:
		ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

c = np.zeros((10,10),dtype = int)

for k in range(1,N+1):
	c[int(str(k)[0])][int(str(k)[-1])] += 1

ans = 0
for i in range(10):
	for j in range(10):
		ans += c[i][j]*c[j][i]
print(ans)

Fixed submission:
import numpy as np
N = int(input())

c = np.zeros((10,10),dtype = int)

for k in range(1,N+1):
	c[int(str(k)[0])][int(str(k)[-1])] += 1

ans = 0
for i in range(10):
	for j in range(10):
		ans += c[i][j]*c[j][i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

c = [[0]*10 for _ in range(10)]

for i in range(10):
	for j in range(10):
		for k in range(1,N+1):
			if int(str(k)[0]) == i and int(str(k)[-1]) == j:
				c[i][j] += 1


ans = 0
for i in range(10):
	for j in range(10):
		ans += c[i][j]*c[j][i]
print(ans)

Fixed submission:
import numpy as np
N = int(input())

c = np.zeros((10,10),dtype = int)

for k in range(1,N+1):
	c[int(str(k)[0])][int(str(k)[-1])] += 1

ans = 0
for i in range(10):
	for j in range(10):
		ans += c[i][j]*c[j][i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import fractions
N = int(input())
a = list(map(int,input().split()))
lcm = a[0]
for i in range(1,N):
	lcm = lcm*a[i]//fractions.gcd(lcm,a[i])

b = [0]*N

ans = 0
for i in range(N):
	ans += lcm/a[i]
	
print(int(ans%(10**9+7)))




Fixed submission:
import fractions
N = int(input())
a = list(map(int,input().split()))
lcm = a[0]
for i in range(1,N):
	lcm = lcm*a[i]//fractions.gcd(lcm,a[i])

b = [0]*N

ans = 0
for i in range(N):
	ans += lcm//a[i]
print(int(ans%(10**9+7)))

Buggy python submission (verdict: Runtime Error):
import fractions
N = int(input())
a = list(map(int,input().split()))
lcm = a[0]
for i in range(1,N):
	lcm = lcm*a[i]//math.fractions(lcm,a[i])

b = [0]*N

ans = 0
for i in range(N):
	ans += lcm/a[i]
	
print(int(ans%(10**9+7)))



Fixed submission:
import fractions
N = int(input())
a = list(map(int,input().split()))
lcm = a[0]
for i in range(1,N):
	lcm = lcm*a[i]//fractions.gcd(lcm,a[i])

b = [0]*N

ans = 0
for i in range(N):
	ans += lcm//a[i]
print(int(ans%(10**9+7)))

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
a = list(map(int,input().split()))
lcm = a[0]
for i in range(1,N):
	lcm = lcm*a[i]//math.gcd(lcm,a[i])

b = [0]*N

ans = 0
for i in range(N):
	ans += lcm/a[i]
	
print(int(ans%(10**9+7)))



Fixed submission:
import fractions
N = int(input())
a = list(map(int,input().split()))
lcm = a[0]
for i in range(1,N):
	lcm = lcm*a[i]//fractions.gcd(lcm,a[i])

b = [0]*N

ans = 0
for i in range(N):
	ans += lcm//a[i]
print(int(ans%(10**9+7)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
h = list(map(int,input().split()))

high = []

for i in range(N-1):
	if h[i] < h[i+1]:
		high.append(i+1)
ans = 0
temp = 0
for i in high:
	ans = max(i-temp-1,ans)
	temp = i
temp = N
ans = max(N-high[-1]-1,ans)
print(ans)

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

high = []

for i in range(N-1):
	if h[i] < h[i+1]:
		high.append(i+1)
ans = 0
temp = 0
if len(high) == 0:
	print(len(h)-1)
	exit()

for i in high:
	ans = max(i-temp-1,ans)
	temp = i
temp = N
ans = max(N-high[-1]-1,ans)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
"""
a = list(range(1,N+1))
b = list(range(2,N+2))
"""
a = []
b = []
for i in range(N-1):
	a.append(i+1)
	b.append(i+2)
a.append(N)
b.append(1)

sum = 0
for i in range(N):
	sum += a[i]%b[i]
print(sum)




Fixed submission:
import numpy as np
N = int(input())
print((N*(N-1))//2)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(range(1,N+1))
b = list(range(2,N+2))
b[N-1] = 1

sum = 0
for i in range(N):
	sum += a[i]%b[i]
print(sum)







Fixed submission:
import numpy as np
N = int(input())
print((N*(N-1))//2)
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = list(map(int,input().split()))
r_max = N//R+1
g_max = N//G+1
b_max = N//B+1
ans = 0
for r in range(r_max):
	g_max = (N-r*R)//G+1
	for g in range(g_max):
		if (N-r*R-g*G)%B == 0 and N-r*R-g*G >= 0:
			ans += 1
print(ans)


Fixed submission:
R,G,B,N = list(map(int,input().split()))
r_max = N//R+1
ans = 0
for r in range(r_max):
	g_max = (N-r*R)//G+1
	for g in range(g_max):
		if (N-r*R-g*G)%B == 0:
			ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0
for m in range(N):
	if N//m == N%m:
		ans += 1

print(ans)

Fixed submission:
import math
N = int(input())
ans = 0
n_max = int(math.sqrt(N))
for n in range(1,n_max+1):
	if N%n == 0:
		a = N//n
		if a+1 < n:
			ans += n-1
		elif n+1 < a:
			ans += a-1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import functools
import fractions

N = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(N):
	a_new = a[0:i]+a[i+1:N]
	gcd = functools.reduce(fractions.gcd,a_new)
	ans = max(ans,gcd)

print(ans)


Fixed submission:
import functools
import fractions


N = int(input())
a = list(map(int,input().split()))
ans = 1
gcd = functools.reduce(fractions.gcd,a)
s_front = [1]*N
s_back = [1]*N
s_front[0] = a[0]
s_back[0] = a[N-1]

for i in range(N):
	if i > 0:
		s_front[i] = fractions.gcd(s_front[i-1],a[i])
		s_back[i] = fractions.gcd(s_back[i-1],a[N-i-1])
for i in range(N):
	if i == 0:
		gcd_new = s_back[N-2]
	elif i == N-1:
		gcd_new = s_front[N-2]
	else:
		gcd_new = fractions.gcd(s_front[i-1],s_back[N-i-2])
	ans = max(ans,gcd_new)
print(ans)

Buggy python submission (verdict: Runtime Error):
import functools
import fraction

N = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(N):
	a_new = a[0:i]+a[i+1:N]
	gcd = functools.reduce(math.gcd,a_new)
	ans = max(ans,gcd)

print(ans)


Fixed submission:
import functools
import fractions


N = int(input())
a = list(map(int,input().split()))
ans = 1
gcd = functools.reduce(fractions.gcd,a)
s_front = [1]*N
s_back = [1]*N
s_front[0] = a[0]
s_back[0] = a[N-1]

for i in range(N):
	if i > 0:
		s_front[i] = fractions.gcd(s_front[i-1],a[i])
		s_back[i] = fractions.gcd(s_back[i-1],a[N-i-1])
for i in range(N):
	if i == 0:
		gcd_new = s_back[N-2]
	elif i == N-1:
		gcd_new = s_front[N-2]
	else:
		gcd_new = fractions.gcd(s_front[i-1],s_back[N-i-2])
	ans = max(ans,gcd_new)
print(ans)

Buggy python submission (verdict: Runtime Error):
import functools
import math

N = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(N):
	a_new = a[0:i]+a[i+1:N]
	gcd = functools.reduce(math.gcd,a_new)
	ans = max(ans,gcd)

print(ans)


Fixed submission:
import functools
import fractions


N = int(input())
a = list(map(int,input().split()))
ans = 1
gcd = functools.reduce(fractions.gcd,a)
s_front = [1]*N
s_back = [1]*N
s_front[0] = a[0]
s_back[0] = a[N-1]

for i in range(N):
	if i > 0:
		s_front[i] = fractions.gcd(s_front[i-1],a[i])
		s_back[i] = fractions.gcd(s_back[i-1],a[N-i-1])
for i in range(N):
	if i == 0:
		gcd_new = s_back[N-2]
	elif i == N-1:
		gcd_new = s_front[N-2]
	else:
		gcd_new = fractions.gcd(s_front[i-1],s_back[N-i-2])
	ans = max(ans,gcd_new)
print(ans)
Buggy python submission (verdict: Runtime Error):
N,K = list(map(int,input().split()))
s = input()

a = []
b = []

index = 0
length = 0
judge = "0"
for i in range(len(s)):
	if s[i] == judge:
		length += 1
	if s[i] != judge:
		if judge == "0":
			b.append(length)
		if judge == "1":
			a.append(length)
		length = 1
		judge = str((int(judge)+1)%2)
if judge == "0":
	b.append(length)
if judge == "1":
	a.append(length)


if len(a) == len(b):
	M = len(a)
	if K >= M:
		print(len(s))
		exit()
	
	ans = 0
	ans_new = 0
	for i in range(K):
		ans += a[i]+b[i]
	ans_max = ans
	for i in range(M-K):
		if i == 0:
			ans_new = ans-b[0]+b[K]+a[K]
		if i != 0:
			ans_new = ans-a[i-1]-b[i]+b[K+i]+a[K+i]
		ans_max = max(ans_max,ans_new)
		ans = ans_new
	print(ans_max)
	exit()
	
if len(a) < len(b):
	M = len(b)
	if K >= M:
		print(len(s))
		exit()
	
	ans = 0
	for i in range(K):
		ans += a[i]+b[i]
	ans_max = ans
	for i in range(M-K+1):
		if i == 0:
			if M-1 <= K:
				ans_new = ans-b[0]+b[K]
			else:
				ans_new = ans-b[0]+b[K]+a[K]
		if i == M-K:
			ans_new = ans-a[M-K-1]-b[M-K]+b[M-1]
		if i != 0 and i != M-K:
			ans_new = ans-a[i-1]-b[i]+b[K+i]+a[K+i]
		
		ans_max = max(ans_max,ans_new)
		ans = ans_new
	print(ans_max)
	exit()



Fixed submission:
N,K = list(map(int,input().split()))
s = input()

a = []
b = []

index = 0
length = 0
judge = "0"
for i in range(len(s)):
	if s[i] == judge:
		length += 1
	if s[i] != judge:
		if judge == "0":
			b.append(length)
		if judge == "1":
			a.append(length)
		length = 1
		judge = str((int(judge)+1)%2)
if judge == "0":
	b.append(length)
	a.append(0)
if judge == "1":
	a.append(length)


M = len(a)
if K >= M:
	print(len(s))
	exit()

ans = 0
ans_new = 0
for i in range(K):
	ans += a[i]+b[i]
ans_max = ans
for i in range(M-K):
	if i == 0:
		ans_new = ans-b[0]+b[K]+a[K]
	if i != 0:
		ans_new = ans-a[i-1]-b[i]+b[K+i]+a[K+i]
	ans_max = max(ans_max,ans_new)
	ans = ans_new
print(ans_max)
Buggy python submission (verdict: Runtime Error):
N,Q = list(map(int,input().split()))
s = input()

t = ["a"]*Q
d = ["b"]*Q
for i in range(Q):
	t[i],d[i] = input().split()
c = [1]*N
flux = [0]*N

for i in range(Q):
	flux = [0]*N
	for j in range(N):
		if s[j] == t[i] and d[i] == "R":
			flux[j] += -c[j]
			if j != N-1:
				flux[j+1] += c[j]
		if s[j] == t[i] and d[i] == "L":
			flux[j] = -c[j]
			if j != 0:
				flux[j-1] += c[j]
	for j in range(N):
		c[j] += flux[j]
	#print(c)
ans = sum(c)
print(ans)


Fixed submission:
a,b,c = list(map(int,input().split()))
if a==b and b == c:
	print("Yes")
	exit()
print("No")
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = [list(map(int,input().split())) for i in range(N)]

A = [x[0] for x in a]
A_sorted = sorted(A)
ans = 0
nokori = M
for c in A_sorted:
	for j in range(N):
		if c == A[j]:
			ans += A[j]*min(a[1][j],nokori)
			nokori -= min(a[1][j],nokori)
		if nokori <= 0:
			print(ans)
			exit()


Fixed submission:
N,M = map(int,input().split())
a = [list(map(int,input().split())) for i in range(N)]
a.sort(key=lambda x:x[0])
ans = 0
nokori = M
for j in range(N):
	ans += a[j][0]*min(a[j][1],nokori)
	nokori -= a[j][1]
	if nokori <= 0:
		print(ans)
		exit()
Buggy python submission (verdict: Time Limit Exceeded):
N,K = list(map(int,input().split()))
h = list(map(int,input().split()))

inf = float("inf")
dp = [inf]*N
dp[0] = 0 #initial situation

for i in range(1,N):
	for k in range(K):
		if i-1-k >= 0:
			dp[i] = min(dp[i],dp[i-1-k] + abs(h[i]-h[i-1-k]))
			
print(dp[N-1])

Fixed submission:
N,K = list(map(int,input().split()))
h = list(map(int,input().split()))

inf = float("inf")
dp = [inf]*N
dp[0] = 0 #initial situation

for i in range(1,N):
	for k in range(K):
		if i-1-k >= 0:
			dp[i] = min(dp[i],dp[i-1-k] + abs(h[i]-h[i-1-k]))
			
print(dp[N-1])

Buggy python submission (verdict: Runtime Error):

inf = float("inf")
dp = [inf]*N
dp[0] = 0 #initial situation

for i in range(1,N):
	for k in range(K):
		if i-1-k >= 0:
			dp[i] = min(dp[i],dp[i-1-k] + abs(h[i]-h[i-1-k]))
			
print(dp[N-1])

Fixed submission:
N,K = list(map(int,input().split()))
h = list(map(int,input().split()))

inf = float("inf")
dp = [inf]*N
dp[0] = 0 #initial situation

for i in range(1,N):
	for k in range(K):
		if i-1-k >= 0:
			dp[i] = min(dp[i],dp[i-1-k] + abs(h[i]-h[i-1-k]))
			
print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())

counter = 0
for number_cake in range(0,N):
	for number_donut in range(0,N):
		if(N == number_cake*4+number_donut*7):
			counter += 1

if(counter > 0):
	print("Yes")
else:
	print("No")


Fixed submission:
N,K = list(map(int,input().split()))

if N % K == 0:
	print("0")
	exit()
print("1")
Buggy python submission (verdict: Runtime Error):
N = int(input())

counter = 0
for number_cake in range(0,N):
	if(((N-number_cake*4) % 7 == 0)&&(N >= number_cake*4)):
		counter += 1

if(counter > 0):
	print("Yes")
else:
	print("No")


Fixed submission:
N = int(input())

counter = 0
for number_cake in range(0,N):
	for number_donut in range(0,N):
		if(N == number_cake*4+number_donut*7):
			counter += 1

if(counter > 0):
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
N = int(print())
A = int(print())

if (N%500) > A:
	 print("No")
else:
	print("Yes")


Fixed submission:
N = int(input())
A = int(input())

if (N%500) > A:
	 print("No")
else:
	print("Yes")
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if (a*b)%2 == 1:
	print("Even")
else:
	print("Odd")


Fixed submission:
list = input().split()
a = int(list[0])
b = int(list[1])

if (a*b)%2 == 0:
	print("Even")
else:
	print("Odd")
Buggy python submission (verdict: Runtime Error):
print("2018"+s[4:])

Fixed submission:
s = input()
print("2018"+s[4::])
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))
A_unique = list(set(A))
N_unique = len(A_unique)

a = [A.count(A_unique[i]) for i in range(N_unique)]
a_sort = sorted(a)

M = N_unique-K
if M <= 0:
	print(0)
	exit()

ans = 0
for i in range(0,M):
	ans += a_sort[i]
print(ans)


Fixed submission:
str = input()
list = list(str)

print(int(list[0])+int(list[1])+int(list[2]))

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))
A_unique = list(set(A))
N_unique = len(A_unique)

a_sort = sorted([A.count(A_unique[i]) for i in range(N_unique))])

M = A_unique-K
if M <= 0:
	print(0)
	exit()

ans = 0
for i in range(0,M):
	ans += a_sort[i]
print(ans)

Fixed submission:
str = input()
list = list(str)

print(int(list[0])+int(list[1])+int(list[2]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
ans = 1

if a[0] < a[1]:
	flag = 1
if a[0] > a[1]:
	flag = -1
if a[0] == a[1]:
	flag = 0


for i in range(2,N):
	if flag == 1 and a[i-1] > a[i]:
		ans += 1
		flag = 0
	elif flag == -1 and a[i-1] < a[i]:
		ans += 1
		flag = 0
	elif flag == 0 and a[i-1] < a[i]:
		flag = 1
	elif flag == 0 and a[i-1] > a[i]:
		flag = -1
	
print(ans)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
ans = 1

if N < 3:
	print(ans)
	exit()

if a[0] < a[1]:
	flag = 1
if a[0] > a[1]:
	flag = -1
if a[0] == a[1]:
	flag = 0


for i in range(2,N):
	if flag == 1 and a[i-1] > a[i]:
		ans += 1
		flag = 0
	elif flag == -1 and a[i-1] < a[i]:
		ans += 1
		flag = 0
	elif flag == 0 and a[i-1] < a[i]:
		flag = 1
	elif flag == 0 and a[i-1] > a[i]:
		flag = -1
	
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K,S = list(map(int,input().split()))

counter = 0

for x in range(0,K+1):
	for y in range(0,K+1):
		for z in range(0,K+1):
			if(S == x+y+z):
				counter += 1

print(counter)

Fixed submission:
K,S = list(map(int,input().split()))

counter = 0

for x in range(0,K+1):
	for y in range(0,K+1):
		if((S-x-y <= K) and (S-x-y >= 0)):
			counter += 1 

print(counter)
Buggy python submission (verdict: Time Limit Exceeded):
#import numpy as np
from sys import stdin
from copy import deepcopy
from functools import reduce
from fractions import gcd
import math
import itertools
from collections import Counter
from itertools import chain  ##list(chain.from_iterable(l)) ##flatten
from heapq import heappush, heappop
import bisect

"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

N = int(input())
S = [input() for _ in range(N)] ## 縦一列


cnt = list(Counter(S).items())
cnt = sorted(cnt, key=lambda x: (-x[1], x[0]))

max_cnt = cnt[0][1]
for i in range(len(cnt)):
  if cnt[i][1] == max_cnt:
    print(cnt[i][0])
  else:
    exit()

Fixed submission:
from collections import Counter
import bisect

N = int(input())
S = [input() for _ in range(N)] ## 縦一列


cnt = list(Counter(S).items())
cnt = sorted(cnt, key=lambda x: (-x[1], x[0]))

max_cnt = cnt[0][1]

lst = [cnt[i][1] for i in range(len(cnt))][::-1]
n_print = len(cnt) - bisect.bisect_left(lst, max_cnt)

for i in range(n_print):
  print(cnt[i][0])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from sys import stdin
from copy import deepcopy
from functools import reduce
from fractions import gcd
import math
import itertools
from collections import Counter
from itertools import chain  ##list(chain.from_iterable(l)) ##flatten
from heapq import heappush, heappop

"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

## 計算量: H*N

H, N = map(int,input().split())
AB = [list(map(int,input().split())) for i in range(N)]

inf = float("inf")
dp = [inf for i in range(H+1)] ## i: 体力
dp[0] = 0

for i in range(1, H+1):
  for j in range(N):
    dp[i] = min(dp[i], dp[max(i - AB[j][0], 0)] + AB[j][1])
    
print(dp[H])

Fixed submission:
#import numpy as np
from sys import stdin
from copy import deepcopy
from functools import reduce
from fractions import gcd
import math
import itertools
from collections import Counter
from itertools import chain  ##list(chain.from_iterable(l)) ##flatten
from heapq import heappush, heappop

"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

## 計算量: H*N

H, N = map(int,input().split())
AB = [list(map(int,input().split())) for i in range(N)]

inf = float("inf")
dp = [inf for i in range(H+1)] ## i: 体力
dp[0] = 0

for i in range(1, H+1):
  for j in range(N):
    dp[i] = min(dp[i], dp[max(i - AB[j][0], 0)] + AB[j][1])
    
print(dp[H])
Buggy python submission (verdict: Runtime Error):
"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

S = input()

if S == 'Sunny':
  ans = 'Cloudy'
elif S == 'Cloudy':
  ans = Rainy
else:
  ans ='Sunny'
  
print(ans)

Fixed submission:
"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

S = input()

if S == 'Sunny':
  ans = 'Cloudy'
elif S == 'Cloudy':
  ans = 'Rainy'
else:
  ans ='Sunny'
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

#N = int(input())
#S = input()

N = int(5e3)
S = 'a' *N

ans = 0
for circ in range(1, N):
  cnt = 0
  solver = [0]
  for i in range(N-circ):
    if S[i] == S[i+circ]:
      cnt += 1
    else:
      solver.append(cnt)
      cnt = 0
  else:
    solver.append(cnt)
  ans = max(ans, min(circ, max(solver)))

print(ans)




"""
ans = 0
for i in range(N-1):
  if i+1+ans >= N:
    break
  lst = [0]
  for j in range(i+1+ans,N):
    cnt = 0
    if S[i] == S[j]:
      cnt += 1
      for k in range(1,min(j-i, N-j)):
        if S[i+k] == S[j+k]:
          cnt += 1
        else:
          break
    lst.append(cnt)
    #print(i, j, cnt)
  ans = max(ans, max(lst))
  
print(ans)
"""

Fixed submission:
"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

N = int(input())
S = input()

#N = int(5e3)
#S = 'a' *N

ans = 0
for circ in range(1, N):
  cnt = 0
  solver = [0]
  for i in range(N-circ):
    if S[i] == S[i+circ]:
      cnt += 1
    else:
      solver.append(cnt)
      cnt = 0
  else:
    solver.append(cnt)
  ans = max(ans, min(circ, max(solver)))

print(ans)




"""
ans = 0
for i in range(N-1):
  if i+1+ans >= N:
    break
  lst = [0]
  for j in range(i+1+ans,N):
    cnt = 0
    if S[i] == S[j]:
      cnt += 1
      for k in range(1,min(j-i, N-j)):
        if S[i+k] == S[j+k]:
          cnt += 1
        else:
          break
    lst.append(cnt)
    #print(i, j, cnt)
  ans = max(ans, max(lst))
  
print(ans)
"""