peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
S,T=input().split()
print(S+T)
# Judge status: Wrong Answer
n=int(input())
l=n%10
if l==0 or l==1 or l==6 or l==8:
  print("hon")
elif l==3:
  print('bon')
else:
  print("hon")
# Judge status: Accepted
n=int(input())
a=[0]+[int(x) for x in input().split()]
b=[0]+[int(x) for x in input().split()]
c=[0]+[int(x) for x in input().split()]

ans=0

for i in range(n+1):
    ans+=b[a[i]]
    if i>0:
        if a[i-1]+1==a[i]:
            ans+=c[a[i-1]]
print(ans)
# Judge status: Wrong Answer
def actual(n, m, a_list):
    threshold = sum(a_list) / (4 * m)

    count_can_be_popular = 0

    for vote in a_list:
        if vote >= threshold:
            count_can_be_popular += 1

    if count_can_be_popular >= m:
        return 'Yes'

    return 'No'

n, m = map(int, input().split())
a_list = map(int, input().split())
  
print(actual(n, m, a_list))
# Judge status: Wrong Answer
P,Q,R=map(int,input().split())

a=[P,Q,R]

b=sorted(a)

print(a[0]+a[1])
# Judge status: Wrong Answer
N = int(input())
s = input().strip()
t = input().strip()
k = 0
for i in range(1,N+1):
    if s[-i:]==t[:i]:
        k = i
        continue
    break
print(2*N-k)
# Judge status: Accepted
o = input()
e = input()
ans = ""
i = 0
while i < len(o):
  ans += o[i]
  if i < len(e):
    ans += e[i]
  i += 1
print(ans)
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())
if c%b < a%d:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer


s = sorted(input())

print("Yes" if s[0] == s[1] and s[2] == s[3] else "No")
# Judge status: Accepted
from operator import itemgetter
N = int(input())

T = list()
for i in range(N):
    S, P = map(str, input().split())
    T.append((S, int(P), str(i+1)))

T = sorted(T, key=itemgetter(1), reverse=True)
T = sorted(T, key=itemgetter(0))
for t in T:
    print(t[2])
# Judge status: Accepted
N=int(input())
H=[int(x) for x in input().split()]
cur=[0]*N
for i in range(1,N):
    if H[i]<=H[i-1]:
        cur[i]=cur[i-1]+1
