Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
numMultiples=0
S=input()
N=len(S)
seenRemainders=[set()]*(N+1)
for i in range(N):
    remainder = 0
    prefixesFound = 0
    for j in range(i,N):
        remainder = (10 * remainder + int (S[j]) ) % 2019
        if remainder in seenRemainders[j]==True:
            break
        seenRemainders[j].add(remainder)
        if remainder == 0:
            prefixesFound+=1
    numMultiples += prefixesFound * (prefixesFound + 1) / 2
print(int(numMultiples))


Fixed submission:
S=input()[::-1]
l=len(S)
t=0
p=0
 
ss=[0]*2019
ss[0]=1
d=1
for i in S:
    p=(p+int(i)*d)%2019
    d*=10
    d%=2019
    ss[p]+=1
 
for c in ss:
    t+=c*(c-1)//2
print(t)

Buggy python submission (verdict: Time Limit Exceeded):
numMultiples=0
S=input()
N=len(S)
seenRemainders=[set()]*(N+1)
for i in range(N):
    remainder = 0
    prefixesFound = 0
    for j in range(i,N):
        remainder = (10 * remainder + int (S[j]) ) % 2019
        if remainder in seenRemainders[j]:
            break
            seenRemainders[j].add(remainder)
        if remainder == 0:
            prefixesFound+=1
    numMultiples += prefixesFound * (prefixesFound + 1) / 2
print(int(numMultiples))


Fixed submission:
S=input()[::-1]
l=len(S)
t=0
p=0
 
ss=[0]*2019
ss[0]=1
d=1
for i in S:
    p=(p+int(i)*d)%2019
    d*=10
    d%=2019
    ss[p]+=1
 
for c in ss:
    t+=c*(c-1)//2
print(t)

Buggy python submission (verdict: Time Limit Exceeded):
numMultiples=0
S=input()
N=len(S)
seenRemainders=[set()]*(N+1)
for i in range(N):
    remainder = 0
    prefixesFound = 0
    for j in range(i,N):
        remainder = (10 * remainder + int (S[j]) ) % 2019
        # if remainder in seenRemainders[j]:
        #     break
        seenRemainders[j].add(remainder)
        if remainder == 0:
            prefixesFound+=1
    numMultiples += prefixesFound * (prefixesFound + 1) / 2
print(int(numMultiples))

Fixed submission:
S=input()[::-1]
l=len(S)
t=0
p=0
 
ss=[0]*2019
ss[0]=1
d=1
for i in S:
    p=(p+int(i)*d)%2019
    d*=10
    d%=2019
    ss[p]+=1
 
for c in ss:
    t+=c*(c-1)//2
print(t)

Buggy python submission (verdict: Runtime Error):
numMultiples=0
S=input()
N=len(S)
seenRemainders=[set()]*(100000)
for i in range(N):
    remainder = 0
    prefixesFound = 0
    for j in range(i,N):
        remainder = (10 * remainder + int (S[j]) ) % 2019
        # if remainder in seenRemainders[j]:
        #     break
        seenRemainders[j].add(remainder)
        if remainder == 0:
            prefixesFound+=1
    numMultiples += prefixesFound * (prefixesFound + 1) / 2
print(int(numMultiples))

Fixed submission:
S=input()[::-1]
l=len(S)
t=0
p=0
 
ss=[0]*2019
ss[0]=1
d=1
for i in S:
    p=(p+int(i)*d)%2019
    d*=10
    d%=2019
    ss[p]+=1
 
for c in ss:
    t+=c*(c-1)//2
print(t)
Buggy python submission (verdict: Runtime Error):
N = int(input())



for n in range(1,N+1):
    if n < 6:
        print(0)
    else:
        M =int((n-2)**0.5)
        count = 0
        for x in range(1,M+1):
            #P=x**2+y**2+z**2+x*y+y*z+z*x
            for y in range(1,M+1):
                #Q=x**2+y**2+z**2+x*y+y*z+z*x
                for z in range(1,M+1):
                    #R = x**2+y**2+z**2+x*y+y*z+z*x
                    if x**2+y**2+z**2+x*y+y*z+z*x == n:
                        count = count + 1
                    else:
                        pass
        print(count)



