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

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

for i in range(2**N):
  temp = list(format(i,"0"+str(N)+'b'))
  temp1 = list(map(int, temp))
  for k in range(1,N+1):
    if sum(temp1[k-1::k])%2 == A[k-1]:
        pass
    else:
        break
  else:
    print(sum(temp1))
    anslist = []
    for i in range(N):
        if temp1[i] == 1:
          anslist.append(i+1)
    if anslist == []:
      exit()
    else:
      print(*anslist)
      exit()


### FIXED CODE ###

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

temp = [0]*N
for i in range(N-1,-1,-1):
  for j in [0,1]:
    temp[i] = j
    if sum(temp[i::i+1])%2 == A[i]:
      break
  else:
    print(-1)
    exit()
print(sum(temp)) 
anslist = []
for i in range(N):
  if temp[i] == 1:
    anslist.append(i+1)
if anslist == []:
  exit()
else:
  print(*anslist)
  exit()
### BUGGY CODE ###

# -*- coding: utf-8 -*-

S = input()
Symbol = list(S)
MOD =[1,0,0,0,0,0,0,0,0,0,0,0,0]

R10 = range(10)
R13 = range(13)


for D in Symbol:
    NMOD =[0,0,0,0,0,0,0,0,0,0,0,0,0]
    for N in R10:
        if D != '?' and int(D) != N:
            continue
        #end if
        for M in R13:
            NM = (M * 10 + N) % 13
            NMOD[NM] += MOD[M]
        #end for
    #end for
    for M in R13:
        MOD[M] = NMOD[M]%1000000007
    #end for
#end for

print(MOD[5])


### FIXED CODE ###

# -*- coding: utf-8 -*-

R10 = range(10)
R13 = range(13)

S = input()
R = [[(M-N)*4 % 13 for N in R10] for M in R13]
AM = 10**9+7

MOD =[1]+[0]*12

for D in S:
    if D == '?':
        MOD = [sum([MOD[N] for N in M])%AM for M in R]
    else:
        C = int(D)
        MOD = [MOD[M[C]] for M in R]
    #end if
#end for

print(MOD[5])
### BUGGY CODE ###

input()
iter_ = iter(map(int, input().rstrip("\n").split()))

sum_ = next(iter_)
ans = 0

for num in iter_:
    if sum_ == 0:
        sum_ += 1
        ans += 1
    presum = sum_
    sum_ += num
    while presum * sum_ >= 0:
        sum_ += -1 if presum > 0 else 1
        ans += 1

print(ans)

### FIXED CODE ###

input()
seq = list(map(int, input().rstrip("\n").split()))

iter_ = iter(seq)
ans1 = 0
for i, num in enumerate(iter_):
    if i == 0:
        sum_ = num
        if sum_ > 0:
            pass
        else:
            ans1 += abs(sum_ - 1)
            sum_ = 1
    else:
        sum_ += num
        if i % 2:
            if sum_ < 0:
                pass
            else:
                ans1 += abs(sum_ + 1)
                sum_ = -1
        else:
            if sum_ > 0:
                pass
            else:
                ans1 += abs(sum_ - 1)
                sum_ = 1

iter_ = iter(seq)
ans2 = 0
for i, num in enumerate(iter_):
    if i == 0:
        sum_ = num
        if sum_ < 0:
            pass
        else:
            ans2 += abs(sum_ + 1)
            sum_ = -1
    else:
        sum_ += num
        if i % 2:
            if sum_ > 0:
                pass
            else:
                ans2 += abs(sum_ - 1)
                sum_ = 1
        else:
            if sum_ < 0:
                pass
            else:
                ans2 += abs(sum_ + 1)
                sum_ = -1

print(min(ans1, ans2))
### BUGGY CODE ###

n = int(input())
s = list(map(int, input().split()))
ans = 1
for i in range(n):
    if s[i] == 0:
        print("0")
        exit()
    ans *= s[i]
if ans > 10**18:
        print("-1")