print(max(cur))
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, K, *A = map(int, read().split())

    print((N - 2) // (K - 1) + 1)

    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
from bisect import bisect_left, bisect_right

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

A.sort()
C.sort()

cnt = 0
for b in B:
    cnt += bisect_left(A, b) * (N - bisect_right(C, b))
print(cnt)
# Judge status: Accepted
n, m =map(int, input().split())
s = (n*(n-1)/2 + m*(m-1)/2)
s= int(s)
print(s)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
if n==1:
  if a[0]==1:
    print(0)
  else: print(-1)
if n>=2:
  if 1 not in a:
    print(-1)
    exit()
  else:
    for i in range(2,n+1):
      if i in a and a.index(i-1)<a.index(i):
        continue
      else:
        print(n-i)
        exit()
# Judge status: Wrong Answer
n = int(input())
x = 2
y = 1

if n == 1:
    ans = 2

if n == 2:
    ans = 1

for i in range(n-1):
    ans = x + y
    x = y
    y = ans

print(ans)
# Judge status: Wrong Answer
A, B, K = map(int, input().split())
if A >= K:
    print(A-K, B)
else:
    print(0, B-(K-A))
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
for i in range(n):
  l[i]=l[i]-(i+1)
l.sort()
if n%2==0:
  b=(l[n//2-1]+l[n//2])//2
else:
  b=l[n//2]
ans=0
for i in range(n):
  ans+=abs(l[i]-b)
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
d = []
for i in range(M-1):
  d.append(X[i+1]-X[i])
d.sort()
print(sum(d[0:M-N]))
# Judge status: Wrong Answer
def main():
    N, M = list(map(int, input().split()))
    if N % 2 == 1:
        for i in range(M):
            print(i + 1, N - i - 1)
            
    else:
        for i in range(M // 2):
            print(i + 1, N - i - 1)
        for i in range(M // 2, M):
            print(i + 1, N - i - 2)

main()
# Judge status: Accepted
n = int(input())
c = list(input())
ramount = c.count('R')
ans = c[: ramount].count('W')
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
ListA = []
for i in range (a):
  ListA.append(input())
ListB = []
for i in range (b):
  ListB.append(input())
flag = False
  
def checkAB(List1,List2,aa,bb):
  for k in range(b):
    if List1[aa+k][bb:bb+b] != List2[k]:
      return False
  return True
  
for i in range(a-b+1):
  for j in range(a-b+1):
    if checkAB(ListA,ListB,i,j):
      flag = True
if flag:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import bisect
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        k = bisect.bisect_left(L, L[i]+L[j])
        ans += max(0, k-j-1)
print(ans)
# Judge status: Wrong Answer
a, v = [int(a) for a in input().split()]
b, w = [int(a) for a in input().split()]
t = int(input())
ret = w-v
ans = ""
if (ret*t)  <= (b-a):
  ans = "NO"
else:
  ans =  "YES"
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
ans = 0

if n >= m:
    ans = m // 2
else:
    ans = n + (m - 2 * n) // 4

print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
l=sorted([a,b,c])
print("Yes" if l[1]==c else "No")
# Judge status: Accepted
N = int(input())

s = list(map(int, input().split()))

s2 = sorted(s, reverse=True)

print(sum(s2[0::2]) - sum(s2[1::2]))
# Judge status: Wrong Answer
k,x = map(int,input().split())
print([i for i in range(x-k+1,x+k)])
# Judge status: Accepted
n=int(input())
x=(10**9)+7
a=pow(10,n,x)+pow(8,n,x)-2*pow(9,n,x)

print(a%x)
# Judge status: Accepted
a, b, c, d = map(int, input().split())
ac = a * c
ad = a * d
bc = b * c
bd = b * d
l = [ac, ad, bc, bd]
print(max(l))
# Judge status: Accepted
n = int(input())
a_ls = list(map(int, input().split()))
num_mul4 = 0
num_even_not4 = 0
num_odd = 0
for i in range(n):
    if a_ls[i] % 4 == 0:
        num_mul4 += 1
    elif a_ls[i] % 2 == 0:
        num_even_not4 += 1
    else:
        num_odd += 1
res = 'No'
if num_even_not4 == 0:
    if num_odd <= num_mul4 + 1:
        res = 'Yes'
else:
    num_odd += 1
    if num_odd <= num_mul4 + 1:
        res = 'Yes'
print(res)
# Judge status: Accepted
n = int(input())
a = [0] + list(map(int, input().split()))
b = [0]*(n+1)
for i in range(1, n+1)[::-1]:
    if a[i] == 1:
        if sum(b[i::i]) % 2 == 0:
            b[i] = 1
        else:
            b[i] = 0
    else:
        if sum(b[i::i]) % 2 == 0:
            b[i] = 0
        else:
            b[i] = 1
print(b.count(1))
for i in range(n+1):
    if b[i] == 1:
        print(i)
# Judge status: Accepted
#!/usr/bin/env python

def main():
    S = input()
    ans = 0
    for i in range(len(S) // 2):
        if S[i] != S[::-1][i]:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))

    INF = 1 << 60
    dp = [INF] * 100010

    dp[0] = 0

    for i in range(N):
        for j in range(1, K + 1):
            if i + j < N:
                dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]))

    print(dp[N - 1])


if __name__ == "__main__":
    main()
# Judge status: Accepted
X, Y = map(int, input().split())

mod = 10**9+7
N = 1333334
fac = [1]*(N+1)
rev = [1]*(N+1)
 
for i in range(1,N+1):
  fac[i] = i*fac[i-1]%mod
  rev[i] = pow(fac[i], mod-2, mod)
 
comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%mod

a, b = (2*X-Y)//3, (2*Y-X)//3
if a<0 or b<0 or (2*X-Y)%3 or (2*Y-X)%3:
    print(0)
else:
    print(comb(a+b, a))
# Judge status: Wrong Answer
n = int(input())
x = [int(x) for x in input().split()]
sum = 0
list = [] * n
for i in range(n):
    sum = 0
    for j in range(n):
        sum = sum + (x[j] - (i+1))**2
    list.append(sum)
print(min(list))
# Judge status: Accepted
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    n = int(input())
    dic = defaultdict(lambda: 0)
    count = 0
    for _ in range(n):
        s = input()
        dic[s] += 1
        count = max(count, dic[s])

    candidates = []
    for key in dic.keys():
        if dic[key] == count:
            candidates.append(key)

    candidates.sort()
    for c in candidates:
        print(c)

if __name__ == '__main__':
    main()
# Judge status: Accepted
a,s,c = input().split(" ")
print("A{}C".format(s[0]))
# Judge status: Wrong Answer
x="AtCoder"+input().capitalize()+"Contest"

print("A"+x[8]+"C")
# Judge status: Accepted
N = int(input())
P = input().replace(" ","")
Q = input().replace(" ","")

def add_up(string, left):
  string_set = set()
  if len(left) == 0:
    return {string}
  
  for number in left:
    string_set |= add_up(string+str(number), left-{number})
  return string_set

l = sorted(list(add_up("",set([i+1 for i in range(N)]))))
print(abs(l.index(Q)-l.index(P)))
# Judge status: Accepted
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]*(N+1)
b = [0]*(M+1)
for i in range(1, N+1):
    a[i] = a[i-1] + A[i-1]
for j in range(1, M+1):
    b[j] = b[j-1] + B[j-1]

ans = 0
j = M
for i in range(N+1):
    if K - a[i] < 0:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i+j)