Fixed submission:
li = list(map(int, input().split())) 
L = li[0]
R = li[1]
d = li[2]

#print(L)
#print(R)
#print(d)

count = 0

for X in range (L,R+1):
 if X % d == 0:
  count = count + 1
 else:
  pass

print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())


for n in range(1,N+1):
    if n < 3:
        print(0)
    else:
        M =int((n-2)**0.5)
        count = 0
        for x in range(1,M+1):
            #P=x**2+y**2+z**2+x*y+y*z+z*x
            for y in range(1,M+1):
                #Q=x**2+y**2+z**2+x*y+y*z+z*x
                for z in range(1,M+1):
                    #R = x**2+y**2+z**2+x*y+y*z+z*x
                    if x**2+y**2+z**2+x*y+y*z+z*x == n:
                        count = count + 1
                    else:
                        pass
        print(count)



Fixed submission:
li = list(map(int, input().split())) 
L = li[0]
R = li[1]
d = li[2]

#print(L)
#print(R)
#print(d)

count = 0

for X in range (L,R+1):
 if X % d == 0:
  count = count + 1
 else:
  pass

print(count)
Buggy python submission (verdict: Runtime Error):
a = input()
print (int(a+a^2+a^3))

Fixed submission:
a = int(input())
print (int(a+a**2+a**3))
Buggy python submission (verdict: Runtime Error):
import numpy as np
def getNearestValue(Q, num):
    idx = np.abs(np.asarray(Q) - num).argmin()
    return Q[idx]

XN = list(map(int,input().split()))
X = XN[0]
N = XN[1]
if N == 0:
    print(X)
else:
    P = list(map(int,input().split()))
    Q = list(range(1, 101, 1))
    for i in range(0,N):
        Q.remove(P[i])
    print(getNearestValue(Q,X))


Fixed submission:
import numpy as np
def getNearestValue(Q, num):
    idx = np.abs(np.asarray(Q) - num).argmin()
    return Q[idx]

XN = list(map(int,input().split()))
X = XN[0]
N = XN[1]
if N == 0:
    print(X)
else:
    P = list(map(int,input().split()))
    Q = list(range(-100,200,1))
    for i in range(0,N):
        Q.remove(P[i])
    print(getNearestValue(Q,X))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))

#print(a)

ans = int(a[0])
for i in range(1,N):
    if ans > 10**18:
        break
    else:
        ans = ans * int(a[i])
if 0 in a:
    print(0)
elif:if ans > 10**18:
    print(-1)
else:
    print(ans)

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

#print(a)

ans = int(a[0])
for i in range(1,N):
    if ans > 10**18:
        break
    else:
        ans = ans * int(a[i])
if 0 in a:
    print(0)
elif ans > 10**18:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int,input().split()))

#print(a)

ans = int(a[0])
for i in range(1,N):
    ans = ans * int(a[i])

if ans > 10**18:
    print(-1)
else:
    print(ans)


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

#print(a)

ans = int(a[0])
for i in range(1,N):
    if ans > 10**18:
        break
    else:
        ans = ans * int(a[i])
if 0 in a:
    print(0)
elif ans > 10**18:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
import math
L = list(map(int,input().split()))
a = L[0]
b = L[1]
H = L[2]
M = L[3]

#angleshort = 360*(60*H+M)/720
#anglelong = 360*M/60

print(angleshort)
print(anglelong)
theta = math.radians((anglelong-angleshort))
ans = (a*a+b*b-2*a*b* math.cos(theta))**0.5
print(ans)

Fixed submission:
import math
L = list(map(int,input().split()))
a = L[0]
b = L[1]
H = L[2]
M = L[3]

angleshort = 360*(60*H+M)/720
anglelong = 360*M/60

#print(angleshort)
#print(anglelong)
theta = math.radians((anglelong-angleshort))
ans = (a*a+b*b-2*a*b* math.cos(theta))**0.5
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
if n[-1] == 's':
    n+='es'
else:
    n+='s'
return n


Fixed submission:
n = input()
if n[-1] == 's':
    n+='es'
