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

def BC132_E():
    n, m = list(map(int, input().split(' ')))
    e = [[] for _ in range(n)]
    for _ in range(m):
        u, v = list(map(int, input().split(' ')))
        e[u - 1].append(v - 1)
    s, t = list(map(int, input().split(' ')))
    s, t = s - 1, t - 1
    stack, visited = [(s, 0)], set()
    while stack:
        i, d = stack.pop(0)
        if i == t: return d
        if i in visited:
            continue
        visited.add(i)
        a = set()
        for j in e[i]:
            a.update(e[j])
        b = set()
        for j in list(a):
            b.update(e[j])
        stack += [(x, d + 1) for x in list(b - visited)]
    return -1


print(BC132_E())

### FIXED CODE ###

def BC132_E():
    n, m = list(map(int, input().split(' ')))
    e = [[] for _ in range(n)]
    for _ in range(m):
        u, v = list(map(int, input().split(' ')))
        e[u - 1].append(v - 1)
    s, t = list(map(int, input().split(' ')))
    s, t = s - 1, t - 1
    stack, visited = [(s, 0)], set()
    a, b = set(), set()
    while stack:
        i, d = stack.pop(0)
        if i == t: return d
        if i in visited:
            continue
        visited.add(i)
        v = set()
        for j in e[i]:
            if j in a: continue
            a.add(j)
            for k in e[j]:
                if k in b: continue
                b.add(k)
                v.update(e[k])
        if t in v:
            return d + 1
        else:
            stack += [(x, d + 1) for x in list(v)]
    return -1


print(BC132_E())
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**9)

MOD = 10**9 + 7
n = int(input())
g = [[] for _ in range(n)]
for _ in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)

dp = {}


def f(s):
    ts = tuple(s)
    if ts in dp:
        return dp[ts]
    if len(s) == n - 1:
        return 1

    ans = 0
    for si in s:
        for j in g[si]:
            if j in s:
                continue

            ans += f(s | {j})
            ans %= MOD
    dp[ts] = ans
    return ans


for i in range(n):
    print(f({i}))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

MOD = 10**9 + 7
n = int(input())
graph = [[] for _ in range(n)]
for _ in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)

