peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
import math
import bisect
import re

def solve():
    s = input()
    t = input()
    s = ''.join(sorted(s))
    t = ''.join(sorted(t, reverse=True))
    return s < t

def main():
    if solve():
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

n = input().rstrip("\r\n")
for i in range(1, 10):
    ans = "Yes" if n.count(str(i)*3)>0 else "No"
    if (ans == "Yes"):break
print(ans)
# Judge status: Wrong Answer
N,A,B=map(int,input().split())
Answer=[]
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                if i*10**3+j*10**2+k*10+l<=N and A<=i+j+k+l<=B:
                    Answer.append(i*10**3+j*10**2+k*10+l)
print(sum(Answer))
# Judge status: Wrong Answer
N = int(input())
S = input()
max_w = S.count(".")
if max_w == 0 or max_w == N:
  print(0)
  exit()

ans = float("inf")
b, w = 0, max_w
for s in S:
  if s == "#":
    b += 1
  else:
    w -= 1
  ans = min(ans, b+w)
print(ans)
# Judge status: Wrong Answer
#ABC122C
def main():
    import sys
    S = sys.stdin.readline().rstrip()
    #print(S)
    cnt = 0
    ans = 0
    for s in S:
        if s in ['A', 'G', 'C', 'T']:
            cnt +=1
        else:
            ans = max(ans, cnt)
            cnt=0
    
    ans = max(ans, cnt)
    print(ans)   
            
                    
    

if __name__=='__main__':
    main()
# Judge status: Accepted
s=int(input())
if s%10==9 or s//10==9:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
cnt = 0
for i in range(n-1):
    if a[i]+1==a[i+1]:
        cnt += c[a[i]-1]
bb = sum(b)

print(bb+cnt)
# Judge status: Accepted
x, n = map(int, input().split())
p = list(map(int, input().split()))
ans = []
sortlist = []
if n == 0:
    print(x)
else:
    p.sort()
    p1 = p[0]
    pn = p[n-1]
    new = [i for i in range(0, 102)]
    nolist = set(new) ^ set(p)
    nolist = list(nolist)

    for i in range(0, len(nolist)):
        d = abs(nolist[i] - x)
        sortlist.append(d)

        k = sortlist.index(min(sortlist))
    print(nolist[k])
# Judge status: Accepted
s = input()
use = set()
for i in range(4):
    use.add(s[i])
if len(use) != 2:
    print("No")
    exit()
if (s[0] == s[1] and s[1]==s[2]) or (s[0] == s[1] and s[1] == s[3]) or (s[0] == s[2] and s[2] == s[3]) or (s[1]== s[2] and s[2]== s[3]):
    print("No")
    exit()

print("Yes")
# Judge status: Accepted
from collections import defaultdict

n = int(input())
dic = defaultdict(int)
cnt = 0
for i in range(n):
    s = sorted(input())
    cnt += dic[''.join(s)]
    dic[''.join(s)] += 1
    
print(cnt)
# Judge status: Accepted
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, readline().split())
se = set(range(M + 1))
for _ in range(N):
    enquete = [int(x) for x in readline().split()]
    se &= set(enquete[1:])

print(len(se))
# Judge status: Wrong Answer
r = 0
b = 0
for a in input():
    if a == '0':
        r += 1
    else:
        b += 1

print(min(r, b))
# Judge status: Accepted
from collections import deque
N = int(input())
X = [0]*N
L = [0]*N
lis = deque()
for i in range(N):
    X[i], L[i] = map(int, input().split())
    lis.append([i,X[i]-L[i], X[i]+L[i]])

lis = sorted(lis, key=lambda x:x[2])
lis = deque(lis)

end = lis[0][2]
start = lis[0][1]
lis.popleft()
cnt = 1
while lis:
    x, y, z = lis.popleft()
    if y < end:
        continue
    elif y >= end:
        start = y
        end = z
        cnt += 1

print(cnt)
# Judge status: Accepted
n = int(input())
a, b, c = [], [], []
for _ in range(n):
    ai, bi, ci = map(int, input().strip().split())
    a.append(ai)
    b.append(bi)
    c.append(ci)
dp = []
dp.append((a[0], b[0], c[0]))
for i in range(1, n):
    prev = dp[i-1]
    chosen_a = a[i] + max(prev[1], prev[2])
    chosen_b = b[i] + max(prev[0], prev[2])
    chosen_c = c[i] + max(prev[0], prev[1])
    dp.append((chosen_a, chosen_b, chosen_c))
