peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A.sort()
exist_flags = [0] * (10 ** 6)
for a in A:
    if exist_flags[a - 1] > 0:
        exist_flags[a - 1] += 1
    else:
        # for i in range(a, 25, a):
        for i in range(a, 10 ** 6 + 1, a):
            exist_flags[i - 1] += 1


ans = 0
for a in A:
    if exist_flags[a - 1] == 1:
        ans += 1
print(ans)
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))

MAX_N = max(A)+1
cnt = [0] * MAX_N 

for a in A:
  for i in range(a, MAX_N, a):
    if cnt[i] >= 2: break 
    cnt[i] += 1
      
ans = 0
for a in A:
  if cnt[a] == 1: ans += 1
print(ans)
# Judge status: Accepted
from math import gcd
n = int(input())

time = list(int(input()) for _ in range(n))

ans = time[0]

for i in range(1,n):
    ans = (ans * time[i]) // gcd(ans, time[i])

print(int(ans))
# Judge status: Wrong Answer
n=int(input())
s=""
while n:
    print(n)
    s=str(n&1)+s
    n=-(n>>1)
    print(s)
print(s if s else 0)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
ans=0
for i in range(N):
    if A[i]<=B[i]:
        ans+=A[i]
        B[i]-=A[i]
        if A[i+1]<=B[i]:
            ans+=A[i+1]
            A[i+1]=0
        else:
            ans+=B[i]
            A[i+1]-=B[i]
    else:
        ans+=B[i]
print(ans)
# Judge status: Accepted
MOD = 10 ** 9 + 7

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

if (X + Y) % 3 != 0:
    print(0)
    exit()

a = (2 * X +   - Y) // 3
b = (  - X + 2 * Y) // 3


if a < 0 or b < 0:
    print(0)
    exit()

#calculate (a+b)!/a!b!

fac = [1, 1]
for i in range(2, a+b+1):
    fac.append(fac[-1] * i % MOD)

print(fac[a+b] * pow(fac[a] * fac[b], MOD-2, MOD) % MOD)
# Judge status: Accepted
S = input()
T = input()

cnt = []
for i in range(len(S)-len(T)+1):
    unmch = 0
    for j, t in enumerate(T):
        if t != S[i+j]:
            unmch +=1     
    cnt += [unmch]

print(min(cnt))
# Judge status: Accepted
S = input()

if S == "SSS":
    print(0)
if S == "RSS":
    print(1)
if S == "RRS":
    print(2)
if S == "RRR":
    print(3)
if S == "SRS":
    print(1)
if S == "SSR":
    print(1)
if S == "SRR":
    print(2)
if S == "RSR":
    print(1)
# Judge status: Accepted
n,_=map(int,input().split())
s=set(input().split())
while s&set(str(n)): n+=1
print(n)
# Judge status: Accepted
import math
from collections import defaultdict


def trial_division(n):
    factor = defaultdict(int)
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor[num] += 1
    factor[n] += 1
    if 1 not in factor.keys():
        factor[1] += 1
    return factor


a, b = map(int, input().split())
ans = 0
for i in trial_division(a).keys():
    if i in trial_division(b).keys():
        ans += 1
print(ans)
# Judge status: Accepted
S = input()
M = {'a':0,'b':0,'c':0}
for s in S:
    M[s] += 1
L = sorted(M.values(),key=lambda x: -x)
if len(L) == 1:
    if L[0] == 1:
        print('YES')
    else:
        print('NO')
elif len(L) == 2:
    print('NO')
else:
    if L[0] - L[2] > 1:
        print('NO')
    else:
        print('YES')
# Judge status: Accepted
a, b, c = [int(x) for x in input().split()]
print(max(c - a + b, 0))
# Judge status: Wrong Answer
X=int(input())
i=1
while (X+(i**5))**(1/5)-int((X+(i**5))**(1/5))>10**(-8):
    i+=1
    if X<i:
        i=-1
        while (X+(i**5))**(1/5)-int((X+(i**5))**(1/5))>10**(-8):
            i-=1
        break
print("{} {}".format(int((X+(i**5))**(1/5)), i))
# Judge status: Wrong Answer
s="".join(sorted(list(input())))
t="".join(sorted(list(input()),reverse=True))

print("Yes" if [s,t]==sorted([s,t]) else "No")
# Judge status: Accepted
data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#print(ord("A"))
#print(ord("Z")-65)