else: print(ans)

### FIXED CODE ###

n = int(input())
s = list(map(int, input().split()))
ans = 1
if 0 in s:
    print("0")
    exit()
for i in range(n):
    ans *= s[i]
    if ans > 10**18:
        print("-1")
        exit()
print(ans)
### BUGGY CODE ###

n = int(input())
x,y = map(int,input().split())
for i in range(n-1):
    t,a = map(int,input().split())
    o = t
    p = a
    while x > o or y > p:
        o += t
        p += a
    x = o
    y = p
print(x+y)

### FIXED CODE ###

n = int(input())
A,B = 0,0
for i in range(n):
    x,y = map(int,input().split())
    t,a = 1,1
    if A > x:
        t = A // x
        if A % x != 0:
            t += 1
    if B > y:
        a = B // y
        if B % y != 0:
            a += 1
    m = max(t,a)
    A = x*m
    B = y*m
print(A+B)
### BUGGY CODE ###

import numpy as np


N = int(input())
abc = []
for n in range(N):
    abc.append(list(map(int, input().split())))

# initialize
dp = np.zeros((N+1, 3))

# dp    
for i in range(N+1):
    for j in range(3):
        for k in range(3):
            if j==k:
                continue
            try:
                dp[i+1][k] = max(dp[i+1][k], dp[i][j] + abc[i][k])
            except:
                pass

print(int(max(dp[-1])))


### FIXED CODE ###

N = int(input())
abc = []
for n in range(N):
    abc.append(list(map(int, input().split())))

# initialize
dp = [[-float("inf")]*3 for i in range(N+1)]
for i in range(3):
    dp[0][i] = 0

# dp    
for i in range(N+1):
    for j in range(3):
        for k in range(3):
            if j==k:
                continue
            try:
                dp[i+1][k] = max(dp[i+1][k], dp[i][j] + abc[i][k])
            except:
                pass

print(int(max(dp[-1])))
### BUGGY CODE ###

n, q = map(int, input().split())
ab_lst = [list(map(int, input().split())) for _ in range(n-1)]
px_lst = [list(map(int, input().split())) for _ in range(q)]


neighbor = [[] for _ in range(n+1)]
for edge in ab_lst:
    neighbor[edge[0]].append(edge[1])

root_value = [0] * (n+1)
for px in px_lst:
    root_value[px[0]] += px[1]

res = [0] * (n+1)
queue = [(1, root_value[1])]
while len(queue) > 0:
    pair = queue.pop()
    res[pair[0]] += pair[1]
    if neighbor[pair[0]] != []:
        for i in neighbor[pair[0]]:
            queue.append((i, pair[1] + root_value[i]))
    
for i in res[1:]:
    print(i, end=" ")

### FIXED CODE ###

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

neighbor = [[] for _ in range(n+1)]
for i in range(n-1):
    a, b = map(int, input().split())
    neighbor[a].append(b)

root_value = [0] * (n+1)
for i in range(q):
    p, x = map(int, input().split())
    root_value[p] += x

res = [0] * (n+1)
queue = [(1, root_value[1])]
while len(queue) > 0:
    pair = queue.pop()
    res[pair[0]] += pair[1]
    if neighbor[pair[0]] != []:
        for i in neighbor[pair[0]]:
            queue.append((i, pair[1] + root_value[i]))
    
for i in res[1:]:
    print(i, end=" ")
### BUGGY CODE ###

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
mod = 10 ** 9 + 7

N = int(input())
edge = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    x, y = map(int, input().split())
    edge[x].append(y)
    edge[y].append(x)

# 頂点iから伸びてる枝それぞれのサイズ
memo = [[] for _ in range(N + 1)]


def dfs(s, p=-1):
    res = 1
    for t in edge[s]:
        if t == p:
            continue
        size = dfs(t, s)
        memo[s].append(size)
        res += size
    if N != res:
        memo[s].append(N - res)
    return res