res = dp[n-1]
print(max(res[0], res[1], res[2]))
# Judge status: Wrong Answer
l,r,d = map(int,input().split())
a=l/d
b=r/d
if l==1:
  a=0
print(int(b)-int(a))
# Judge status: Accepted
A, B, C = map(int, input().split())

x = set([A, B, C])

if len(x) == 2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
input = sys.stdin.readline
a, b, c = map(int, input().split())
k = int(input())
def two(num):
  for i in range(1,8):
    if (2**(i-1)<=num) & (num<2**(i)):
      return i
  return 0
ab = two(a/b)
b_ = b*2**ab
b_c = two(b_/c)

if k>=(ab+b_c):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

r, g, b = map(int, input().split())
n = r*100 + g*10 + b

if n%4 == 0:
    print("YES")
else:
    print("No")
# Judge status: Accepted
s=input()
wlist=[]
for ch in s:
  wlist.append(ch)
N=len(wlist)
F=int((N-1)/2)
A=int((N+3)/2)
r=0
for i in range(F-1):
  if wlist[i]!=wlist[N-1-i]:
    r=r+1
  if wlist[i]!=wlist[F-1-i]:
    r=r+1
  if wlist[A-1+i]!=wlist[N-1-i]:
    r=r+1
if r==0:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n, m = map(int, input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]
for i in a:
  for j in b:
    if j not in a:
      print("No")
      exit()
print("Yes")
# Judge status: Wrong Answer
import  sys
N=int(input())
a = [int(input()) for _ in range(N)]
cnt=1
t=1
for i in range(10000):
    cnt+=1
    t=a[t-1]
    if a[t-1]==2:
        print(cnt)
        sys.exit()

print(-1)
# Judge status: Wrong Answer
s = input()
t = input()

def match(i):
  for j in range(len(t)):
    if not s[i+j] == '?' and s[i+j] != t[j]:
      return False
  return True

for i in range(len(s) - len(t), -1, -1):
  if not match(i):
    continue

  for j in range(i):
    print('a' if s[j] == '?' else s[j], end='')
  print(t, end='')
  for j in range(i+len(t), len(s)):
    print(s[j], end='')
  print()
  exit()
    
print('UNRESTORABLE')
# Judge status: Accepted
n = int(input())
li1 = list(map(int,input().split()))
li2 = sorted(li1)

cnt = 0

for i in range(n):
    if li1[i] != li2[i]:
        cnt += 1

if cnt>2:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
l = list(map(int, input().split()))
l.sort(reverse=True)
if l[0] == l[1] + l[2]:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
s_num=int(input())
s=[]
s=[input(x) for x in range(s_num)]
t=[]
t_num=int(input())
t=[input(x) for x in range(t_num)]
max_v=0
for i in range(s_num):
    if max_v < (s.count(s[i]) - t.count(s[i])):
        max_v = (s.count(s[i]) - t.count(s[i]))
print(max_v)
# Judge status: Accepted
n = input().replace(" ","")

if int(n)%4==0:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
a,b,t = map(int,input().split())