else:
    n+='s'
print(n)

Buggy python submission (verdict: Runtime Error):
s = int(input())
if s[-1] != 's':
  s += 's'
else:
  s += 'es'
print(s)

Fixed submission:
s = input()

if s[-1] != 's':

  s += 's'

else:

  s += 'es'

print(s)
Buggy python submission (verdict: Runtime Error):
if x == 0:
  x = 1
else:
  x = 0
print(x)

Fixed submission:
x = int(input())
if x == 0:
  x = 1
elif x == 1:
  x = 0
print(x)

Buggy python submission (verdict: Runtime Error):
if x = 0:
  x = 1
else
  x = 0
return x

Fixed submission:
x = int(input())
if x == 0:
  x = 1
elif x == 1:
  x = 0
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
X, K, D = map(int, input().split())


count = 0
while count < K:
    if X >= 0:
        X -= D
        count += 1
    else:
        X += D
        count += 1
print(abs(X))

Fixed submission:
X, K, D = map(int, input().split())

if abs(X) <= K * D:
    X2 = abs(X) % D
    K2 =  K - abs(X)//D
    if K2 % 2 == 0:
        print(abs(X2))
    else:
        print(min(abs(X2+D), abs(X2-D)))
else:
    print(abs(abs(X)-K*D))
Buggy python submission (verdict: Time Limit Exceeded):
input()
A = list(map(int, input().split()))

total = 1
for n in A:
    total *= n
print(total if total <= 10 ** 18 else -1)

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

if 0 in A:
    print(0)
else:
    ans = 1
    a = sorted(A, reverse=True)
    for i in a:
        ans *= i
        if ans > 10 ** 18:
            print(-1)
            break
    else:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
input()
A = list(map(int, input().split()))

total = 1
for n in A:
    total *= n
if total <= 10 ** 18:
    print(total)
else:
    print(-1)

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

if 0 in A:
    print(0)
else:
    ans = 1
    a = sorted(A, reverse=True)
    for i in a:
        ans *= i
        if ans > 10 ** 18:
            print(-1)
            break
    else:
        print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lst = []
count = 0
for _ in range(N):
    s = input()
    if not s in lst:
        lst.append(s)
        count += 1
print(count)

Fixed submission:
N = int(input())
S = set()
count = 0
for _ in range(N):
    s = input()
    S.add(s)
print(len(S))

Buggy python submission (verdict: Runtime Error):
N = int(input())
count = 0
for _ in range(N):
    s = input()
    if not s in lst:
        count += 1
print(count)

Fixed submission:
N = int(input())
S = set()
count = 0
for _ in range(N):
    s = input()
    S.add(s)
print(len(S))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lst = []
for _ in range(N):
    s = input()
    if not s in lst:
        lst.append(s)
print(len(lst))

Fixed submission:
N = int(input())
S = set()
count = 0
for _ in range(N):
    s = input()
    S.add(s)
print(len(S))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
ans = N
x = abs(N - K)
if N % K == 0:
    print(0)
else:
    while ans > x:
        ans = x
        x = abs(x - K)
    else:
        print(ans)

Fixed submission:
N, K = map(int, input().split())
ans = N
a = ans // K
b = ans % K

if a > 0:
    ans = N - K * a
    a = ans // K
    b = ans % K

if a  == 0:
    if ans > abs(ans - K):
        print(abs(ans - K))
    else:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
ans = N
x = abs(N - K)
while ans > x:
    ans = x
    x = abs(x - K)
else:
    print(ans)

Fixed submission:
N, K = map(int, input().split())
ans = N
a = ans // K
b = ans % K

if a > 0:
    ans = N - K * a
    a = ans // K
    b = ans % K

if a  == 0:
    if ans > abs(ans - K):
        print(abs(ans - K))
    else:
        print(ans)
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())

if A == 0:
    print(0)
else:
    s = 'b' * A + 'r' * B
    i = N // (A + B)
    j = N % (A + B)
    a = s[:j].count('b')
    count = A * i + a
    print(count)

Fixed submission:
N, A, B = map(int, input().split())