n=int(input())
a=input()
ans=""
for i in a:
  p = (ord(i)-65+n)%26
  ans+=data[p]
print(ans)
# Judge status: Accepted
import math
a, b, n = map(int, input().split())
ans = -float('inf')
n = min(b-1, n)
f1 = math.floor(a*n/b)
f2 = math.floor(n/b)
ans = f1-(a*f2)
print(ans)
# Judge status: Accepted
A,B,C,K=map(int, input().split())
print(B-A if K&1 else A-B)
# Judge status: Wrong Answer
k, n = map(int, input().split())
a = list(map(int, input().split()))

x = 0
index = 0

for i in range(n-1):
    if x < a[i+1] - a[i]:
        x = a[i+1] - a[i]
        index = i

if x < k-a[-1]+a[0]:
    x = k-a[-1]+a[0]

print(k - x,k,  x,k-a[-1]+a[0])
# Judge status: Accepted
score = int(input())
answer = 0
for i in range(3):
    if int(score/(10**i))%10 == 7:
        answer = 1
        break
if answer == 1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
result = []
for i in range(1, N+1):
    bin_i = bin(i)
    bin_i_c = bin_i.count("0")-1
    result.append(bin_i_c)
sorted_result = sorted(result, reverse = True)
print(2 ** sorted_result[0])
# Judge status: Accepted
N,M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()
index = []
ans = 0
s = 0
for i in range(len(X)-1):
    index.append([i,X[i+1]-X[i]])
index.sort(key=lambda x: x[1],reverse=True)
if N<M:
    for i in range(N-1,len(index)):
        ans += index[i][1]

print(ans)
# Judge status: Accepted
s = input()

l = int(s[0:2])
r = int(s[2:4])

if (l == 00 and r == 00) or (l>12 and r > 12) or (l == 00 and r > 12) or(l > 12 and r == 00):
    print("NA")
elif l > 12 and r < 13:
    print("YYMM")
elif l < 13 and r > 12:
    print("MMYY")
elif l == 00 and r < 13:
    print("YYMM")
elif l < 13 and r == 00:
    print("MMYY")
elif l <= 12 and r <= 12:
    print("AMBIGUOUS")
# Judge status: Accepted
n, k, q = map(int,input().split())
ls = [0 for i in range(n)]

for i in range(q):
    a = int(input()) - 1
    ls[a] += 1

for i in range(n):
    if q - ls[i] >= k:
        print("No")
    else:
        print("Yes")
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
O = [i for i in range(N) if(i%2==1 and A[i]%2==1)]
print(len(O))
# Judge status: Wrong Answer
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]

ans = [0 for _ in range(n)]
one = False
for x in sc:
    p = x[0]-1
    if p == 0:
        one = True
    if ans[p] == 0 or ans[p] >= x[1]:
        ans[p] = x[1]
if not one:
    print(-1)
    exit()
num = ''
for x in ans:
    num += str(x)
print(int(num) if len(str(int(num))) == n else -1)
# Judge status: Accepted
n = int(input())
l = [0] * 1000001
count = 1
while not l[n]:
    l[n] = 1
    n = 3 * n + 1 if n & 1 else n >> 1
    count += 1
print(count)
# Judge status: Accepted
def main():
    n,m=map(int,input().split())
    CARD=[0]*(n+1)
    for i in range(m):
        L,R=map(int,input().split())
        CARD[L-1]+=1
        CARD[R]-=1
    ans=0
    for i in range(n):
        if CARD[i]==m:ans+=1
        CARD[i+1]=CARD[i+1]+CARD[i]

    print(ans)

if __name__=='__main__':
    main()
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(1000000)

N = int(input())
sum = 0

for i in range(N):
  if i % 15 != 0 and i % 3 != 0 and i % 5 != 0:
    sum += i

print(sum)
# Judge status: Accepted
a,b = map(int, input().split())
print(max(2*a-1,2*b-1)) if a!=b else print(a+b)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

A_plus = []
A_zero = []
A_minus = []

a_abs_min = 10**10

for a in A:
    if a > 0:
        A_plus.append(a)
    elif a == 0:
        A_zero.append(a)
    else:
        A_minus.append(a)
        
    if abs(a) < a_abs_min:
        a_abs_min = abs(a)
        
if len(A_minus)%2 == 0:
    ans = sum(A_plus)-sum(A_minus)
else:
    ans = sum(A_plus)-sum(A_minus) - 2*a_abs_min