print(t//a*b)
# Judge status: Accepted
import math
r = int(input())
circle = r*2*math.pi
print(circle)
# Judge status: Wrong Answer
n, m, x, y = map(int, input().split())
if x>y :
    print('War')
else:
    X = sorted(list(map(int, input().split())))
    Y = sorted(list(map(int, input().split())))
    for i in range(x+1, y+1):
        if X[-1]<i and i <= Y[0]:
            print('No War')
            break
        else :
            print('War')
            break
# Judge status: Accepted
a,b,c = map(int,input().split())
print('YES' if b-a == c-b else 'NO')
# Judge status: Wrong Answer
import sys
n,m = map(int, input().split())
num = [0]*n
Ans = 0
for i in range(m):
    s,c = map(int, input().split())
    if num[s-1] != 0 and num[s-1] != c:
        print(-1)
        sys.exit()
    else:
        num[s-1] = c
if num.count(0)==n:
    print(-1)
    sys.exit()
if num[0] == 0:
    num[0] = 1
for i in range(len(num)):
    Ans = Ans + num[i] * (10 ** (n-i-1))

if Ans == 0:
    print(-1)
else:
    print(Ans)
# Judge status: Accepted
import sys
N=int(input())
B=list(map(int,input().split()))
if(N==2):
    print(B[0]*2)
    sys.exit()
before=B.pop(0)
ans=before
for b in B:
    ans+=min(before,b)
    before=b
ans+=B[-1]
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
if a==1 and b==1:
  print(1)
elif a==1:
  print(b-2)
elif b==1:
  print(a-2)
else:
  print((a-2)*(b-2))
# Judge status: Wrong Answer
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
from fractions  import gcd
#input=sys.stdin.readline
import bisect
n,m=map(int,input().split())
num=[1]*n
s=set()
s.add(1)
ans=1
for i in range(m):
    x,y=map(int,input().split())
    num[x-1]-=1
    num[y-1]+=1
    if x in s:
        if num[x-1]!=0 and y not in s:
          ans+=1
        elif num[x-1]==0 and y in s:
          ans-=1
        s.add(y)
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
money = 1000
stock = 0
for i in range(N-1):
    if stock == 0:
        if A[i] <= A[i+1]:
            num = money // A[i]
            money -= num * A[i]
            stock += num
    else:
        if A[i] >= A[i+1]:
            money += stock * A[i]
            stock = 0
if stock != 0:
    money += stock * A[N-1]
    stock = 0
print(money)
# Judge status: Accepted
n,m=map(int,input().split())
H=list(map(int,input().split()))
L=[[h,[]] for h in H]
for i in range(m):
    a,b=map(int,input().split())
    L[a-1][1].append(b-1)
    L[b-1][1].append(a-1)
c=0
for l in L:
    h=l[0]
    if all([h>L[i][0] for i in l[1]]):c+=1
print(c)
# Judge status: Accepted
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip.split())
def main():
    s = S()
    t = S()
    sl = list(s)
    tl = list(t)
    sl.sort()
    tl.sort(reverse=True)
    s = "".join(sl)
    t = "".join(tl)
    print("Yes" if s < t else "No")
main()
# Judge status: Accepted
s = input()
n = len(s)
a = [0]*(n+1)
for i in range(n):
    if s[i] == '<':
        a[i+1] = max(a[i+1], a[i]+1)
    if s[n-i-1] == '>':
        a[n-i-1] = max(a[n-i-1], a[n-i]+1)
print(sum(a))
# Judge status: Wrong Answer
s = input()
l = []
for i in s:
    if i in l:
        print('No')
        exit()
    else:
        l.append(i)
print('Yes')
# Judge status: Accepted
s = input().strip()
if s.endswith("s"):
    s+="es"
else:
    s+='s'
print(s)
# Judge status: Accepted
import numpy as np
def f(lst):
    return np.cumsum(lst)

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

res1 = s.count('.')
res2 = s.count('#')

a = [0]*n
b = [0]*n

for i in range(n):
    if s[i]=='.':
        a[i] += 1
    else:
        b[i] += 1
cum_a = f(a).tolist()
cum_b = f(b).tolist()
res3 = np.inf
for i in range(n):
    if a[i]==1:
        res3 = min(res3, cum_b[i]+(res1-cum_a[i]))

print(min(res1, res2, res3))
# Judge status: Accepted
s = list(input())
k = int(input())
t = list(map(lambda x:ord(x)-ord("a"),s))

for i in range(len(t)):
  diff = 26-t[i]
  if diff != 26 and diff <= k: 
    t[i]+=diff
    k-=diff
t[-1]+=k

u = "".join(list(map(lambda x:chr((x%26+ord("a"))),t)))
print(u)
# Judge status: Wrong Answer
# 最大公約数
def gcd(a,b):
    while b != 0:
        a,b = b, a%b
    return a

n,x = map(int,input().split())
X = list(map(int, input().split()))
X.sort()
dist = []
if len(X) == 1:
    print(abs(X[0]-x))
    exit()
for i in range(len(X)-1):
    dist.append(X[i+1] - X[i])
ans = 0
for d in dist:
    ans = gcd(ans,d)
print(ans)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if b - a == c - b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
c1 = input().strip()
c2 = input().strip()
if c1[0] == c2[2] and c1[1] == c2[1] and c1[2] == c2[0]:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n, k = map(int, input().split())


def base_10_to_n(x, n):
    if (int(x/n)):
        return base_10_to_n(int(x/n), n)+str(x % n)
    return str(x % n)