print(ans)
# Judge status: Accepted
alphabet = "abcdefghijklmnopqrstuvwxyz"
w = list(input())

for alpha in alphabet:
    if w.count(alpha) % 2 == 1:
        print("No")
        break
else:
    print("Yes")
# Judge status: Accepted
x = int(input())

s = 1
i = 1
while s < x:
    i += 1
    s += i

print(i)
# Judge status: Accepted
import sys
input = sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
cnt=0
flg=True
while flg:
    for i in range(n):
        if a[i]%2==0:
            a[i]//=2
        else:
            flg=False
            break

    cnt+=1
print(cnt-1)
# Judge status: Accepted
A,B=map(int,input().split())
S=input()
L=list(S)
l=L.count('-')
if l==1:
  SS,T=S.split('-')
  if len(str(SS))==A and len(str(T))==B:
    print('Yes')
  else:
    print('No')
    
else:
  print('No')
# Judge status: Wrong Answer
import re
S = input()
print("YES" if re.match("dream|dreamer|erase|eraser", S) else "NO")
# Judge status: Wrong Answer
N, M = map(int, input().split())
AB = {}
for i in range(N):
  a, b = map(int, input().split())
  AB[a] = b

ans = 0
for ab in sorted(AB.keys()):
  if M <= 0:
    break
  if M >= AB[ab]:
    ans += ab * AB[ab]
    M -= AB[ab]
  else:
    ans += ab * M
    M = 0
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())
if A>=13:
    print(B)
elif A>=6:
    print(B//2)
else:
    print(0)
# Judge status: Accepted
import math
import collections
import bisect
from copy import copy


def main():
    N = int(input())
    print((1000 - N % 1000) % 1000)


if __name__ == '__main__':
    main()
# Judge status: Accepted
A, B = map(int, input().split())

print("Yay!") if A <= 8 and B <= 8 else print(":(")
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**8)

N,W=map(int,input().split())
wv=[list(map(int,input().split())) for i in range(N)]

dp=[[0]*(W+1) for i in range(N+1)]

for i in range(N):
    for j in range(0,W+1):
        if (j-wv[i][0])>=0:
            dp[i+1][j] = max([dp[i][j],dp[i][j-wv[i][0]] + wv[i][1]])
        else:
            dp[i+1][j] = dp[i][j]

print(dp[N][W])
# Judge status: Accepted
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

N = input()

if "7" in N:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
S = input()
ans = ""

for i in range(len(S)):
    if ord(S[i]) + N > ord("Z"):
        ans += chr(ord(S[i]) + N - (ord("Z") - ord("A") + 1))
    else:
        ans += chr(ord(S[i]) + N)
