Harryxun/stf_run huggingface dataset:
[N,L]=[int(x) for x in raw_input().split()]
icelist=[0]
for i in range(N):
    icelist.append(int(raw_input()))
icelist.append(0)
incindex=[]
for i in range(1,N+1):
    if icelist[i]>icelist[i-1] and icelist[i]>icelist[i+1]:
        incindex.append(i)
ans=0
popped=0
while popped<N:
    addindex=[]
    delindex=[]
    t=L-max([icelist[i] for i in incindex])
    ans+=t
    for ii in incindex:
        icelist[ii]+=t
        if icelist[ii]==L:
            popped+=1
            delindex.append(ii)
            icelist[ii]=0
            if ii-1>0:
                if icelist[ii-1]>icelist[ii-2]:
                    addindex.append(ii-1)
            if ii+1<N+1:
                if icelist[ii+1]>icelist[ii+2]:
                    addindex.append(ii+1)
    for k in delindex:
        incindex.remove(k)
    for j in addindex:
        incindex.append(j)
print ans

### FIXED CODE ###

[N,L]=[int(x) for x in raw_input().split()]
icelist=[]
for i in range(N):
    icelist+=[int(raw_input())]
peakindex=[0]
for i in range(1,N-1):
    if (icelist[i]-icelist[i-1])*(icelist[i+1]-icelist[i])<0:
            peakindex.append(i)
peakindex.append(N-1)
ans=0
for i in range(len(peakindex)-1):
    newans=sum([L-icelist[x] for x in range(peakindex[i],peakindex[i+1]+1)])
    ans=max(ans,newans)
print ans
import bisect

X,Y,Z,K = list(map(int,input().split()))
AA = list(map(int,input().split()))
BB = list(map(int,input().split()))
CC = list(map(int,input().split()))
MAX = max(max(AA),max(BB),max(CC))

AB = []
for a in AA:
  for b in BB:
    AB.append(a+b)
    
AB.sort()
XY = X*Y

def check(n):
  cnt = 0
  for c in CC:
    cnt += XY - bisect.bisect_left(AB,n-c)
  return cnt >= K

OK = 0
NG = MAX*3+100
while OK-NG >1:
  mid = (OK+NG)//2
  if check(mid):
    OK = mid
  else:
    NG = mid
    
ans = []
for c in CC:
    n = bisect.bisect_left(AB,n-c)
    for i in range(n,XY):
      ans.append(c+AB[i])
      
ans.sort(reverse=Ture)
for YUI in ans:
  print(YUI)
    

### FIXED CODE ###

import bisect

X,Y,Z,K = list(map(int,input().split()))
AA = list(map(int,input().split()))
BB = list(map(int,input().split()))
CC = list(map(int,input().split()))
MAX = max(max(AA),max(BB),max(CC))

AB = []
for a in AA:
  for b in BB:
    AB.append(a+b)
    
AB.sort()
XY = len(AB)

def check(n):
  cnt = 0
  for c in CC:
    cnt += (XY - bisect.bisect_left(AB,n-c))
  return cnt >= K

OK = 0
NG = MAX*3+100
while NG - OK >1:
  mid = (OK+NG)//2
  if check(mid):
    OK = mid
  else:
    NG = mid
    
    
ans = []
for c in CC:
    n = bisect.bisect_left(AB,OK-c)
    for i in range(n,XY):
      ans.append(c+AB[i])
      
ans.sort(reverse=True)
for YUI in range(K):
  print(ans[YUI])
a, b, c = map(int, input().split())

num1 = 11 // 2

if num <= c:
  print(num)
else:
  print(c)

### FIXED CODE ###

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

num = b // a

if num <= c:
  print(num)
else:
  print(c)
N, M=map(int, input().split())
a = []
for i in range(N):
  b = []
  b = list(map(int, input().split()))
  del b[0]
  a.extend(b)
  
c=Counter(a)
    # すべての要素とその出現回数を取り出します。
freq_scores = c.most_common()
    #c.most_common内の最も多い要素[0]の最大出現回数[1]を[0][1]で指定
max_count = freq_scores[0][1]

modes = []
    　#出現回数と最大出現回数が等しいかを確認します。
for num in freq_scores:
	if num[1] == max_count:
    	modes.append(num[0])

print(len(a[modes]))