if A == 0:
    print(0)
else:
    i = N // (A + B)
    j = N % (A + B)
    if j >= A:
        count = A * (i + 1)
        print(count)
    else:
        count = A * i + j
        print(count)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())

s = 'b' * A + 'r' * B
while N > len(s):
    s += s
a = s[:N].count('b')
print(a)

Fixed submission:
N, A, B = map(int, input().split())

if A == 0:
    print(0)
else:
    i = N // (A + B)
    j = N % (A + B)
    if j >= A:
        count = A * (i + 1)
        print(count)
    else:
        count = A * i + j
        print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

dct = {}

lst = [input() for _ in range(N)]

for i in range(N):
    if not lst[i] in dct:
        dct[lst[i]] = 1

    else:
        dct[lst[i]] +=  1
    
ans = []
for key in dct.keys():
    if dct[key] == max(dct.values()):
        ans.append(key)

for j in sorted(ans):
    print(j)

Fixed submission:
N = int(input())

dct = {}

for i in range(N):
    s = input()
    if not s in dct:
        dct[s] = 1

    else:
        dct[s] +=  1
    
m = max(dct.values())
for s in sorted(k for k in dct if dct[k] == m):
    print(s)

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

dct = {}

for i in range(N):
    s = input()
    if not s in dct:
        dct[s] = 1

    else:
        dct[s] +=  1
    
ans = []
for key in dct.keys():
    if dct[key] == max(dct.values()):
        ans.append(key)

for j in sorted(ans):
    print(j)

Fixed submission:
N = int(input())

dct = {}

for i in range(N):
    s = input()
    if not s in dct:
        dct[s] = 1

    else:
        dct[s] +=  1
    
m = max(dct.values())
for s in sorted(k for k in dct if dct[k] == m):
    print(s)

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

dct = {}

for i in range(N):
    s = input()
    if not s in dct:
        dct[s] = 1

    else:
        dct[s] +=  1
    
ans = [x[0] for x in dct.items() if x[1] == max(dct.values())]
for j in sorted(ans):
    print(j)

Fixed submission:
N = int(input())

dct = {}

for i in range(N):
    s = input()
    if not s in dct:
        dct[s] = 1

    else:
        dct[s] +=  1
    
m = max(dct.values())
for s in sorted(k for k in dct if dct[k] == m):
    print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

count = 1
for i in range(1, N):
    if P[i] == min(P[:i+1]):
        count += 1
print(count)

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

mini = 10 ** 9
count = 0
for i in range(N):
    if P[i] <= mini:
        mini = P[i]
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

a_lst = ([i for i, x in enumerate(S) if x == 'A'])
count = 0
for j in a_lst:
    if len(S) >= j + 2:
        if S[j+1] == 'B' and S[j+2] == 'C':
            count += 1
print(count)

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

a_lst = ([i for i, x in enumerate(S) if x == 'A'])
count = 0
for j in a_lst:
    if len(S) >= j + 3:
        if S[j+1] == 'B' and S[j+2] == 'C':
            count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

a_lst = ([i for i, x in enumerate(S) if x == 'A'])
count = 0
for j in a_lst:
    if S[j+1] == 'B' and S[j+2] == 'C':
        count += 1
print(count)

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

a_lst = ([i for i, x in enumerate(S) if x == 'A'])
count = 0
for j in a_lst:
    if len(S) >= j + 3:
        if S[j+1] == 'B' and S[j+2] == 'C':
            count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

ans = set()

for i in range(M):
    L, R = map(int, input().split())
    
    if M == 1:
        print(R-L+1)
        break
        
    else:
        if i == 0:
            ans = set(list(range(L, R + 1)))
                
        else:
            s = set(list(range(L, R + 1)))
            ans = ans & s

else:
    print(len(ans))

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

l = 0
r = N

for i in range(M):
    L, R = map(int, input().split())
    
    if L > l:
        l = L
            
    if R < r:
        r = R
                
    ans = r - l + 1
    if ans < 0:
        print(0)
        break

else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

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

ini = [a[i]*sum(a[i+1:]) for i in range(n)]
print(sum(ini)%(10**9+7))