print(ans)
# Judge status: Accepted
s = list(input())
for i in range(7):
    if "".join(s[:i] + s[-(7 - i):]) == "keyence":
        print("YES")
        exit()
print("YES" if "".join(s[:7]) == "keyence" else "NO")
# Judge status: Accepted
from collections import Counter
def main():
    S = input()
    T = input()
    s = sorted(Counter(S).values())
    t = sorted(Counter(T).values())
    return 'Yes' if s == t else 'No'

print(main())
# Judge status: Accepted
from collections import Counter
N,K=map(int,input().split())
A=Counter(input().split())
print(sum(sorted(A.values(), reverse=True)[K:]))
# Judge status: Accepted
import sys

stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    A = nl()
    mod = 10 ** 9 + 7
    s = sum(A)
    q = sum([a ** 2 for a in A])
    ans = (((s * s) - q)) // 2
    print(int(ans % mod))


if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,c = map(int,input().split())

print(min(int(b/a),c))
# Judge status: Accepted
X, N = map(int, input().split())
P = sorted(list(map(int, input().split())))
ans = -1
diff = 100000
for i in range(-10,110):
    if i in P: continue
    if diff > abs(i-X):
        diff = abs(i-X)
        ans = i
print(ans)
# Judge status: Wrong Answer
N = int(input())
*A, = map(int,input().split())

mod = 10**9+7

def gcd(x,y):
    if y==0: return x
    return gcd(y,x%y)

lcm = A[0]
for a in A[1:]:
    lcm = (lcm*a)*pow((gcd(lcm,a)),mod-2,mod)

ans = 0
for a in A:
    ans += lcm*pow(a,mod-2,mod)
    ans %= mod
print(ans)
# Judge status: Wrong Answer
def total(n):
  return 1/2 * n * (n + 1)

n = int(input())
print(total(n))
# Judge status: Accepted
A, B = map(int,input().split())

count = 0
for i in range(A,B+1):
  if str(i) == str(i)[::-1]:
    count += 1

print(count)
# Judge status: Accepted
a, b, c = [int(w) for w in input().split()]

print(c, a, b)
# Judge status: Wrong Answer
n= int(input())
ac=str("AC X")
wa=str("WA X")
tle=str("TLE X")
re=str("RE X")
a=0;b=0;c=0;d=0
for i in range(n):
    p=input()
    if(p=="AC"):
        a+=1
    if(p=="WA"):
        b+=1
    if (p == "TLE"):
        c += 1
    if (p == "RE"):
        d += 1
print(ac,a)
print(wa,b)
print(tle,c)
print(re,d)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = sum(A)
cnt = 0
for i in range(N-1):
    B -= A[i]
    cnt += A[i]*B

print(cnt%((10**9)+7))
# Judge status: Accepted
a,b=input().split()
A=int(a)
B=int(b)
p=a*B
q=b*A
ans=[p,q]
ANS=sorted(ans)
print(ANS[0])
# Judge status: Accepted
import sys
import collections
import bisect as bs
input=sys.stdin.readline
n,m=map(int,input().split())
d=collections.defaultdict(list)
L=[]
for i in range(m):
    a,b=map(int,input().split())
    L.append((a,b))
for x,y in sorted(L):
    d[x].append(y)
for x,y in L:
    z=bs.bisect(d[x],y)
    print("%06d%06d"%(x,z))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
md = 1000000007

num = 0
a.sort(reverse=True)
for i in range(n, 2*n):
    num += a[i]
print(num)
# Judge status: Accepted
x, a, b,  = map(int, input().split())

sum_number = []

for i in range(x+1):
  if a <= sum(map(int, str(i))) <= b:
    sum_number += [i]
    
print(sum(sum_number))
# Judge status: Wrong Answer
s = input()
t = input()
ans = 'UNRESTORABLE'
for i in range(len(s)-len(t), -1, -1):
    for j in range(len(t)):
        if s[i+j] != '?' and s[i+j] != t[j]:
            ans = (s[:i] + t + s[i+len(t):]).replace('?', 'a')
            break
print(ans)
# Judge status: Accepted
n,m = map(int,input().split())
x = []
c = 0
for i in range(n):
    a = list(map(int,input().split()))
    a.pop(0)
    x.extend(a)

for j in range(1,m+1):
    if x.count(j) == n:
        c += 1