### FIXED CODE ###

import collections
import itertools

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

counter = collections.Counter(a)

ret = [letter for letter,count in counter.most_common() if count == counter.most_common()[0][1]]
if N == counter.most_common()[0][1]:
	print(len(ret))
else:
  print(0)
import sys
import os
import math
import itertools
import math
import fraction
from functools import reduce

def gcd(*numbers):
    return reduce(fraction.gcd, numbers)

n = int(input())
nums = [int(i) for i in input().split()]
gcds = []
for num in nums:
    tmp = nums.copy()
    tmp.remove(num)
    gcds.append(gcd(*tmp))
print(max(gcds))


### FIXED CODE ###

a, b, t = map(int, input().split())
print(int((t+0.5)//a)*b)
N=int(input())
A=list(map(int,input().split()))
ans=A[0]
for i in range(len(A)):
    ans*=A[i]

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

### FIXED CODE ###

import sys
N=int(input())
A=list(map(int,input().split()))
if 0 in A:
    print(0)
    sys.exit()


ans=1
for elem in A:
    ans*=elem
    if ans>10**18:
        print(-1)
        sys.exit()
print(ans)
n,d=map(int,inpit().split())
x=2*d+1
print((d+x-1)//x)

### FIXED CODE ###

n,d=map(int,input().split())
x=2*d+1
print((n+x-1)//x)
import numpy as np

N = input().split()

Nsum = list()
op = list()
for i in range(len(N)):
    if N[i].isdigit():
        op.append(float(N[i]))
    else:
        if N[i] == "+":
            opSum = np.sum(op)
            op.clear()
            op.append(opSum)
        elif N[i] == "-":
            sub = op[0]
            for n in op[1:]:
                sub -= n
            op.clear()
            op.append(sub)
        elif N[i] == "*":
            opProd = np.prod(op)
            op.clear()
            op.append(opProd)


print(op[0])

### FIXED CODE ###


o = list()
top = -1
for s in input().split():
    if s.isdigit():
        o.append(int(s))
        top += 1
    else:
        if s is "+":
            n = o[top]+o[top-1]
            o.pop(top)
            top-=1
            o.pop(top)
            top-=1
            o.append(n)
            top+=1
        if s is "-":
            n = o[top-1] - o[top]
            o.pop(top)
            top -= 1
            o.pop(top)
            top -= 1
            o.append(n)
            top+=1
        if s is "*":
            n = o[top]*o[top-1]
            o.pop(top)
            top -= 1
            o.pop(top)
            top -= 1
            o.append(n)
            top+=1


print(o[0])
a,b,c,d = map(int,input().split()) 

import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

cd = lcm(c,d)
b_c = b // c
b_d = b // d
b_cd = b // cd
a_c = a // c
a_d = a // d
a_cd = a // cd

ans = b - b_c - b_d + b_cd - a + a_c + a_d - a_cd

if a % c != 0 and a % d!= 0:
    ans += 1

print(ans)

### FIXED CODE ###

import fractions

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

cd = (c * d) // fractions.gcd(c, d)
b_c = b // c
b_d = b // d
b_cd = b // cd
a_c = a // c
a_d = a // d
a_cd = a // cd

ans = b - b_c - b_d + b_cd - a + a_c + a_d - a_cd

if a % c != 0 and a % d!= 0:
    ans += 1

print(ans)
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
MOD = 10**9 + 7

n = int(input())
edge = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = [int(item) - 1 for item in input().split()]
    edge[a].append(b)
    edge[b].append(a)

childs = [[] for _ in range(n)]
def dfs(p, v):
    val = 1
    for nv in edge[v]:
        if nv == p:
            continue
        ret = dfs(v, nv)
        val += ret
        childs[v].append(ret)
    if val != n:
        childs[v].append(n - val)
    return val

dfs(-1, 0)
total_pattern = pow(2, n, MOD)
total_pattern_inv = pow(total_pattern, MOD-2, MOD)
inv2 = pow(2, MOD-2, MOD)
pow2_table = [1]
for i in range(10**5):
    pow2_table.append(pow2_table[-1] * 2 % MOD)
ans = 0
for line in childs:
    pattern_ok = 0
    if len(line) == 1:
        continue
    for item in line:
        pattern_ok += pow2_table[item] - 1
    pattern_ok += 1
    ans += (total_pattern * inv2 - pattern_ok) * total_pattern_inv
    ans %= MOD
print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
MOD = 10**9 + 7

n = int(input())
edge = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = [int(item) - 1 for item in input().split()]
    edge[a].append(b)
    edge[b].append(a)

childs = [[] for _ in range(n)]
def dfs(p, v):
    val = 1
    for nv in edge[v]:
        if nv == p:
            continue
        ret = dfs(v, nv)
        val += ret
        childs[v].append(ret)
    if val != n:
        childs[v].append(n - val)
    return val

dfs(-1, 0)
total_pattern = pow(2, n, MOD)
total_pattern_inv = pow(total_pattern, MOD-2, MOD)
inv2 = pow(2, MOD-2, MOD)
pow2_table = [1]
for i in range(2 * 10**5):
    pow2_table.append(pow2_table[-1] * 2 % MOD)
ans = 0
for line in childs:
    pattern_ok = 0
    if len(line) == 1:
        continue
    for item in line:
        pattern_ok += pow2_table[item] - 1
    pattern_ok += 1
    ans += (total_pattern * inv2 - pattern_ok) * total_pattern_inv
    ans %= MOD
print(ans)
N = int(input())
Array = []
for i in range(N):
  Array.append(tuple(map(int,input().split())))

res = 0
for i in reversed(range(N)):
  a,b = Array[i]
  a+=res
  res+ = b-a%b
print(res)

### FIXED CODE ###

N = int(input())
Array = []
for i in range(N):
  Array.append(tuple(map(int,input().split())))

res = 0
for i in reversed(range(N)):
  a,b = Array[i]
  a+=res
  res+= ((b-a%b)%b)
print(res)
n = int(input())
count = 0

for i in n:
  if len(i)% != 0:
    count += 1

print(count)

### FIXED CODE ###

n = int(input())
count = 0
 
for i in range(1,n+1):
  if len(str(i))%2 == 1:
    count += 1
 
print(count)
L, R, d = [int(digit) for digit in input()]
c = 0

for i in range(L, R+1):
    if i % d == 0:
        c += 1

print(c)

### FIXED CODE ###

L, R, d = [int(digit) for digit in input().split()]
c = 0

for i in range(L, R+1):
    if i % d == 0:
        c += 1

print(c)
import math
X, Y = map(int, input().split())

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(X,Y))

### FIXED CODE ###

import fractions
X, Y = map(int, input().split())

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(X,Y))
# ABC175 D
import bisect

N,K=map(int,input().split())
P=list(map(int,input().split()))
C=list(map(int,input().split()))

F=[0]*N

def op(n):
    C_n=[]
    P_n=[]
    m=n
    while 1:
        C_n.append(C[m-1])
        P_n.append(m)
        F[m-1]=1
        m=P[m-1]
        if m==n:
            break
    sum_C_n=sum(C_n)
    C_n=C_n[:]+C_n[:]
    n=len(P_n)
    res=[]
    for k in range(1,min(n+1,K)):
        res_k=[]
        sum_k=sum(C_n[:k])
        p=sum_k
        for i in range(n):
            sum_k+=C_n[i+k]-C_n[i]
            p=max(p,sum_k)
        if K-k>=n and sum_C_n>=0:
                p+=sum_C_n*(K-k)//n
        res.append(p)
    return max(res)
    
res=-float('inf')
while 0 in F:
    n=bisect.bisect_right(F,0)
    res=max(op(n),res)
print(res)

### FIXED CODE ###

# ABC175 D
import bisect

N,K=map(int,input().split())
P=list(map(int,input().split()))
C=list(map(int,input().split()))

F=[0]*N

def search(n):
    res=[]
    l=0
    m=n
    tmp_res=0
    isloop=0
    if F[n-1]:
        s,L=F[n-1]
    while 1:
        m=P[m-1]
        tmp_res+=C[m-1]
        l+=1
        if F[n-1]==0:
            res.append((tmp_res,l))
        else:
            res.append(tmp_res+s*((K-l)//L) if s>0 and K>=l else tmp_res)
        if m==n:
            isloop=1
            break
        if l==K:
            break
    if F[n-1]==0:
        if isloop:
            s,L=res[-1]
            if not F[n-1]:
                m=n
                while 1:
                    F[m-1]=(s,L)
                    m=P[m-1]
                    if m==n:
                        break
        else:
            s=-1
        p=max([p+s*((K-k)//len(res)) if s>0 and K>=k else p for p,k in res])
    else:
        p=max(res)
    return p

res=-float('inf')
for i in range(N):
    res=max(res,search(i+1))
print(res)
from collections import Counter
def cmb(n):
    if n < 2:
        return 0
    else:
        return (n * (n-1)) // 2

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

cs = Counter(a)
s = 0

for v in cs.values():
    s += cmb(v)

for a in ls:
    print(s - cmb(cs[a]) + cmb(cs[a] - 1))

### FIXED CODE ###

from collections import Counter
def cmb(n):
    if n < 2:
        return 0
    else:
        return (n * (n-1)) // 2

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

cs = Counter(ls)
s = 0

for v in cs.values():
    s += cmb(v)

for a in ls:
    print(s - cmb(cs[a]) + cmb(cs[a] - 1))
a, b = map(int, input().split())
if a == b : print('Draw')
else :
  if min(a, b) == 1 : flag = TRUE
  if a < b :
    if flag : print('Alice')
    else : print('Bob')
  else :
    if flag : print('Bob')
    else : print('Alice')


### FIXED CODE ###

a, b = map(int, input().split())
if a == b : print('Draw')
else :
  flag = False
  if min(a, b) == 1 : flag = True
  if a < b :
    if flag : print('Alice')
    else : print('Bob')
  else :
    if flag : print('Bob')
    else : print('Alice')
s = input()
q = int(input())
list1 = []
list2 = []
flag = 1
for i in range(q):
    in_line = input().split()
    if in_line[0] == "1":
        flag *= -1
    else:
        if in_line[1] == "1":
            if flag == 1:
                list1.append(in_line[2])
            else:
                list2.append(in_line[2])
        else:
            if flag == 1:
                list2.append(in_line[2])
            else:
                list1.append(in_line[2])
if flag == 1:
    print("".join(list1[::-1]) + s + "".join(list2))
else:
    print("".join(list2[::-1]) + s + "".join(list1))


### FIXED CODE ###

s = input()
if "AB" in s or "BA" in s:
    print("Yes")
else:
    print("No")
import numpy as np

h, n = map(int, input().split())
a, b = zip(*[tuple(map(int, input().split())) for _ in range(n)])

npa, npb = np.array(a), np.array(b)
dp = np.zeros(h+1)
for i in range(1, h+1):
    dp[i] = np.min(dp[i-npa] + npb)

print(int(dp[h]))

### FIXED CODE ###

import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=np.int)
for i in range(1, h+1):
    dp[i] = np.min(dp[np.maximum(i-a, 0)] + b)

print(dp[h])
h,w = map(int,input().split())
a = [""]*h
for i in range(h):
  a[i] = input()

row = [False]*h
column = [False]*w

for i in range(h):
  for j in range(w):
    if a[i][j] = "#":
      row[i] = True
      column[j] = True

for i in range(h):
  if row[i]:
    for j in range(w):
      if column[j]:
        print(a[i][j],end = "")
    print()
        
    
      


### FIXED CODE ###

h,w = map(int,input().split())
a = [""]*h
for i in range(h):
  a[i] = input()

row = [False]*h
column = [False]*w

for i in range(h):
  for j in range(w):
    if a[i][j] == "#":
      row[i] = True
      column[j] = True

for i in range(h):
  if row[i]:
    for j in range(w):
      if column[j]:
        print(a[i][j],end = "")
    print()
s=input()
a=0
z=0
i=0
j=len(s)-1
while a==0:
    if s[i]=="a":
        a=1
    else:
        i+=1
while z==0:
    if s[j]=="z":
        z=1
    else:
        j-=1
print(j-i+1)



### FIXED CODE ###

s=input()
a=0
z=0
i=0
j=len(s)-1
while a==0 :
    if s[i]=="A":
        a=1
    else:
        i+=1
while z==0:
    if s[j]=="Z":
        z=1
    else:
        j-=1
print(j-i+1)
a,b=raw_input().split()
s=["1","2","3"]
s.remove(x)
s.remove(y)
print s[0]

### FIXED CODE ###

a=input()
b=input()
if a==1 and b==2:
  print "3"
elif a==2 and b==3:
  print "1"
elif a==3 and b==1:
  print "2" 
elif a==3 and b==2:
  print "1"
elif a==2 and b==1:
  print "3"
else:
  print "2"
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

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

    def same(self, x, y):
        return self.find(x) == self.find(y)

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

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _i in range(m)]

uf = UnionFind(n)
for i, j in ab:
    uf.union(i, j)
print(uf.group_count()-1)

### FIXED CODE ###

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

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

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

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

    def same(self, x, y):
        return self.find(x) == self.find(y)

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

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _i in range(m)]

uf = UnionFind(n)
for i, j in ab:
    uf.union(i-1, j-1)
print(uf.group_count()-1)
N = int(input())
*A,=map(int,input().split())
A = sorted(A)

if N == 1:
  print(1)
  exit()

flag = [0]*(10**6+5)
for i in range(N):
  flag[A[i]] = 1

for i in range(N):
  if flag[A[i]] == 0:
    continue
  if i>0 and A[i]==A[i-1]:
    flag[A[i]] = 0
    continue
  for num in range(A[i]*2,A[-1]+A[i],A[i]):
    flag[num] = 0
  
print(sum(flag))

### FIXED CODE ###

N = int(input())
*A,=map(int,input().split())
A = sorted(A)

if N == 1:
  print(1)
  exit()

flag = [0]*(10**6+5)
for i in range(N):
  flag[A[i]] = 1

for i in range(N):
  if flag[A[i]] == 0:
    continue
  if i>0 and A[i]==A[i-1]:
    flag[A[i]] = 0
    continue
  for num in range(A[i]*2,A[-1]+1,A[i]):
    flag[num] = 0
  
print(sum(flag))
n = int(input())
h = list(map(int, input().split()))
ans = []
x = 0
for i in range(n):
  ans.append(0)
  while h[i] >= h[i + 1]:
    ans[x] += 1
    i += 1
  x += 1
print(max(ans))


### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
i = 0
count = 0
ans = []
while i < n - 1:
  if h[i] < h[i + 1]:
    ans.append(count)
    count = 0
  else:
    count += 1
  i += 1
ans.append(count)
print(max(ans))
n = int(input())
s = input()

for i in range(n - 1):
    
    if s[i] == 'W':
        w_e[i + 1] = w_e[i] + 1
    else:
        w_e[i + 1] = w_e[i] + 0

for i in range(n - 2, -1, -1):
    if s[i + 1] == 'E':
        e_w[i] = e_w[i + 1] + 1
    else:
        e_w[i] = e_w[i + 1] + 0

for i in range(n):
    ans.append(w_e[i] + e_w[i])

print(min(ans))

### FIXED CODE ###

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

w_e = [0] * n
e_w = [0] * n
ans = []

for i in range(n - 1):
    if s[i] == 'W':
        w_e[i + 1] = w_e[i] + 1
    else:
        w_e[i + 1] = w_e[i] + 0

for i in range(n - 2, -1, -1): 
    if s[i + 1] == 'E':
        e_w[i] = e_w[i + 1] + 1
    else:
        e_w[i] = e_w[i + 1] + 0

for i in range(n):
    ans.append(w_e[i] + e_w[i])

print(min(ans))
a = input()

cnt = 0
sakki5 = False
for s in a:
    if int(s) < 6:
        cnt += int(s)
        sakki6 = False
        if int(s) == 5:
            sakki5 = True
    else:
        cnt += 11 - int(s)
        if sakki6:
            cnt -= 2
        if sakki5:
            cnt -= 1
        sakki6 = True
        sakki5 = False
print(cnt)

### FIXED CODE ###

s = input()
state = [0, 1]
for i in s:
    n = int(i)
    state_new = [min(state[0] + n, state[1] + 10 - n), 
                 min(state[0] + n + 1, state[1] + 9 - n)]
    state = state_new
print(state[0])
from scipy.sparse import coo_matrix, csgraph
N, M = map(int, input().split())
points = tuple(tuple(map(lambda n: int(n) - 1, input().split())) for _ in range(M))
matrix = coo_matrix(([1] * M, zip(*points)), shape=(N, N)).toarray()
total = 0
for point in points:
    matrix[point] = 0
    total += csgraph.connected_components(matrix, directed=False, return_labels=False) != 1
    matrix[point] = 1
print(total)

### FIXED CODE ###

from scipy.sparse import coo_matrix, csgraph
N, M = map(int, input().split())
points = tuple(tuple(map(lambda n: int(n) - 1, input().split())) for _ in range(M))
matrix = coo_matrix(([1] * M, tuple(zip(*points))), shape=(N, N)).toarray()
total = 0
for point in points:
    matrix[point] = 0
    total += csgraph.connected_components(matrix, directed=False, return_labels=False) != 1
    matrix[point] = 1
print(total)
x = int(input())
ans = 1
for i in range(x, 0, -1):
  m = i
  div = []
  for j in range(2,int(m**0.5)+2):
    if m%j==0:
      count = 0
      while m%j ==0:
        m //= j
        count += 1
      div.append(count)
  if m!= 1:
    div.append(1)
  count = div[0]
  for c in div:
    if c!= count or count ==1:
      break
  else:
    print(i)
    exit()
print(ans)



### FIXED CODE ###

x = int(input())
if x==1:
  print(1)
  exit()
ans = 1
for i in range(x, 0, -1):
  m = i
  div = []
  for j in range(2,int(m**0.5)+2):
    if m%j==0:
      count = 0
      while m%j ==0:
        m //= j
        count += 1
      div.append(count)
  if m!= 1:
    div.append(1)
  count = div[0]
  for c in div:
    if c!= count or count ==1:
      break
  else:
    print(i)
    exit()
print(ans)
N_s = input()
N = int(N_s)
ans = 0
for i in range(1, len(N_s)):
	if i % 2 == 1:
    	ans += 10**i - 10**(i - 1)
if len(N_s) % 2 == 1:
  	ans += 1 + N - 10**(len(N_s) - 1) 
print(ans)


### FIXED CODE ###

n = int(input())
cnt = 0
for i in range(1, n + 1):
  if len(str(i)) % 2 == 1:
    cnt +=1
print(cnt)
a,b,c = map(int,input().split())
if a+b = c:
  print("Yes")
elif b+c = a:
  print("Yes")
elif c+a=b:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b == c:
  print("Yes")
elif b+c == a:
  print("Yes")
elif c+a== b:
  print("Yes")
else:
  print("No")
import sys
print(len(set(sys.input().read().strip().split())))

### FIXED CODE ###

import sys
input(), print(len(set(sys.stdin.read().strip().split())))
import collections

N=int(input())
data=[input() for i in range(N)]
c = collections.Counter(data)
score=c
com=c.most_common()
#val=c.values()
#dada=list(val)
#dada.sort()
score_sorted = sorted(score.items(), key=lambda x:x[1], reverse=True)
#print(val)
#val.sort()
#print(dada)
#print(score_sorted)
val=score_sorted
#print("val==",val)
#key=score_sorted.keys()
#dada=list(val)
#dada.sort()
count="Yes"
ii=0
ansa=1
while count=="Yes":
    if val[ii][1]==val[ii+1][1]:
        ii+=1
        ansa+=1
    else:
        count="No"
data2=[]
for i in range(ansa):
    data2.append(val[i][0])
    #print(i,data2)
data2.sort()
for i in range(ansa):
    print(data2[i])

### FIXED CODE ###

import collections

N=int(input())
data=[input() for i in range(N)]
c = collections.Counter(data)
score=c
com=c.most_common()

score_sorted = sorted(score.items(), key=lambda x:x[1], reverse=True)

val=score_sorted
L=len(val)
count="Yes"
ii=0
ansa=1
if L==1:
    print(val[0][0])
else:
    while count=="Yes":
        if val[ii][1]==val[ii+1][1]:
            ii+=1

            ansa+=1
            if ii == L-1:
                break
        else:
            count="No"
    data2=[]
    for i in range(ansa):
        data2.append(val[i][0])

    data2.sort()
    for i in range(ansa):
        print(data2[i])
S = list(input())
T = list(input())

ans = 0
for i in range(len(S)):
  if s[i] != T[i]: ans += 1
print(ans)

### FIXED CODE ###

S = list(input())
T = list(input())
 
ans = 0
for i in range(len(S)):
  if S[i] != T[i]: ans += 1
print(ans)