print(len(base_10_to_n(n, k)))
# Judge status: Accepted
s=input()
str1="keyence"
count=0
num=len(s)
if s==str1:
    yn=0
elif s[:7]==str1:
    yn=0
elif s[num-8:]==str1:
    yn=0
else:
    for i in range(7):
        if str1[i]==s[i]:
            count+=1
        else:
            break
    if s[num-7+count:]==str1[count:]:
        yn=0
    else:
        yn=1
if yn==0:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
def calc(x):
  if x == 0:
    return 1;
  return 2 * calc(x//2) + 1;

h = int(input())
print(calc(h))
# Judge status: Accepted
a, b = map(int, input().split())

if a <= 0 <= b:
    print('Zero')
elif a > 0 and b > 0:
    print('Positive')
elif a < 0 and b < 0:
    if (abs(a-b)+1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')
# Judge status: Accepted
a, b = map(int, input().split())
print(-(-(a+b)//2))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
ln = []
for i in a:
    for j in a:
        ln.append(min((max(i, j) % min(i, j)), min(i, j) - (max(i, j) % min(i, j))))
ln = [x for x in ln if x != 0]
if ln == []:
    print(min(a))
else:
    print(min(ln))
# Judge status: Wrong Answer
l, r = map(int, input().split())

mod = min(l%2019, r%2019)
print(mod*(mod+1))
# Judge status: Accepted
n, m = map(int, input().split())
ans = []
p = 1
q = 2 * ((m + 1) // 2)
for i in range((m + 1) // 2):
    ans.append((p, q))
    p += 1
    q -= 1
p = 2 * ((m + 1) // 2) + 1
q = p + (m // 2) * 2
for i in range(m // 2):
    ans.append((p, q))
    p += 1
    q -= 1
for row in ans[:m]:
    print(row[0], row[1])
# Judge status: Accepted
import math
n = int(input())

mod = 10**9+7
ans = 0
for i in range(1, n):
    if n/3 < i:
        break
    ans = (ans + math.comb(n-3*i+i-1, i-1) % mod) % mod
print(ans)
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))
a=1
for i in range(n):
    a*=l[i]
if a>10**8:
    print(-1)
else:
    print(a)
# Judge status: Accepted
def atc_131a(input_value: str) -> str:
    for i in range(0, len(input_value) - 1):
        if input_value[i] == input_value[i + 1]:
            return "Bad"
    return "Good"

input_value = input()
print(atc_131a(input_value))
# Judge status: Wrong Answer
s = input()
t = input()
u = 0

if s == t:
  print(0)
else:
  for i in range(len(s)):
    if s[i] == t[i]:
      u += 1

print(u)
# Judge status: Wrong Answer
n = int(input())
ans = 0
A = [i for i in range(n+1)]
A = A[1:n+1:2]
for i in range(len(A)):
    a=0
    for j in range(len(A)):
        if A[i] % (j+1) == 0:
            a += 1
    if a == 8:
        ans += 1
print(ans)
# Judge status: Accepted
s,w = map(int,input().split())

print("safe") if w < s else print("unsafe")
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
from fractions import gcd
def prime_fact(m):
    pf={}
    for i in range(2,int(m**0.5)+1):
        while m%i==0:
            pf[i]=pf.get(i,0)+1
            m//=i
    if m>1:pf[m]=1
    return list(pf)
def main():
    a,b=map(int,input().split())
    print(1+len(prime_fact(gcd(a,b))))

if __name__=='__main__':
    main()
# Judge status: Accepted
n = int(input())
for i in range(n // 4 + 1):
    for j in range(n // 7 + 1):
        if 4 * i + 7 * j == n:
            print('Yes')
            exit()
print('No')
# Judge status: Wrong Answer
import math

N = int(input())
str == 'No'
for i in range (math.floor( N/4 )+1):
    for j in range(math.floor(N/7)+1):
        if 4*i + 7*j == N:
            str = 'Yes'
print(str)
# Judge status: Accepted
W,a,b=map(int, input().split())

if a+W<=b:
  print(b-(a+W))
elif a+W>b and a<=b:
  print(0)
elif a>b and a<b+W:
  print(0)
elif a>=b+W:
  print(a-(b+W))
# Judge status: Wrong Answer
N = int(input())
S = input()
a = 0
for i in range(N):
    a = max(a,S[:i].count('I')-S[:i].count('D'))
print(a)
# Judge status: Accepted
k = int(input())
s = input()

if len(s) <= k:
  print(s)
else:
  print(s[:k] + '...')
# Judge status: Accepted
n, m = map(int, input().split())
ans = (n * (n - 1) // 2) + (m * (m - 1) // 2)
print(ans)
# Judge status: Wrong Answer
a,b = input().split()
cnt = 0
A1 = int(a[1])*10+int(a[0])
A2 = int(a[-2])*10+int(a[-1])
B1 = int(b[1])*10+int(b[0])
B2 = int(b[-2])*10+int(b[-1])
if A1 -A2 >= 0:
    cnt += 1
if B1 - B2 > 0:
    cnt -= 1
cnt += (int(b)-int(a))//100
print(cnt)
# Judge status: Accepted
# coding: utf-8


def solve(*args: str) -> str:
    h, n = map(int, args[0].split())

    AB = [tuple(map(int, s.split())) for s in args[1:]]

    inf = 10**12
    dp = [inf]*(h+1)
    dp[0] = 0
    for a, b in AB:
        for i, m in enumerate(dp):
            k = min(h, i+a)
            dp[k] = min(dp[k], dp[i]+b)

    return str(dp[-1])


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
# Judge status: Accepted
N, M = map(int, input().split())

halfPos = -(-N//2)

qPos = halfPos // 2

q3Pos = qPos + halfPos

for m in range(1, M+1):
  if m % 2:
    print(qPos-m//2, qPos+m//2+1)
  else:
    print(q3Pos-m//2, q3Pos+m//2)
# Judge status: Accepted
n = int(input()) 
s = input()
t = input()
for i in range(n):
    if s[i:] == t[:n-i]:
        print(n-i+i*2)
        break
else:
    print(2*n)
# Judge status: Wrong Answer
s=input()[2::];print('Yes' if len(set(s))==2 else 'No')
# Judge status: Accepted
N = int(input())
S = input()
T = list()
for i in range(int(N / 2), N):
    t = S[i]
    T.append(t)
y = 0
n = 0
for i, k in zip(T, S):
    if i == k:
        y += 1
    else:
        n += 1
if int(N % 2) != 0:
    print('No')
elif y == int(N / 2):
    print('Yes') 
else:
    print('No')
# Judge status: Wrong Answer
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[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: Accepted
input()
cards = tuple(map(int, input().split(' ')))

a = sum(cards[1:])
s = cards[0]
diff_min = abs(a - s)

for card in cards[1:-1]:
    a -= card
    s += card
    diff_min = min(diff_min, abs(a - s))

print(diff_min)
# Judge status: Accepted
n=input().split()
m=input().split()

N=n[0]
Nn=n[1]
l = 0
a = 0

for k in range(int(N)):
    a+=int(m[k])

for i in range(int(N)):
    if int(m[i])/(a/(int(Nn)*4)) >= 1:
        l+=1

if l >= int(Nn) :
    print("Yes")
else :
    print("No")
# Judge status: Accepted
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

d = i()
if d == 25:
	print("Christmas")
elif d == 24:
	print("Christmas Eve")
elif d == 23:
	print("Christmas Eve Eve")
else:
	print("Christmas Eve Eve Eve")
# Judge status: Accepted
n = int(input())
if n == 0:
    print(1)
if n == 1:
    print(0)
# Judge status: Accepted
n = int(input())
a = [int(input()) for i in range(n)]
chk = [False for i in range(n)]

c = 0
d = 0
while True:
	if chk[c]:
		print (-1)
		exit()
	else:
		chk[c] = True
		if c == 1:
			print (d)
			exit()
	c = a[c]-1
	d += 1
# Judge status: Accepted
a=1
b=c=0
exec('a,b,c=b,c,a+c;'*int(input()))
print(a%(10**9+7))
# Judge status: Wrong Answer
# input
N = int(input())
X = list(map(int, input().split()))

# check
l, r = N // 2 - 1, N // 2
X.sort()
lx, rx = X[l], X[r]
for ind in range(N):
    if ind <= l:
        print(rx)
    else:
        print(lx)
# Judge status: Accepted
import math

def dig(n):
    return math.floor(math.log10(n))+1

ans = 0
for i in range(int(input())):
    ans += (dig(i+1) % 2 == 1)
print(ans)
# Judge status: Accepted
S=list(input())
ans=0
for i in range(1,len(S)):
    if S[i-1]==S[i]: ans+=1; S[i]= '0' if S[i]=='1' else '1'
print(ans)
# Judge status: Accepted
N = int(input())
S = input()
a = ""
b = []

List = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]

for i in range(len(S)):
    a = S[i]
    c = List.index(a)
    c = c + N
    if 25 < c:
        c = c - 26
    b.append(List[c])

for i in range(len(b)):
    print(b[i], end ='')
# Judge status: Wrong Answer
c=[]

for i in range(3):
    c.append(list(map(int, input().split())))

c_sum = sum(c[0] + c[1] + c[2])

if c_sum//3 <= 100 and c_sum % 3 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, M = map(int, input().split())
A_array = list(map(int, input().split()))
item = 0
vote_sum = sum(A_array)
boarder = vote_sum / (4 * M)

for a in A_array:
    if a >= boarder:
        item += 1
if item >= M:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
H, W = map(int, input().split())
print((H * W + 1) // 2)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
if a == 2 and b == 3 or b == 3 and a == 2:
    print('1')
elif a == 1 and b == 2 or b == 1 and a == 2:
    print('3')
else:
    print('2')
# Judge status: Accepted
N = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(N - 1):
    if p[i] == i + 1:
        ans += 1
        p[i], p[i + 1] = p[i + 1], p[i]
if p[-1] == N:
    ans += 1
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
if b-c>=0:
    print("delicious")
elif a+b-c>=0:
    print("safe")
else:
    print("dangerous")
# Judge status: Wrong Answer
n, k, s = map(int, input().split())

for i in range(1, n+1):
    if i <= k+1:
        if s %2 == 1 and i % 2 == 1:
            print(s//2 + 1)
        else:
            print(s//2)
    else:
        print(s//2+5)
# Judge status: Accepted
N = input()
if N[-1] == '2' or N[-1] =='4' or N[-1] == '5' or N[-1] == '7' or N[-1] == '9':
    print('hon')
elif N[-1] == '3':
    print('bon')
else:
    print('pon')
# Judge status: Accepted
import math
lis = []
n = int(input())
for i in range(5):
    lis.append(int(input()))

print(math.ceil(n/min(lis))+4)
# Judge status: Accepted
import sys
import itertools
# import numpy as np
import time
import math

sys.setrecursionlimit(10 ** 7)

from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

MOD = 10 ** 9 + 7

x = 1
ans = 0
for i in range(60):
    ones = 0
    zeros = 0
    for a in A:
        if a & (1 << i) > 0:
            ones += 1
        else:
            zeros += 1
    ans += (ones * zeros * x) % MOD
    x *= 2

print(ans % MOD)
# Judge status: Accepted
def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    ans = A[0] // 2
    s = A[0] % 2
    for a in A[1:]:
        diff_p = min(s, a)
        self_p = (a - diff_p) // 2
        ans += diff_p + self_p
        s = a - diff_p - 2 * self_p
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
print(['ABC','ABD'][int(input())>=1000])
# Judge status: Wrong Answer
import math
A, B = list(map(int, input().split()))

amax = math.ceil((A + 1) / 8 * 100) - 1
amin = math.ceil(A / 8 * 100)
bmax = math.ceil((B + 1) / 10 * 100) - 1
bmin = math.ceil(B / 10 * 100)

if amin > bmax or bmin > amax:
    print(-1)
else:
    print(int(max(amin, bmin)))
# Judge status: Accepted
s=input()
if('9' in s):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
Blue = [input() for _ in range(n)]
m = int(input())
Red = [input() for _ in range(m)]
l = list(set(Blue))
print(max(0,max(Blue.count(l[i])-Red.count(l[i]) for i in range(len(l)))))
# Judge status: Accepted
n,k=map(int,input().split())
p=list(map(int,input().split()))

b=[0]
for i in range(1,n+1):
  b.append(b[i-1]+p[i-1])

max_i=-1
max_v=0
for i in range(1,n+1-k):
  if b[i+k]-b[i]>max_v:
    max_i=i
    max_v=b[i+k]-b[i]
ans=0
for i in range(k):
  ans+=(p[max_i+i]+1)/2
print(ans)
# Judge status: Accepted
n = int(input())

if n % 2 == 0:
    print(int((n+1)*(n//2)-n))
else:
    print(int(n*(n//2)))
# Judge status: Accepted
a, b, c = map(int, input().split())
print(int(a*b*0.5))