print(ans)
# Judge status: Accepted
s = input()
o1 = s[::2].count('1')
o0 = s[::2].count('0')
e1 = s[1::2].count('1')
e0 = s[1::2].count('0')
print(min(o0 + e1, o1 + e0))
# Judge status: Wrong Answer
s = input()
k = int(input())

for i in range(len(s)):
    if s[i] != "1":
        print(s[i])
        exit()
    if i == len(s):
        print(1)
# Judge status: Wrong Answer
a = input()
b = input()
print("Yes" if a==b[::-1] else "No")
# Judge status: Accepted
s = input()
ans = ""

for i in s:
  if i == "0" or i == "1":
    ans += i
  else:
    ans = ans[:-1]
print(ans)
# Judge status: Wrong Answer
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

import bisect

N=int(input())
list1=divisor(N)
value1=(N**0.5)//1
num=bisect.bisect_left(list1,value1)

x=list1[num]
print(int(x+N/x-2))
# Judge status: Accepted
# ABC-141-D
# https://qiita.com/ellio08/items/fe52a9eb9499b7060ed6
import heapq

N, M = map(int, input().split())
A = [i * (-1) for i in list(map(int, input().split()))]
heapq.heapify(A)

for _ in range(M):
    tmp = heapq.heappop(A) * (-1)
    heapq.heappush(A, (tmp//2)*-1)

# これだとTLEになる。
# for _ in range(M):
#     A[A.index(max(A))] //= 2

print(sum(A)*-1)
# Judge status: Wrong Answer
import sys

N, K = map(int, input().split())

#print(N)
#print(K)

A = sys.stdin.readlines()
#改行コード削除
A = [b.strip() for b in A][0].split()
#print(A)

print(A[int(A[(K % N) - 1]) - 1])
# Judge status: Accepted
n, k = map(int, input().split())
D = set(map(int, input().split()))
from itertools import count
for ans in count(n,1):
    for c in str(ans):
        if int(c) in D:
            break
    else:
        print(ans)
        break
# Judge status: Accepted
from collections import deque
N = int(input())
A = deque(list(map(int, input().split())))

ans = 0
cnt = 1
while A:
    a = A.popleft()
    if cnt == a:
        cnt += 1
        continue
    else:
        ans += 1
if ans == N:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
s=input()
t=input()
S=sorted(map(s.count,set(s)))
T=sorted(map(t.count,set(t)))
print("Yes" if S==T else "No")
# Judge status: Wrong Answer
N,x = map(int,input().split())
a = list(map(int,input().split()))

a = sorted(a, reverse = False)

count = 0
if sum(a) < x:
    count = N -1
else:
    for i in a:
        A = x - i
        if A < 0:
            count -=1
            break
        elif A == 0:
            count += 1
            break
        count+=1
if count == -1:
    count = 0
print(count)
# Judge status: Accepted
n = int(input())
if n % 2 == 1:
    print(0)
    exit()
ans = 0
while n != 0:
    n //= 5
    ans += n//2

print(ans)
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
p_sort = sorted(p)
count = 0
for a, b in zip(p, p_sort):
  if a == b:
    count += 1
if len(p) - count <= 2:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
n, m = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(m)]

next_node = [[] for _ in range(n)]
for a, b in edge:
    next_node[a-1].append(b)
    next_node[b-1].append(a)

q = [1]
visit = [1]  + [0] * (n-1)
prev = [0]*n
while q:
    now = q.pop()
    for i in next_node[now-1]:
        if visit[i-1] == 0:
            q.append(i)
            visit[i-1] = 1
            prev[i-1] = now
print('Yes')
print(prev[1:])
# Judge status: Accepted
a,b=list(map(int,input().split()))
if a%3==0 or b%3==0 or (a+b)%3==0:
    print("Possible")
else:
    print("Impossible")
# Judge status: Accepted
A, B, C = map(int, input().split())
print(A * B // 2)
# Judge status: Wrong Answer
a=int(input())
b=int(input())
h=int(input())

print(int(a+b)*h/2)
# Judge status: Accepted
L = []
S = input()
for i in range(len(S)-2):
  n = int(S[i] + S[i+1] + S[i+2])
  L.append(abs(753-n))
L.sort()
print(L[0])
# Judge status: Accepted
s, w = map(int, input().split())
print('unsafe' if w >= s else 'safe')
# Judge status: Accepted
w=list(input())
for x in w:
  key=w.count(x)
  if key%2!=0:
    print('No')
    exit()
print('Yes')
# Judge status: Wrong Answer
s = input()
t = input()
memo = {}
ans = 'Yes'
for i in range(len(s)):
    if s[i] in memo:
        if t[i] != memo[s[i]]:
            ans = 'No'
            break
    else:
        memo[s[i]] = t[i]
a = memo.values()
if set(a) != len(a):
    ans = 'No'
print(ans)
# Judge status: Accepted
N = int(input())
d = "abcdefghijklmnopqrstuvwxyz"
ans = ""
N -= 1

while(N >= 0):
    ans += d[N % 26]
    N //= 26
    N -= 1
    
print(ans[::-1])
# Judge status: Accepted
N,M = map(int,input().split())
AB = []
for _ in range(N):
    AB.append([int(i) for i in input().split()])
AB_sort = sorted(AB,key=lambda x : x[0])
money = 0
for ab in AB_sort:
    if M >= ab[1]:
        money += ab[0] * ab[1]
        M -= ab[1]
    else:
        money += M * ab[0]
        break
print(money)
# 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
import math
a,b=input().split()
if math.sqrt(int(a+b))%1==0:print("Yes")
else:print("No")
# Judge status: Accepted
import math
a, b = map(str,input().split())
c = int(a+ b)

if   math.sqrt(c).is_integer() == True:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())
nums = [int(i) for i in input().split()]

box = [0] * (n + 1)
for i in range(1, n + 1)[::-1]:
    ball = nums[i - 1]
    box[i] = ball
    t = i
    while t <= n + 1:
        ball ^= box[i]
        t += i
    box[i] = ball

ans = box.count(1)
index = []
for i in range(len(box)):
    if box[i]:
        index.append(i)
print(ans)
print(*index)
# Judge status: Wrong Answer
from collections import defaultdict
d = defaultdict(int)
for _ in range(int(input())):
    d[input()] += 1
for _ in range(int(input())):
    d[input()] -= 1
print(max(d.values()))
# Judge status: Accepted
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

x, y = inm()
ans = 0
while x <= y:
    ans += 1
    x *= 2
print(ans)
# Judge status: Accepted
_ = input()
S = input().lstrip('.').rstrip('#')
n = len(S)
A = list(S)

x = 0
y = S.count('.')
ans = min(n-y, y)
for i in range(n):
  if S[i] == '#':
    x += 1
  else:
    y -= 1
  ans = min(ans, x + y)
print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())