Fixed submission:
import itertools

n = int(input())
a = list(map(int,input().split()))
s = sum(a)
ini = []
for i in range(n):
    s -= a[i]
    tmp = a[i]*s
    ini.append(tmp)
print(sum(ini)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
a = list(map(int,input().split()))
c = itertools.combinations(a, 2)
ini = [v[0]*v[1] for v in c]
print(sum(ini)%(10**9+7))

Fixed submission:
import itertools

n = int(input())
a = list(map(int,input().split()))
s = sum(a)
ini = []
for i in range(n):
    s -= a[i]
    tmp = a[i]*s
    ini.append(tmp)
print(sum(ini)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
a = list(map(int,input().split()))
c = itertools.combinations(a, 2)
ini = 0
for v in c:
    ini += v[0]*v[1]
print(ini%(10**9+7))

Fixed submission:
import itertools

n = int(input())
a = list(map(int,input().split()))
s = sum(a)
ini = []
for i in range(n):
    s -= a[i]
    tmp = a[i]*s
    ini.append(tmp)
print(sum(ini)%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n,k= map(int,input().split())
a = list(map(int,input().split()))
target = a[0:k]
p = a[0]
for i in range(k-1):
    p *= a[i+1]
# print(p)
for i in range(n-k):
    ans = (p // a[i]) * a[i+k]
    # print(ans)
    if ans > p:
        print("Yes")
    else:
        print("No")
    p = ans


Fixed submission:
import numpy as np

n,k= map(int,input().split())
a = list(map(int,input().split()))
target = a[0:k]
p = sum(target)
for i in range(n-k):
    ans = p - a[i] + a[i+k]
    # print(ans)
    if ans > p:
        print("Yes")
    else:
        print("No")
    p = ans

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import functools
import operator

n,k= map(int,input().split())
a = list(map(int,input().split()))
target = a[0:k]
# print(target)
p = functools.reduce(operator.mul, target)
# print(p)
for i in range(n-k):
    ans = (p // a[i]) * a[i+k]
    # print(ans)
    if ans > p:
        print("Yes")
    else:
        print("No")
    p = ans


Fixed submission:
import numpy as np

n,k= map(int,input().split())
a = list(map(int,input().split()))
target = a[0:k]
p = sum(target)
for i in range(n-k):
    ans = p - a[i] + a[i+k]
    # print(ans)
    if ans > p:
        print("Yes")
    else:
        print("No")
    p = ans
Buggy python submission (verdict: Time Limit Exceeded):
# import numpy as np

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

p = 1
for i in a:
    p *= i



if p > 10**18:
    print(-1)
else:
    print(p)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))

if 0 in a:
    print(0)
    exit()

p = 1
for i in a:
    p *= i
    # print(p)
    if p > 10**18:
        print(-1)
        exit()
print(p)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int,input().split()))

# print(N,K,A)

target = 1
l = [1]
lorp_on = False
for i in range(1,K+1):
    target = A[target-1]
    # print([target])

    if target in l:
        idx = l.index(target)
        lorp_on = True
        break
    l.append(target)
# print(l)

if lorp_on:

    lorp_length = len(l)-idx
    lorp = l[idx:]

    # print(lorp,lorp_length)

    ans_idx = (K-idx)%lorp_length
    # print(ans_idx)
    print(lorp[ans_idx])

else:

    print(l[K])


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

town = [False]*(N+1)
visited_town = []
p = 1
while True:
    if town[p]:
        break
    visited_town.append(p)
    town[p] = True
    p = A[p-1]
#ループに入るまでに訪れた街
m = visited_town.index(p)

#ループ内の街
c = len(visited_town)-m

# print(m,c)
# print(visited_town,town)

if K <= m:
    print(visited_town[K])
else:
    print(visited_town[m+(K-m) % c])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = []
for i in range(N):
    S = input()
    if S not in l:
        l.append(S)
print(len(l))


Fixed submission:
N = int(input())
S = [input() for i in range(N)]
print(len(set(S)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
l = [A.index(i+1) for i in range(max(A))]
l.append(N-1)
# print(l)

for i in range(N):
    if i >= len(l)-1:
        print(0)
    else:
        ans = l[i+1]-l[i]
        print(ans)


Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
d=[0]*(N+1)
for i in range(N-1):
    d[A[i]]+=1
for i in range(1,len(d)):
    print(d[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
c = 0
for i in range(N):
    ans = A.count(i+1)
    # c+= ans
    print(ans)


Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
d=[0]*(N+1)
for i in range(N-1):
    d[A[i]]+=1
for i in range(1,len(d)):
    print(d[i])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
uni = list(set(A))

c = [A.count(i) for i in uni]
coun = c[:]
c = [int((i*(i-1))/2) for i in c]
# print(c)
l = []
# print("+++++++++++++++")
for i in range(len(uni)):
    c_ = c[:]
    x = ((coun[i]-1)*(coun[i]-2))/2
    c_[i] = x
    # print(c_)
    l.append(int(sum(c_)))
# print(l)
ans = dict([[uni[i],l[i]] for i in range(len(l))])

# print(ans)
for i in range(N):
    print(ans[A[i]])


Fixed submission:
import collections
N = int(input())
ai = list(map(int, input().split()))
c = collections.Counter(ai)
# print(c)
val=0
for i in c.values():
    val+=i*(i-1)//2

for i in range(len(ai)):
    b=c[ai[i]]
    print(val-b+1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for i in range(N)]
S_uni = set(S)
# print(S)
# print(S_uni)
m = 0
l = []
for i in S_uni:
    c = S.count(i)
    # print(i,c)
    if c > m:
        m = c
        l = [i]
    elif c == m:
        l.append(i)

# print("============")
l.sort()
for i in l:
    print(i)

Fixed submission:
N = int(input())
S = [input() for i in range(N)]
S.sort()

ini = S[0]
l = [0]
for i in range(N):
    if ini != S[i]:
        # print(ini,S[i])
        ini = S[i]
        l.append(i)
l.append(N)
l_sabun = [l[i+1] - l[i] for i in range(len(l)-1)]
# print(l)
# print(l_sabun )

S_set = list(set(S))
S_set.sort()

# print(S_set)

m = max(l_sabun)
ans = [S_set[i] for i, x in enumerate(l_sabun) if x == m]

# print(m,ans)


# print("============")

for i in ans:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
c = 0
for i in range(1,N+1):
    if min(P[:i]) >= P[i-1]:
        c += 1
    # print(P_,pi)
print(c)


Fixed submission:
N = int(input())
P = list(map(int,input().split()))
c = 0
mi = P[0]
for i in range(N):
    if P[i] < mi:
        mi = P[i]
        c += 1
    # print(mi)
print(c+1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
c = 0
for i in range(1,N+1):
    P_ = P[:i]
    pi = P[i-1]
    if min(P_) >= pi:
        c += 1
    # print(P_,pi)
print(c)


Fixed submission:
N = int(input())
P = list(map(int,input().split()))
c = 0
mi = P[0]
for i in range(N):
    if P[i] < mi:
        mi = P[i]
        c += 1
    # print(mi)
print(c+1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

ans = [A.index(i)+1 for i in range(1,N+1)]


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


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

ans = [0]*N
# ans = [A.index(i)+1 for i in range(1,N+1)]
for i in range(N):
    ans[A[i]-1] = i+1

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

ans = []
for i in range(1,N+1):
    # ans.append(A.index(i)+1)
    print(A.index(i)+1,end=' ')


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

ans = [0]*N
# ans = [A.index(i)+1 for i in range(1,N+1)]
for i in range(N):
    ans[A[i]-1] = i+1

print(' '.join(map(str, ans)))
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int,input().split())
A = [int(input()) for _ in range(Q)]
for i in range(N):
    katisuu = A.count(i+1)
    point = Q - katisuu

    if point < K:
        print("Yes")
    else:
        print("No")


Fixed submission:
N,K,Q = map(int,input().split())
l = [0]*N

for i in range(Q):
    l[int(input())-1] += 1

for i in range(N):
    point = Q - l[i]

    if point < K:
        print("Yes")
    else:
        print("No")