print(c)
# Judge status: Accepted
s = list(input())
ll = len(s)
ans = 0
for i in range(len(s)):
    s = s[0: len(s)-1]
    if len(s)%2 == 0:
        r = s[0:len(s)//2]
        l = s[len(s)//2:]
        if r == l:
            ans = i + 1
            break
print(ll-ans)
# Judge status: Wrong Answer
N = int(input())
a, w, t, r = 0, 0, 0, 0
for i in range(N):
    S = input()
    if S == 'AC':
        a += 1
    elif S == 'WA':
        w += 1
    elif S == 'TLE':
        t += 1
    else:
        r += 1
print('AC * ' + str(a))
print('WA * ' + str(w))
print('SLE * ' + str(t))
print('RE * ' + str(r))
# Judge status: Wrong Answer
D,T,S = map(int,input().split())
if D/S<T:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
n = input()
if(n[0] == n[1] == n[2] or n[1] == n[2] == n[3]):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x = str(input(""))

lists = []

lists.append(x)

y = x[-1]

if y != "s":

    addd = x + "s"

else:

    addd = x + "es"

print(addd)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))

ans=[0]*(N+1)

for i in range(N,0,-1):
    cnt=0
    for j in range(i*2,N+1,i):
        cnt+=ans[j]
    ans[i]=cnt&1^A[i-1]

print(sum(ans))
for i in range(1,N+1):
    if ans[i]:
        print(i,end=' ')
# Judge status: Accepted
import sys
import collections

n = int(sys.stdin.readline().strip())
data = []

for x in range(n):
    data.append(input())

print(len(collections.Counter(data)))
# Judge status: Wrong Answer
a, b = map(int, input().split())
if (a * b) % 2 == 0:
    print("even")
else:
    print("odd")
# Judge status: Accepted
a, b, c, d = map(int, input().split())

ans = b*d
ans = max(ans, a*d)
ans = max(ans, b*c)
ans = max(ans, a*c)

print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
P=sorted(map(int,input().split()))
print(sum(P[:k]))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))