ans = []
for i in range(m):
    ans.append((i + 1, n - i - 1))
for i in ans:
    print(*i)
# Judge status: Accepted
a,b = map(int,input().split())
if a==b:
  print('Draw')
elif a==1 or b!=1 and a>b:
  print('Alice')
else:
  print('Bob')
# Judge status: Accepted
K, A, B = map(int,input().split())

if B - A <= 2 or K < A + 1:
  print(K+1)
else:
  cnt = A - 1
  bisket = 1 + cnt + (B - A) * ((K - cnt)//2)
  bisket += (K - cnt) % 2
  print(bisket)
# Judge status: Wrong Answer
# 初期入力
import sys
input = sys.stdin.readline
N,X = (int(x) for x in input().split())
L = list(map(int, input().split()))
d =[0]*(N+1)
count =1
for i in range(N):
    d[i+1] =d[i] +L[i]
    if d[i+1] < X:
        count +=1
    else:
        break
print(count)
# Judge status: Accepted
n = int(input())
print(n//2 * (n//2+1) if n % 2 else (n//2)**2)
# Judge status: Wrong Answer
o = [input()]
e = [input()]
for x, y in zip(o, e): print(x+y, end="")
# Judge status: Accepted
a, b = map(int, input().split())
d = b - a
h = (d*(d + 1)) // 2
print(h - b)
# Judge status: Wrong Answer
N = int(input())
W = [int(e) for e in range(N)]

_ = sum(W)
ans = 0
Y = 100 ** 100
for i in range(N - 1):
    ans += W[i]
    _ -= W[i]
    X = abs(ans - _)
    if Y > X:
        Y = X
print(Y)
# Judge status: Wrong Answer
N,D = map(int,input().split())
print(N//(D*2+1)+1)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a * b % 2 == 1:
    print("odd")
else:
    print("even")
# Judge status: Accepted
A, B, C = map(int, input().split())
K = int(input())

max_num = max([A, B, C])

print((max_num) * pow(2, K) + sum([A, B, C]) - max_num)
# Judge status: Accepted
x = int(input())
if x % 11 == 0:
  print((x//11)*2)
elif x % 11 <= 6:
  print((x//11)*2+1)
else:
  print((x//11)*2+2)
# Judge status: Wrong Answer
import bisect

N = int(input())
A = [-int(input()) for _ in range(N)]

dp = [float("inf")] * (N+1)
dp[0] = -1
dp[1] = A[0]

for i in range(1,N):
    dp[bisect.bisect_right(dp, A[i])] = A[i]

for i in reversed(range(N+1)):
    if dp[i] < float("inf"):
        print(i)
        break
# Judge status: Wrong Answer
K = input()
def myfunc(K):
  count = 0
  for i in range(1, K+1):
    if i%2==0:
      # print(i)
      for i in range(1, K+1):
          if i%2==1:
              # print(" ", i)
              count +=1
  print(count)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
ans="No"
for i in range(100):
    c=c-b
    if c<=0:
        ans="Yes"
        break
    a=a-d
    if a<=0:
        break
print(ans)
# Judge status: Accepted
import sys

a = [list(map(int, input().split())) for i in range(3)]
n = int(input())
d = [int(input()) for f in range(n)]

for k in range(3):
  if a[k][0] in d and a[k][1] in d and a[k][2] in d:
    print("Yes")
    sys.exit()
  elif a[0][k] in d and a[1][k] in d and a[2][k] in d:
    print("Yes")
    sys.exit()
if a[0][0] in d and a[1][1] in d and a[2][2] in d:
  print("Yes")
  sys.exit()
elif a[0][2] in d and a[1][1] in d and a[2][0] in d:
  print("Yes")
  sys.exit()
else:
  print("No")
# Judge status: Accepted
def check(s):
    t = 'keyence'
    if s == t:
        return 'YES'
    for i in range(len(s)):
        for j in range(i + 1, len(s)):
            if t == s[:i] + s[j:]:
                return 'YES'
    return 'NO'


s = input()
print(check(s))
# Judge status: Wrong Answer
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
S = input()
print(len(S)-2)
# Judge status: Accepted
word = input()
result = "Yes"
abc = (set(word))
abc = "".join(abc)
for i in abc:
    
    if word.count(i) %2 ==1:
        result = "No"
        break
        
print(result)
# Judge status: Accepted
import sys

n = int(input())

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

cnt = 0
ave = sum(a)/2

for i in range(n):
    cnt += a[i]
    if cnt == ave:
        print(0)
        sys.exit()
    
    elif cnt > ave:
        x = ave -cnt +a[i]
        if x >= cnt -ave:
            x = cnt -ave
        break

print(int(x*2))
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))

ans = "0"

for i in range(1, n):
    a = l[i] ^ l[0]
    ans += " {}".format(a)

print(ans)
# Judge status: Wrong Answer
n = int(input())
L = list(map(int, input().split()))
idx = L.index(max(L))
print(idx)
sum_L = 0
for i in range(len(L)):
    if i == idx:
        pass
    else:
        sum_L += L[i]

if L[idx] < sum_L:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
e = [chr(ord('A') + i) for i in range(26)]
a=int(input())
s=input()

res = []

for i in s:
    res.append(e[(e.index(i)+a)%26])

print(''.join(res))
# Judge status: Accepted
P,Q,R = sorted(map(int,input().split()))

print(P+Q)
# Judge status: Accepted
import re
S = input()
'''
メタ文字：
^ = 文字列の先頭、
| = OR
+ = 直前のパターンを1回以上繰り返し、
$ = 文字列の末尾
'''
if re.match("^(dream|dreamer|erase|eraser)+$", S):
    print('YES')
else:
    print('NO')