MAX = n + 5
fact = [1] * (MAX + 1)  # i!
finv = [1] * (MAX + 1)  # (i!)^{-1}
iinv = [1] * (MAX + 1)  # i^{-1}
for i in range(2, MAX + 1):
    fact[i] = fact[i - 1] * i % MOD
    iinv[i] = MOD - iinv[MOD % i] * (MOD // i) % MOD
    finv[i] = finv[i - 1] * iinv[i] % MOD

ele_id = (1, 0)
# dp[v][i] = (頂点vから出るi番目の有向辺に関する部分木のDPの値)
# dp[v][i] = (c, m)
# c = 頂点vから出るi番目の有向辺に関する部分木の塗り方の数
# m = 頂点vから出るi番目の有向辺に関する部分木の頂点数
dp = [[ele_id] * len(graph[i]) for i in range(n)]
ans = [ele_id] * n

add_func = lambda x: (x[0], x[1] + 1)


def merge_func(a, b):
    m = a[1] + b[1]
    dp_a = a[0] * finv[a[1]] % MOD
    dp_b = b[0] * finv[b[1]] % MOD
    c = (dp_a * dp_b % MOD) * fact[m] % MOD
    return (c, m)


def dfs1(v, v_p):
    dp_cum = ele_id
    for i, v_next in enumerate(graph[v]):
        if v_next == v_p:
            continue
        dp[v][i] = dfs1(v_next, v)
        dp_cum = merge_func(dp_cum, dp[v][i])
    return add_func(dp_cum)


def dfs2(v, v_p, dp_vp):
    for i, v_next in enumerate(graph[v]):
        if v_next == v_p:
            dp[v][i] = dp_vp

    dp_l = [ele_id] * (len(graph[v]) + 1)
    dp_r = [ele_id] * (len(graph[v]) + 1)
    for i in range(len(graph[v])):
        dp_l[i + 1] = merge_func(dp_l[i], dp[v][i])
    for i in reversed(range(len(graph[v]))):
        dp_r[i] = merge_func(dp_r[i + 1], dp[v][i])

    ans[v] = add_func(dp_l[-1])

    for i, v_next in enumerate(graph[v]):
        if v_next == v_p:
            continue
        dfs2(v_next, v, add_func(merge_func(dp_l[i], dp_r[i + 1])))


dfs1(0, -1)
dfs2(0, -1, ele_id)
for ans_i, _ in ans:
    print(ans_i)
### BUGGY CODE ###

# 出現した数のフラグを立てればよいだけでは
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
count = Counter(A)
happend = set()
A.sort()
ans = 0

for i in range(N):
    tmp = set()
    if count[A[i]] >= 2:
        ans += 1
        happend.add(A[i])
        continue
    for j in range(1, int(A[i]**(1/2))+2):
        if A[i] % j == 0:
            tmp.add(j)
            tmp.add(A[i]//j)

    if len(tmp & happend) >= 1 or count[A[i]] >= 2:
        ans += 1
    happend.add(A[i])

print(N-ans)


### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int, input().split()))
C = Counter(A)
A.sort()
ans = 0
max_A = max(A)
dp = [True]*(max_A+1)  # 0~max(A)の数についてのリスト
happend = set()
for a in A:
    if C[a] >= 2:
        if a in happend:
            continue
        else:
            # aが存在したという証拠だけは残しておく
            x = a * 2
            while x <= max_A:
                dp[x] = False
                x += a
            happend.add(a)
    else:
        if dp[a]:
            ans += 1
        x = a * 2
        while x <= max_A:
            dp[x] = False
            x += a
print(ans)
### BUGGY CODE ###

import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

#maxvalue
k = int(arr_data[0][0])

#sumvalue
s = int(arr_data[0][1])


#print(k,s)

cnt = 0
    
x = 0
while x <= k:

    if x>s:
        
        break
        
    y = 0
    while y<=k:
        
        if y>s:
        
            break
        
        z=0
        while z<=k:
    
            
            if z>s:
                
                break
#            print(x,y,z)
            
            if x + y + z == s:
                
                cnt += 1
                break
            
            z+=1
            
        y+=1
    
    x+=1

print(cnt)
    
    


### FIXED CODE ###

def getinputdata():

    array_result = []
    
    data = input()
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

#maxvalue
k = int(arr_data[0][0])

#sumvalue
s = int(arr_data[0][1])

cnt = 0

for x in range(0, k + 1):
    
    for y in range(0, k + 1):
        
        z = s-x-y
        
        if z >= 0 and z <= k:
            
            cnt += 1
            
print(cnt)
### BUGGY CODE ###


def keisan(a):
    a.sort(reverse = True)
    ans = 0
    for i in range(n):
        if a.count(a[i]) >= 4:
            ans = a[i]*a[i]
            break
        elif a.count(a[i]) >=2:
            for j in range(i+a.count(a[i]),n):
                if a.count(a[j]) >=2:
                    ans = a[i]*a[j]
                    break
            break
    print(ans)

n = int(input())
in_ = [int(i) for i in input().split()]
keisan(in_)

### FIXED CODE ###

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

a.sort(reverse = True)
ans = 0
b = a.copy()
b = list(set(b))
b.sort(reverse = True)
c = [0]*len(b)
j = 0
c[j] = 1
for i in range(1,n):
    if a[i-1] == a[i]:
        c[j] +=1
    else:
        j+=1
        c[j] +=1
for i in range(len(b)):
    if c[i] >= 4:    
        
        ans = b[i]*b[i]
        break
    elif c[i] >= 2:
        for j in range(i+1,len(b)):
            if c[j] >= 2:
                ans = b[i]*b[j]
                break
        break
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

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

def calc_idx(x, y):
    if x > y:
        x, y = y, x
    return x + y*(y-1)//2

n_game = n * (n-1) // 2
edge = [[] for i in range(n_game)]
for i in range(n):
    for j in range(1, n-1):
        g1 = calc_idx(i, a[i][j-1])
        g2 = calc_idx(i, a[i][j])
        edge[g1].append(g2)

indegree = [0] * n_game
for i in range(n_game):
    for v in edge[i]:
        indegree[v] += 1

ans = 0
cand = [[i for i in range(n_game) if indegree[i] == 0], []]
n_ts = 0
while cand[ans%2]:
    n_ts += len(cand[ans%2])
    cand[(ans+1)%2] = []
    for ci in cand[ans%2]:
        for v in edge[ci]:
            indegree[v] -= 1
            if indegree[v] == 0:
                cand[(ans+1)%2].append(v)
    ans += 1

if n_ts != n_game:
    ans = -1

print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline

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

def calc_idx(x, y):
    if x > y:
        x, y = y, x
    return x + y*(y-1)//2

n_game = n * (n-1) // 2
edge = [[] for i in range(n_game)]
for i in range(n):
    for j in range(1, n-1):
        g1 = calc_idx(i, a[i][j-1])
        g2 = calc_idx(i, a[i][j])
        edge[g1].append(g2)

indegree = [0] * n_game
for i in range(n_game):
    for v in edge[i]:
        indegree[v] += 1

ans = 0
cand = [i for i in range(n_game) if indegree[i] == 0]
ts = []
while cand:
    ts.extend(cand)
    cand2 = []
    for ci in cand:
        for v in edge[ci]:
            indegree[v] -= 1
            if indegree[v] == 0:
                cand2.append(v)
    cand = cand2
    ans += 1

if len(ts) != n_game:
    ans = -1

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

N = input()
S = input()
new_S = ""
for i in range(int(N)):
    if i == 0:
        new_S += S[i]
    else:
        if S[i] != S[i-1]:
            new_S += S[i]
print(len(new_S))

### FIXED CODE ###

N = input()
S = input()
answer = 0
for i in range(int(N)):
    if i == 0:
        answer += 1
    else:
        if S[i] != S[i-1]:
            answer += 1
print(answer)
### BUGGY CODE ###

class UnionFind():

    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def root(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.root(self.parents[x])
            return self.parents[x]

    def unite(self, x, y):
        rx = self.root(x)
        ry = self.root(y)
        if rx == ry:
            return
        if self.parents[x] > self.parents[y]:
            rx, ry = ry, rx
        self.parents[rx] += self.parents[ry]
        self.parents[ry] = rx

    def same(self, x, y):
        rx = self.root(x)
        ry = self.root(y)
        return rx == ry

    def size(self, x):
        return -self.parents[self.root(x)]

    def members(self, x):
        return [i for i in range(self.n) if self.same(i, x)]


n, m, k = map(int, input().split())
friend_cand = UnionFind(n)
friend = {i: set() for i in range(n)}
for _ in range(m):
    a, b = map(lambda x: int(x)-1, input().split())
    friend[a].add(b)
    friend[b].add(a)
    friend_cand.unite(a, b)
block = {i: set() for i in range(n)}
for _ in range(k):
    c, d = map(lambda x: int(x)-1, input().split())
    block[c].add(d)
    block[d].add(c)

res = []
for i in range(n):
    friend_cnt = block_cnt = 0
    for k in friend_cand.members(i):
        if k in friend[i]:
            friend_cnt += 1
        elif k in block[i]:
            block_cnt += 1
    res.append(friend_cand.size(i) - friend_cnt - block_cnt - 1)

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


### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def root(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.root(self.parents[x])
            return self.parents[x]

    def unite(self, x, y):
        rx = self.root(x)
        ry = self.root(y)
        if rx == ry:
            return
        if self.parents[x] > self.parents[y]:
            rx, ry = ry, rx
        self.parents[rx] += self.parents[ry]
        self.parents[ry] = rx

    def same(self, x, y):
        rx = self.root(x)
        ry = self.root(y)
        return rx == ry

    def size(self, x):
        return -self.parents[self.root(x)]


n, m, k = map(int, input().split())
friend_cand = UnionFind(n)
friend = {i: set() for i in range(n)}
for _ in range(m):
    a, b = map(lambda x: int(x)-1, input().split())
    friend[a].add(b)
    friend[b].add(a)
    friend_cand.unite(a, b)
block = {i: set() for i in range(n)}
for _ in range(k):
    c, d = map(lambda x: int(x)-1, input().split())
    block[c].add(d)
    block[d].add(c)

res = []
for i in range(n):
    friend_cnt = len(friend[i])
    block_cnt = 0
    for k in block[i]:
        if friend_cand.same(i, k):
            block_cnt += 1
    res.append(friend_cand.size(i) - friend_cnt - block_cnt - 1)

print(' '.join(map(str, res)))
### BUGGY CODE ###

S = input()
INF = 10**9+7
dp = [0,0,0]
Q = 0
for i in range(len(S)):
  if S[i]=='A':
    dp[0] += (3**Q)%INF
    dp[0] %= INF
  elif S[i]=='B':
    dp[1] += (dp[0]%INF)
  elif S[i]=='C':
    dp[2] += (dp[1]%INF)
  else:
    a = dp[0]
    b = dp[1]
    dp[0] = 3**Q + dp[0]*3
    dp[1] = a + dp[1]*3
    dp[2] = b + dp[2]*3
    dp[0] %= INF
    dp[1] %= INF
    dp[2] %= INF
    Q += 1
print(dp[2]%INF)

### FIXED CODE ###

S = input()
INF = 10**9+7
dp = [0,0,0]
N = 1
for i in range(len(S)):
  if S[i]=='A':
    dp[0] += N
    dp[0] %= INF
  elif S[i]=='B':
    dp[1] += dp[0]
    dp[1] %= INF
  elif S[i]=='C':
    dp[2] += dp[1]
    dp[2] %= INF
  else:
    a = dp[0]
    b = dp[1]
    dp[0] = N + dp[0]*3
    dp[1] = a + dp[1]*3
    dp[2] = b + dp[2]*3
    dp[0] %= INF
    dp[1] %= INF
    dp[2] %= INF
    N = (3*N)%INF
print(dp[2]%INF)
### BUGGY CODE ###

S=input()

N=len(S)
n=0
for i in range(N-3):
  for j in range(i+3,N):
    if int(S[i:j+1]) % 2019 == 0:
      n+=1
print(n)

### 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 = int(input())
A = [int(num) for num in input().split()]

ans = 0

for i in range(N-1):

    for j in range(i+1, N):
        
        ans += A[i]*A[j]

print(int(ans%(1e9+7)))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = sum(a)
ans = 0
for i in range(n-1):
    ans += a[i] *(b-a[i])
    b = b - a[i]
print(ans % (10**9 + 7))
### BUGGY CODE ###

def main():
    import sys
    import numpy as np
    import itertools
    readline = sys.stdin.readline

    n = int(readline())

    a = list(map(int, readline().split()))
    a_c = list(itertools.combinations(a, 2))

    a0 = np.array([a_c[i][0] for i in range(len(a_c))])
    a1 = np.array([a_c[i][1] for i in range(len(a_c))])

    ans_b = np.matmul(a0%(1e+9 + 7), a1)
    ans = ans_b % (1e+9 + 7)

    print(f"{ans:.0f}")


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    import sys
    readline = sys.stdin.readline

    mod = 10**9 + 7

    n = int(readline())
    A = list(map(int, readline().split()))

    sumA = sum(A) % mod
    ans = 0

    for i in A:
        sumA -= i
        ans += i * sumA
        ans %= mod

    ans %= mod
    print(ans)


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

N,K,Q = map(int,input().split())
A = list(input() for _ in range(Q))
points = [K for _ in range(N)]

for i in A:
    points = list(map(lambda x:x-1,points))
    points[int(i)-1] += 1

for i in points:
    if(i > 0):
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

N,K,Q = map(int,input().split())
A = list(input() for _ in range(Q))
points = [K for _ in range(N)]

points = list(map(lambda x:x-Q,points))

for i in A:
    points[int(i)-1] += 1

for i in points:
    if(i > 0):
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

H,N=map(int, input().split())
A=[]
B=[]

import numpy as np
  


for n in range(N):
  a,b=map(int, input().split())
  A.append(a)
  B.append(b)

dp=[float('inf')]*(H+1)
dp[0]=0
for h in range(1,H+1):
  for i in range(N):
    if h-A[i]>=0:
      dp[h]=min(dp[h-A[i]]+B[i],dp[h])
    else:
      dp[h]=min(dp[h],B[i])
print(dp[H])

### FIXED CODE ###

H,N=map(int, input().split())
A=[]
B=[]

dp=[10**10]*(H+1)
dp[0]=0
for n in range(N):
  a,b=map(int, input().split())
  A.append(a)
  B.append(b)
    
for h in range(1,H+1):
  for n in range(N):
    if h-A[n]>=0:
      dp[h]=min(dp[h],dp[h-A[n]]+B[n])
    else:
      dp[h]=min(dp[h],B[n])
print(dp[H])
### BUGGY CODE ###

import sys
import math
from collections import Counter
import itertools
import fractions
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
 
A,B,N = MI()

ma = 0
for i in range(1,N+1):
    s = math.floor(A*i/B) - A * math.floor(i/B)
    ma = max(ma,s)
print(ma)

### FIXED CODE ###

import sys
import math
from collections import Counter
import itertools
import fractions
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
 
A,B,N = MI()

mini = min(B-1,N)
s = math.floor(A*mini/B) - A * math.floor(mini/B)
print(s)
### BUGGY CODE ###

n = int(input())
t = 0
a = 0
for i in range(n):
    T, A = map(int, input().split())
    k = 1
    while True:
        if T * k >= t and A * k >= a:
            t = T * k
            a = A * k
            break
        else:
            k += 1
print(t + a)


### FIXED CODE ###

n = int(input())
t = 1
a = 1
for i in range(n):
    T, A = map(int, input().split())
    k = max(1, t // T + (t % T != 0), a // A + (a % A != 0))
    t = k * T
    a = k * A
print(t + a)
### BUGGY CODE ###

N = int(input())
T = [0]*100000
X= [0]*100000
Y= [0]*100000
o_x = 0
o_y = 0

for n in range(N):
        T[n],X[n],Y[n] = (map(int, input().split()))

flag = 1
for n in range(N):
    #print(n)
    if flag == 0:
        continue

    if n == 0:
        count = T[n]
    else:
        count = T[n] - T[n-1]
        o_x = X[n-1]
        o_y = Y[n-1]
    c = 0
    x = o_x
    y = o_y

    end = 0
    while True:
        if end == 1:
            break
        s_x = X[n] - x
        s_y = Y[n] - y
    #    print(str(x)+' '+str(y))

        if ((s_x >= 0 or s_y >= 0) )and (c!=count):
            if s_x >0:
                x +=1
                c += 1
            elif s_x < 0:
                x -= 1
                c+=1
            elif s_y > 0:
                y +=1
                c += 1
            elif s_y < 0:
                y -= 1
                c+=1
            elif s_x==0:
                x +=1
                c +=1

        elif c==count:
            if (x == X[n] and y ==Y[n]):
                flag = 1
                end=1
            else:
                flag=0
                end =1


if flag == 1:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

N = int(input())
T = [0]*100000
X= [0]*100000
Y= [0]*100000
x = 0
y = 0

for n in range(N):
        T[n],X[n],Y[n] = (map(int, input().split()))

flag = 1
for n in range(N):
    #print(n)
    if flag == 0:
        continue


    if n == 0:
        count = T[n]
    else:
        count = T[n] - T[n-1]
        x = X[n-1]
        y = Y[n-1]
    c = 0
    end = 0
    while True:
        if end == 1:
            break
        s_x = X[n] - x
        s_y = Y[n] - y
    #    print(str(s_x)+' '+str(s_y))

        if ((s_x != 0 or s_y !=0) )and (c!=count):
            if s_x >0:
                x +=1
                c += 1
            elif s_x < 0:
                x -= 1
                c+=1
            elif s_y > 0:
                y +=1
                c += 1
            elif s_y < 0:
                y -= 1
                c+=1
        elif  ((s_x == 0 and s_y == 0) )and (c!=count):
                x +=1
                c +=1
        elif c==count:
            if (x == X[n] and y ==Y[n]):
                flag = 1
                end=1
            else:
                flag=0
                end =1



if flag == 1:
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

#coding:utf-8

n = int(input())
l = []
count = 0

for i in range(n):
    s = str(input())
    if s not in l:
        l.append(s)
        count += 1

print("{}".format(count))

### FIXED CODE ###

#coding:utf-8

n = int(input())
l = []
count = 0

for i in range(n):
    s = str(input())
    l.append(s)

l = set(l)
count = len(l)
print("{}".format(count))
### BUGGY CODE ###

S=input()
Q=int(input())
Query=[list(input().split()) for i in range(Q)]

for i in Query:
    if int(i[0]) == 1:
        S = S[::-1]
    elif int(i[0]) == 2:
        if int(i[1]) == 1:
            tmp = [i[2],S]
            S = ''.join(tmp)
        elif int(i[1]) == 2:
            tmp = [S,i[2]]
            S = ''.join(tmp)
print(S)

### FIXED CODE ###

S=input()
Q=int(input())
Query=[input().split() for i in range(Q)]
bf=''
af=''
Flag=True

for i in range(Q):
    if Query[i][0] == '1':
        Flag = not Flag
    else:
        if Query[i][1] == '1':
            if Flag:
                bf = bf + Query[i][2]
            else:
                af = af + Query[i][2]
        else:
            if Flag:
                af = af + Query[i][2]
            else:
                bf = bf + Query[i][2]

ans = bf[::-1] + S + af

if not Flag:
    ans = ans[::-1]

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

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

dp=[0]*n
for i in range(1,n):
    dp[i]=min([dp[j] + abs(h[i]-h[j]) for j in range(max(i-k,0),i)])
print(dp[-1])


### FIXED CODE ###

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

dp=[0]*n
def calc(n,k,h,dp):
    for i in range(1,n):
        dp[i]=min([dp[j] + abs(h[i]-h[j]) for j in range(max(i-k,0),i)])

calc(n,k,h,dp)
print(dp[-1])
### BUGGY CODE ###

import numpy as np
n,k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [(10**4)*(10**5)]*n
dp[0]=0
for i in range(n-1):
     for j in range(1,min(k+1,n-i)):
#            if i+j>n-1: break
            dp[i+j] = min(dp[i+j],dp[i]+np.abs(h[i]-h[i+j]))
print(dp[n-1])   

### FIXED CODE ###

n,k = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [(10**4)*(10**5)]*n
dp[0]=0
for i in range(n-1):
    loop = min(k+1,n-i)
    for j in range(1,loop):
        dp[i+j] = min(dp[i+j],dp[i]+abs(h[i]-h[i+j])) 
print(dp[n-1])
### BUGGY CODE ###

#155 Poll
import collections
n = int(input())
ans = [input() for _ in range(n)]

c = collections.Counter(ans)
max_k_list = [kv[0] for kv in c.items() if kv[1] == max(c.values())]
max_k_list.sort()
print('\n'.join(max_k_list))

### FIXED CODE ###

#155 Poll
n = int(input())
words = {}
for i in range(n):
    name = input()
    if name not in words:
        words[name] = 1
    elif name in words:
        words[name] += 1

num = max(words.values())
max_k_list = [kv[0] for kv in words.items() if kv[1] == num]
max_k_list.sort()
print('\n'.join(max_k_list))