dfs(1)


cnt = 0
for lis in memo[1:]:
    if len(lis) == 1:
        continue
    # 頂点iが穴あきとならない->頂点から伸びてるやつ1つだけ黒の場合がダメ
    tmp = pow(2, N - 1, mod) - 1  # ぜんぶ白の場合を引いとく
    for x in lis:
        black = pow(2, x, mod) - 1
        tmp = (tmp - black + mod) % mod
    cnt = (cnt + tmp) % mod

div = pow(2, N, mod)
ans = cnt * pow(div, mod - 2, mod) % mod
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
mod = 10 ** 9 + 7

N = int(input())
edge = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    x, y = map(int, input().split())
    edge[x].append(y)
    edge[y].append(x)

# 頂点iから伸びてる枝それぞれのサイズ
ans = 0
pow2 = [1] * (N + 1)
for i in range(1, N + 1):
    pow2[i] = pow2[i - 1] * 2 % mod


def dfs(s, p=-1):
    global ans
    res = 1
    tmp = pow2[N-1] - 1
    for t in edge[s]:
        if t == p:
            continue
        size = dfs(t, s)
        res += size
        tmp = (tmp - pow2[size] + 1 + mod) % mod
    if N != res:
        tmp = (tmp - pow2[N-res] + 1 + mod) % mod
    ans = (ans + tmp) % mod
    return res


dfs(1)
div = pow2[N]
print(ans*pow(div, mod-2, mod) % mod)
### BUGGY CODE ###

import sys
#import numpy as np
import math
#from fractions import Fraction
#import itertools
#from collections import deque
#import heapq
#from fractions  import gcd
input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in range(n):
    ans*=a[i]
if ans>pow(10,18):
  print(-1)
  
else:
    print(ans)

### FIXED CODE ###

import sys
#import numpy as np
import math
#from fractions import Fraction
#import itertools
#from collections import deque
#import heapq
#from fractions  import gcd
input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
ans=1
if 0 in a:
  print(0)
  exit()
for i in range(n):
    ans*=a[i]
    if ans>pow(10,18):
      print(-1)
      break
else:
    print(ans)
### BUGGY CODE ###

l = list(map(int,input().split()))
a,b,k = l[0],l[1],l[2]
for i in range(a,b+1):
    if a<=i<=a+k-1 or b-k+1<=i<=b:
        print(i)
        

### FIXED CODE ###

l = list(map(int,input().split()))
a,b,k = l[0],l[1],l[2]
c = []
for i in range(a,min(a+k,b)):
    c.append(i)
for i in range(max(b-k+1,a),b+1):
    if i not in c:
        c.append(i)
for i in c:
    print(i)
### BUGGY CODE ###

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

import bisect
a.sort()
b.sort()
c.sort()
ans = 0

comb = []
for i in range(len(b)):
    key = bisect.bisect_left(c,b[i]+1)
    comb.append(len(c) -key)
comb.append(0)
for A in a:
    key_b = bisect.bisect_left(b,A+1)
    ans += sum(comb[key_b:])
print(ans)

### FIXED CODE ###

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

import bisect
a.sort()
b.sort()
c.sort()
ans = 0
for i in range(len(b)):
    ab = bisect.bisect_right(a,b[i]-1) # b[i]より真に小さいaの要素数
    bc = len(c) - bisect.bisect_left(c,b[i]+1) # b[i]より真に大きいcの要素数
    ans += ab*bc
print(ans)
### BUGGY CODE ###

n = int(input())

a = [[0] for _ in range(n)]

for i in range(n):
    a[i] = list(map(lambda x:int(x)-1,input().split()))
    a[i].append(-1)

t = [a[i][0] for i in range(n)]
l = [0]*n
used = [False]*n

head = 0
day = 0