ans = [False] * 8
tmp = 0
for i in a:
    if i > 3199:
        tmp += 1
    else:
        ans[i//400] = True
print(min(sum(ans),1),sum(ans)+tmp)
# Judge status: Accepted
import sys
INF = 10 ** 10
MOD = 10 ** 9 + 7
from functools import lru_cache
sys.setrecursionlimit(100000000)

def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    ans = 0
    for i in range(n):
        ans += a[i]//2
        if i != n - 1:
            if a[i]%2 == 1 and a[i + 1] > 0:
                ans += 1
                a[i + 1] -= 1
    
    print(ans)
if __name__ =='__main__':
    main()
# Judge status: Accepted
n = int(input())
a = [int(input()) for _ in range(n)]
a_sort = sorted(a,reverse=True)
m1 = a_sort[0]
m2 = a_sort[1]
for i in range(n):
  if a[i] == m1:
    print(m2)
  else:
    print(m1)
# Judge status: Accepted
import sys
N,K,Q = map(int,input().split())
if K > Q:
    for i in range(N):
        print('Yes')
    sys.exit(0)
else:
  res = dict()
  for i in range(N+1):
      res[i] = 0
  for i in range(Q):
    answ = int(input())
    if answ not in res:
      res[answ] = 0
    res[answ] += 1
res2 = [answ[0] for answ in res.items() if answ[1] >= (Q-K+1)]
for i in res2:
    res[i] = -1
for i in range(1,N+1):
    if (res[i] == -1):
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
n=int(input())
if n==0:
    print(0)
    exit()
ans=''
for i in range(30):
    if n%(2**(i+1))!=0:
        n-=(-2)**i
        ans='1'+ans
    else:
        ans='0'+ans
    if n==0:
        break
if ans[0]!='0':
    print(ans)
else:
    print(ans[1:])
# Judge status: Wrong Answer
a,b = list(map(int,input().split()))
if a<b and b%2!=0:
    a=((b//a)+1)
    print(a)
if a<b and b%2==0:
    a=((b//a))
    print(a)
elif a>b:
    print(b)
elif a ==b:
    print(b//a)
# Judge status: Wrong Answer
def main():
    target_num = input()
    target_list = input().split()

    target_list.sort(reverse=True)

    result_a = 0
    result_b = 0
    a_flg = True
    for target in target_list:
        if a_flg:
            result_a += int(target)
            a_flg = False
        else:
            result_b += int(target)
            a_flg = True

    print(result_a - result_b)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N,K,Q = map(int,input().split())

correct = [0]*N

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

print(correct)

for i in range(N):
    score = K - (Q-correct[i])
    if score <= 0:
        print("No")
    else:
        print("Yes")
# Judge status: Accepted
s = input()
t = input()
for i in range(len(s)):
    if s[i] != t[i]:
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
n = int(input())
jyoushis = list(map(int, input().split()))

nums = 1
cnt = 0
top = 1
for jyoushi in jyoushis:
  if top == jyoushi:
    cnt+=1
  else:
    print(cnt)
    top = jyoushi
    cnt = 1
    nums+=1
print(cnt)
if nums < n:
  sabun = n - nums
  for i in range(sabun):
    print(0)
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, M = map(int, input().split())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

res = 0
div = make_divisors(M)
for x in div:
  if M // x >= N: res = max(res, x)
print(res)
# Judge status: Accepted
import fractions
a, b = map(int, input().split())
print(int(a*b/fractions.gcd(a,b)))
# Judge status: Accepted
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))


def solve():
    n = ri()
    n -= 1
    out = ""
    while n >= 0:
        n, r = divmod(n, 26)
        n -= 1
        out = chr(ord('a') + r) + out
    print (out)






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()
# Judge status: Wrong Answer
A, B = map(int, input().split())

print((B - A )*( B - A +1)/2 - B )
# Judge status: Wrong Answer
ans = []
n = int(input())
while(n!=0):
    x = n % 26
    n //= 26
    ans.append(chr(97+x-1))

ans.reverse()
print(''.join(ans))
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a==1 and b!= 1:
    a += 13
    if a>b:
     print('Alice')
    elif b>a:
     print('Bob')
    else:
     print('Draw')
elif b==1 and a!= 1:
    a += 13
    if a>b:
     print('Alice')
    elif b>a:
     print('Bob')
    else:
     print('Draw')
elif a==1 and b== 1:
     print('Draw')
else:
    if a>b:
     print('Alice')
    elif b>a:
     print('Bob')
    else:
     print('Draw')
# Judge status: Wrong Answer
import math
X=int(input())

print(1+math.floor((math.log(X+1, 10)-2)/math.log(1.01, 10)))
# Judge status: Accepted
def resolve():
    '''
    code here
    '''
    N = int(input())
    s = input()
    t = input()

    cnt = 0
    for i in range(N):
        if i == 0:
            if s[-1] == t[0]:
                cnt = 1
        else:
            if s[-1* (i+1):] == t[:(i+1)]:
                cnt = i + 1
    
    print(2*N - cnt)

if __name__ == "__main__":
    resolve()
# Judge status: Accepted
n = int(input())
li = []
for _ in range(n):
    li.append([int(i) for i in input().split()])
dp = [[-1,-1,-1] for x in range(n)]
for i in range(3):
    dp[0][i] = li[0][i]

for i in range(1,n):
    for j in range(3):
        dp[i][j] = max(dp[i-1][(j+1)%3]+li[i][j],dp[i-1][(j+2)%3]+li[i][j])

print(max(dp[n-1]))
# Judge status: Accepted
a,b,c=map(int,input().split())
if a<=b:
  if a <= c and c <= b:
    print("Yes")
  else:
    print("No")
elif b < a:
  if b <= c and c <= a:
    print("Yes")
  else:
    print("No")
# Judge status: Wrong Answer
A,B,C,D=list(map(int, input().split()))
ma=max(A,B)
mi=min(C,D)
print(mi-ma)
# Judge status: Wrong Answer
import numpy as np
N, M = map(int, input().split())
c = []
for _ in range(M):
    a, b= map(int, input().split())
    c.append(a)
    c.append(b)

C = np.zeros((N,1),dtype = 'int')
for i in range(len(C)):
    C[i,0] = c.count(i+1)
print(C)
# Judge status: Accepted

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

print(-(-n//(2*d+1)))
# Judge status: Accepted
N, M = map(int,input().split())
list1 = [tuple(map(int,input().split())) for _ in range(M)]
list2 = [None for _ in range(N)]
imp = False
for nums in list1:
  s, c= nums[0]-1, nums[1]
  if list2[s] == c or list2[s] == None:
    list2[s] = c
  else:
    imp = True
if list2[0] == None:
  if N ==1:
    list2[0] = 0
  else:
    list2[0] = 1

if (list2[0] == 0 and N != 1) or imp:
  print(-1)
else:
  for s in list2:
    if s == None:
      s = 0
    print("{}".format(s),end='')
# Judge status: Accepted
s=input()
k=len(s)
for i in range(1,k+1):
  s=s[0:-1]
  if len(s)%2==0 and s[0:len(s)//2]==s[len(s)//2::]:
    print(len(s))
    exit()
# Judge status: Wrong Answer
n, m = map(int, input().split())

graph = [[] for _ in range(n+1)]

for i in range(m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

# bfs
milestone = [0] * (n+1)
q = []
q.append(1)
while len(q) != 0:
    for i in graph[q[0]]:
        if milestone[i] == 0:
            milestone[i] = q[0]
            q.append(i)
    q.pop(0)

for i in range(2, n+1):
    print(milestone[i])
# Judge status: Accepted
n=int(input())
l=[input() for  i in range(n)]
if len(set(l))!=n:print("No");exit()
h=l[0][0]
for i in l:
  if h==i[0]:h=i[-1]
  else:print("No");exit()
print("Yes")
# Judge status: Accepted
D, N = map(int, input().split())
ans = 100 ** D * N
if N == 100:
    ans += 100 ** D
print(ans)
# Judge status: Wrong Answer
a,b,c = map(int, input().split())

if a <= c <= b:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
def solve():
    s = input()
    t = input()
    a = len(s)
    b = len(t)
    if b > a +1:
        print("NO")
    elif t > s:
        print("Yes")
    else:
        print("No")
    

if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
a, b, k = map(int, input().split())
if k > b-a :
    k = b-a

for i in range(a, a+k):
    print(i)

for i in range(b-k+1 if b-k+1 > a+k else a+k, b+1):
    print(i)
# Judge status: Wrong Answer
# coding: utf-8
# Your code here!

import collections

n = int(input())
c = collections.Counter([input() for i in range(n)])
m = max(c.values())
k = list(c.keys())
v = list(c.values())
for i in range(len(c)):
    if v[i] == m:
        print(k[i])
# Judge status: Accepted
a, b, c, d= map(int,input().rstrip().split())
if abs(a-c)<=d:
    print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s = list(input())
c = 0
for i in range(len(s)-1):
    if s[i] == "h" and s[i+1] == "i":
        c += 1
if c >= 1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
if(n%9==0):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# coding: utf-8
# Your code here!
line = list(map(int,input().split()))
a=line.index(0)
print(a+1)
# Judge status: Accepted
"""everything has a cost!"""

from math import *
import random, functools, collections, sys

__author__ = 'p7x'


# sys.stdin = open('in.txt', 'r')
# sys.stdout = open('out.txt', 'w')
# sys.stderr = open('err.txt', 'w')


if __name__ == '__main__':
    s = input()
    t = input()
    cnt = 0
    for i in range(len(s)):
        if (s[i] != t[i]): cnt += 1
    print(cnt)
# Judge status: Wrong Answer
str=input()
ans=[]
head,end=0,0

for i,val in enumerate(str):
	if val=='A':
		head=i
		ans.append(val)  
		continue
	elif val is not 'Z':
		ans.append(val)
		end=i
		continue
	elif val is 'Z':
		break
answer= ''.join(ans)
print(answer[head:end+1])
# Judge status: Accepted
from heapq import heappush, heappop

n,m = map(int,input().split())
heap = []

for i in map(int,input().split()):
    heappush(heap,i)

bc = [list(map(int, input().split())) for _ in range(m)]
bc.sort(key = lambda x: -x[1])

for b,c in bc:
    for j in range(b):
        a = heappop(heap)
        if a < c:
            heappush(heap,c)
        
        else:
            heappush(heap, a)
            break
        
print(sum(heap))
# Judge status: Accepted
import numpy as np
N=int(input())
six=[1]
nine=[]
for i in range(1,N):
  six.append(6**i)
  nine.append(9**i)
  if 6**i>N:
    break
six=np.array(six)
nine=np.array(nine)
L=np.concatenate([six,nine])    
now=N
count=0
dp=np.ones(N+L.max()+1)*np.inf
dp[1]=1
dp[0]=0
#dp[i+1]　iをちょうど引き出すのに必要な最小回数
for i in range(1,N):
  dp[i+1]=(dp[i-L+1]+1).min()

  
print(int(dp[N]))
#print(len(L))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print(a+b+c-min(a,b,c))
# Judge status: Accepted
from fractions import gcd
n=int(input())
a=list(map(int,input().split()))
g=a[0]
for i in range(1,n):
    g=gcd(g,a[i])
print(g)