for i in range(min(n*(n-1)//2,10**4)):
    if t == [-1]*n:
        break
    while True:
        if used[head] == False:
            used[head] = True
            if used[t[head]] == False:
                if t[t[head]] == head:
                    used[t[head]] = True
                    l[head] += 1
                    l[t[head]] += 1
                    t[t[head]] = a[t[head]][l[t[head]]]
                    t[head] = a[head][l[head]]
                    head = (head + 1)%n    
                else:
                    head = (head + 1)%n
        elif used[head] == True:
            head = (head + 1)%n
        if used == [True]*n:
            day += 1
            used = [False]*n
            break

if t != [-1]*n:
    print(-1)
    exit()

print(day)

### FIXED CODE ###

from collections import deque

n = int(input())
a = [0]*n

for i in range(n):
    a[i] = list(map(lambda x:int(x)-1,input().split()))
    a[i].append(-1)

t = [a[i][0] for i in range(n)]

l = [0]*n
day = [0]*n

q = deque([i for i in range(n)])

while q:
    u = q.popleft()
    v = a[u][l[u]]
    if a[v][l[v]] == u:
        day[u] = day[v] = max(day[u],day[v]) + 1
        l[u] += 1
        l[v] += 1
        q.append(u)
        q.append(v)

if any(x != n-1 for x in l):
    print(-1)
    exit()

print(max(day))
### BUGGY CODE ###

N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

MOD = 10 ** 9 + 7
dp = [0] * (N + 1)
dp[0] = 1
for i in range(1, N+1):
    if i not in A:
        dp[i] = (dp[i-1] + dp[i-2]) % MOD
print(dp[N])

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

MOD = 10 ** 9 + 7
n,m = map(int,input().split())
A = set(int(input()) for _ in range(m)) #壊れた階段

dp = [0] * (n+1)
dp[0] = 1

for i in range(1,n+1):
    if i in A:
        continue
    x = dp[i-1]
    if i > 1:
        x += dp[i-2]
    dp[i] = x%MOD

print(dp[n])
### BUGGY CODE ###

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

r = [i+1 for i, x in enumerate(s) if x == 'R']
g = [i+1 for i, x in enumerate(s) if x == 'G']
b = [i+1 for i, x in enumerate(s) if x == 'B']

c = 0
for i in range(1,(n+1)//2):
    for j in range(1,n-2*i+1):
        if j in r and j+i in g and j+2*i in b:
            c += 1
        if j in r and j+i in b and j+2*i in g:
            c += 1
        if j in g and j+i in b and j+2*i in r:
            c += 1
        if j in g and j+i in r and j+2*i in b:
            c += 1
        if j in b and j+i in r and j+2*i in g:
            c += 1
        if j in b and j+i in g and j+2*i in r:
            c += 1

ans = (len(r)*len(g)*len(b) - c)
print(ans)

### FIXED CODE ###

def binary_search(data, value):
    left = 0            # 探索する範囲の左端を設定
    right = len(data) - 1            # 探索する範囲の右端を設定
    while left <= right:
        mid = (left + right) // 2            # 探索する範囲の中央を計算
        if data[mid] == value:
            # 中央の値と一致した場合は位置を返す
            return mid
        elif data[mid] < value:
            # 中央の値より大きい場合は探索範囲の左を変える
            left = mid + 1
        else:
            # 中央の値より小さい場合は探索範囲の右を変える
            right = mid - 1
    return -1            # 見つからなかった場合

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

r = [i+1 for i, x in enumerate(s) if x == 'R']
g = [i+1 for i, x in enumerate(s) if x == 'G']
b = [i+1 for i, x in enumerate(s) if x == 'B']

c = 0
for i in r:
    for j in g:
        if binary_search(b, 2*i - j) != -1:
            c += 1
        if binary_search(b, 2*j - i) != -1:
            c += 1
        if binary_search(b, (i+j)/2) != -1:
            c += 1

ans = (len(r)*len(g)*len(b) - c)
print(ans)
### BUGGY CODE ###

from collections import defaultdict

N, M = map(int, input().split())
d = defaultdict(list)
for _ in range(M):
    A, B = map(int, input().split())
    d[A].append(B)
    d[B].append(A)
ans = [(-1, float("inf"))] * N
cnt = 0
stack = [(1, 0)]
while stack:
    val, step = stack.pop()
    next_vals = d[val]
    for nxt in next_vals:
        if ans[nxt - 1][1] > step + 1:
            ans[nxt - 1] = (val, step + 1)
            stack.append((nxt, step + 1))

flag_no = False
for i in range(1, N):
    if ans[i][0] == -1:
        flag_no = True
        break

if flag_no:
    print("No")
else:
    print("Yes")
    for i in range(1, N):
        print(ans[i][0])

### FIXED CODE ###

from collections import deque

N, M = map(int, input().split())
d = {}
for _ in range(M):
    A, B = map(int, input().split())
    if A not in d:
        d[A] = [B]
    else:
        d[A].append(B)
    if B not in d:
        d[B] = [A]
    else:
        d[B].append(A)

ans = [(-1, float("inf"))] * N
cnt = 0
# stack = [(1, 0)]
queue = deque([(1, 0)])

while queue:
    val, step = queue.popleft()
    next_vals = d[val]
    for nxt in next_vals:
        #        if ans[nxt - 1][1] > step + 1:
        if ans[nxt - 1][0] == -1:
            cnt += 1
            ans[nxt - 1] = (val, step + 1)
            queue.append((nxt, step + 1))

if cnt < N - 1:
    print("No")
else:
    print("Yes")
    for i in range(1, N):
        print(ans[i][0])
### BUGGY CODE ###

import sys
sys.setrecursionlimit(1000000)
n,m,k=map(int,input().split())

L=[set() for i in range(n)]
U=[set() for i in range(n)]
for i in range(m):
	a,b=map(int,input().split())
	L[a-1].add(b-1)
	L[b-1].add(a-1)
for i in range(k):
	c,d=map(int,input().split())
	U[c-1].add(d-1)
	U[d-1].add(c-1)
	
S=[[] for i in range(n)]
D=[0]*n

def dfs(n):
	D[n]=1
	T.append(n)
	for np in L[n]:
		if D[np]!=1:
			dfs(np)
			
for i in range(n):
	if D[i]==1:
	    continue
	T=[]
	dfs(i)
	for t in T:
		S[t]=T[:]
		S[t].remove(t)
		
R=[0]*n
for i in range(n):
	R[i]=len(S[i])-len(L[i])-len(set(S[i])&set(U[i]))
print(*R)
	

### FIXED CODE ###

from collections import deque
n,m,k=map(int,input().split())

F=[set() for i in range(n)]
B=[set() for i in range(n)]
for i in range(m):
	a,b=map(int,input().split())
	a,b=a-1,b-1
	F[a].add(b)
	F[b].add(a)
for i in range(k):
	c,d=map(int,input().split())
	c,d=c-1,d-1
	B[c].add(d)
	B[d].add(c)
	
T=[set() for i in range(n)]
D=[0]*n
R=[0]*n

for i in range(n):
    if D[i]:
        continue
    que=deque([])
    que.append(i)
    S=set()
    S.add(i)
    while que:
        p=que.popleft()
        for np in F[p]:
            if D[np]!=1:
                que.append(np)
                S.add(np)
                D[np]=1
    for s in S:
        R[s]=len(S)-len(F[s])-len(S&B[s])-1

print(*R)
### BUGGY CODE ###

N, K = map(int, input().split())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)

for i in range(2, N+1):
  DP[i] = min(DP[i-j] + abs(H[i-j] - H[i]) for j in range(1, K+1) if i > j)
print(DP[N])


### FIXED CODE ###

N, K = map(int, input().split())
H = [0] + list(map(int, input().split()))

DP = [0] * (N+1)

for i in range(2, N+1):
  k = max(i-K, 1)
  DP[i] = min(dp + abs(h - H[i]) for dp, h in zip(DP[k:i], H[k:i]))
print(DP[N])
### BUGGY CODE ###

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

k_mul = 1
for i in range(k):
    k_mul *= a[i]

first = k_mul
for i in range(k, n):
    new = (first // a[i-k]) * a[i]
    if first < new:
        print("Yes")
    else:
        print("No")
    first = new

### FIXED CODE ###

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


for i in range(k, n):
    if a[i-k] < a[i]:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

def main():
    n = int(input())
    A = list(map(int, input().split()))
    ans = 1
    for a in A:
        ans *= a
    if ans <= 10 ** 18:
        print(ans)
    else:
        print(-1)

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())
    A = list(map(int, input().split()))
    ans = 1
    x = 10 ** 18
    if 0 in A:
        print(0)
        exit()
    for a in A:
        ans *= a
        if ans > x:
            print(-1)
            exit()
    print(ans)

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

N, K = map(int, input().split())
A = [int(x) for x in input().split()]
for _ in range(K):
    next_A = [0] * N
    for i in range(N):
        for j in range(max(0, i-A[i]), min(N-1, i+A[i])+1):
            next_A[j] += 1
    A = next_A
print(" ".join([str(x) for x in A]))


### FIXED CODE ###

from numba import jit


@jit
def solve(N, K, A):
    for _ in range(K):
        imos = [0] * (N+1)
        for i in range(N):
            left = max(0, i-A[i])
            right = min(N-1, i+A[i])+1
            imos[left] += 1
            imos[right] += -1

        next_A = [0] * N
        next_A[0] = imos[0]
        for i in range(1, N):
            next_A[i] = next_A[i-1] + imos[i]

        if A == next_A:
            return A
        A = next_A
    return A


N, K = map(int, input().split())
A = [int(x) for x in input().split()]
print(" ".join([str(x) for x in solve(N, K, A)]))
### BUGGY CODE ###

n, m = map(int, input().split())
ships = [[int(x) for x in input().split()] for x in range(m)]

judge = False
relay = []
for ship in ships:
    if n in ship:
        judge = True
        relay.append(ship[0])

res = False
if judge is False:
    print("IMPOSSIBLE")
else:
    for i in relay:
        if [1, i] in ships:
            res = True
            break
    print("POSSIBLE" if res else "IMPOSSIBLE")

### FIXED CODE ###

n, m = map(int, input().split())
ships = [[int(x) for x in input().split()] for x in range(m)]

judge = False
relay = []
goal = []

for ship in ships:
    if n in ship:
        goal.append(ship[0])
    elif 1 in ship:
        relay.append(ship[1])

res = False
if len(goal) == 0 or len(relay) == 0:
    print("IMPOSSIBLE")

else:
    print("IMPOSSIBLE" if not set(relay) & set(goal) else "POSSIBLE")
### BUGGY CODE ###

n = int(input())
l = sorted(list(map(int, input().split())))
answer = 0

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        lij = l[i] + l[j]
        for k in range(j + 1, n):
            if l[k] < lij:
               answer += 1
            else:
               break
print(answer)


### FIXED CODE ###

from bisect import bisect_left

n = int(input())
l = sorted(list(map(int, input().split())))
answer = 0

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        lij = l[i] + l[j]
        r = bisect_left(l, lij)
        answer += max(0, r - j - 1)
        
print(answer)
### BUGGY CODE ###


def main():
    n = int(input())
    a_list = list(map(int, input().split()))

    a_list = list(filter((1).__ne__, a_list))

    if 0 in a_list:
        print('0')
        return

    result = 1

    for a in a_list:
        result = result * a

    if result > 10**18:
        print('-1')
        return

    print(result)


if __name__ == "__main__":
    main()


### FIXED CODE ###


def main():
    n = int(input())
    a_list = list(map(int, input().split()))

    a_list = list(filter((1).__ne__, a_list))

    if 0 in a_list:
        print('0')
        return

    result = 1

    for a in a_list:
        result = result * a

        if result > 10**18:
            print('-1')
            return

    print(result)


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

k,s = map(int,input().split())
n = 0
for x in range(k+1):
    for y in range(k+1):
        z = s-(x+y)
        if z < 0:
            z = 0
        elif z > k:
            z = k
        if x+y+z==s:
            n += 1
                
print(n)
                

### FIXED CODE ###

k,s = map(int,input().split())
n = 0
for x in range(k+1):
    for y in range(k+1):
        z = s-(x+y)
        if z <= k and z >= 0 and x+y+z==s:
            n += 1
print(n)
### BUGGY CODE ###

n, k = map(int, input().split())
p = [int(x) for x in input().split()]

l = 0
r = k

result = 0.0
while r != len(p)+1:
  this_res = 0.0
  for pi in p[l:r]:
    this_res += sum(map(lambda a : 1/pi * a, [x for x in range(1, pi+1)]))
  result = max(result, this_res)
  l += 1
  r += 1

print(result)

### FIXED CODE ###

from itertools import accumulate
n, k = map(int, input().split())
p = list(map(int, input().split()))

pp = [0] + list(accumulate(p))

m = 0
for i in range(n - k + 1):
  m = max(m,pp[i + k] - pp[i])
print((m+k)/2)
### BUGGY CODE ###

import bisect
a,b,q = map(int,input().split())
inf = 10**18
s = [-inf]+[int(input()) for i in range(a)]+[inf]
t = [-inf]+[int(input()) for i in range(b)]+[inf]
for i in range(q):
  x = int(input())
  i = bisect.bisect_right(s,x)
  j = bisect.bisect_right(t,x)
  print(min(max(s[i],t[j])-x,x-min(s[i-1],t[j-1]),min(s[i]-x,x-t[j-1])+s[i]-t[j-1],min(t[j]-x,x-s[i-1])+t[j]-s[i-1]))

### FIXED CODE ###

import bisect,sys
input = sys.stdin.readline
a,b,q = map(int,input().split())
inf = 10**18
s = [-inf]+[int(input()) for i in range(a)]+[inf]
t = [-inf]+[int(input()) for i in range(b)]+[inf]
for i in range(q):
  x = int(input())
  i = bisect.bisect_right(s,x)
  j = bisect.bisect_right(t,x)
  print(min(max(s[i],t[j])-x,x-min(s[i-1],t[j-1]),min(s[i]-x,x-t[j-1])+s[i]-t[j-1],min(t[j]-x,x-s[i-1])+t[j]-s[i-1]))
### BUGGY CODE ###

# coding: utf-8
# Your code here!
# coding: utf-8

def main():
   
    n = int(input())
    alltohyo = list()
    counter = {}
    for _ in range(n):
        alltohyo.append(input())
   
    tohyo = set(alltohyo)
   
    for i in tohyo:
        counter[i] = alltohyo.count(i)
       
    max_val = max(counter.values())
    keys_of_max_val = [key for key in counter if counter[key] == max_val]
    #slist = sorted(counter.items(), key=lambda x: x[1], reverse=True)    
   
    s_keys_of_max_val = sorted(keys_of_max_val)
   
    for i in s_keys_of_max_val:
        print(i)
    #max_count = max(counter)
    #print(max_count)
    #print(alltohyo,tohyo, counter)
   
    return 0


if __name__ == '__main__':
  main()

### FIXED CODE ###

# coding: utf-8


def main():
    n = int(input())
    polls_dict = {}
    for _ in range(n):
        poll = input()
        if poll not in polls_dict:
            polls_dict[poll] = 1
        else:
            polls_dict[poll] += 1

    max_poll = max(polls_dict.values())
    
    polls_set = set()
    for key, value in polls_dict.items():
        if value == max_poll:
            polls_set.add(key)

    polls_set = sorted(polls_set)
    for poll in polls_set:
        print(poll)
    
    return 0


if __name__ == '__main__':
    main()