peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n, m, x, y = map(int, input().split())
a = max(list(map(int, input().split())))
b = min(map(int, input().split()))
print(['War', 'No War'][any((a<i<=b) for i in range(x,y))])
# Judge status: Accepted
import re


def actual(a, b, s):
    pattern = r'\d{' + f'{a}' + r'}-\d{' + f'{b}' + '}'
    
    if re.fullmatch(pattern, s):
        return 'Yes'

    return 'No'

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

print(actual(a, b, s))
# Judge status: Wrong Answer
n,x=map(int,input().split())
a=list(map(int,input().split()))
ret =0
if a[0]>x:
  ret+=a[0]-x
  a[0]-=x
for i in range(1,n):
  if a[i-1]+a[i]>x:
    ret+=a[i-1]+a[i]-x
    a[i]-=a[i-1]+a[i]-x
print(ret)
# Judge status: Wrong Answer
n = int(input())
print(-(-n//2)+((n+1)//2))
# Judge status: Wrong Answer
n = int(input())
lister = []
for i in range(n):
    lister.append([int(i) for i in input().split()])
 
if n % 2 == 1:
    lister.sort(key=lambda x:x[0])
    miner = lister[n//2][0]
    lister.sort(key=lambda x:x[1])
    maxer = lister[n//2][1]
    print(maxer- miner + 1)
else:
    lister.sort(key=lambda x:x[0])
    miner = lister[n//2][0]
    lister.sort(key=lambda x:x[1])
    maxer = lister[n//2][1]
    print(1 + (maxer- miner)*2)
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))

ans = set()
for i in range(1, n-1):
	a = []
	a.append(p[i-1])
	a.append(p[i])
	a.append(p[i+1])
	a.sort()
	ans.add(a[1])
	
print(len(ans))
# Judge status: Wrong Answer
def gcd(a,b):
    if a%b==0:
        return b
    return gcd(b,a%b)

def check(n,m):
    x,y = max(n,m), min(n,m)
    sol = gcd(x,y)
    if sol == n:
        d = x//y
        if d!=1:
            return n*(d+1)
        else:
            return -1
    elif sol == m:
        return -1
    else:
        return n*(x//y+1)

n,m = map(int, input().split())
c, limit = check(n,m), pow(10,9)
print(-1 if c>limit else c)
# Judge status: Accepted
n,*a=map(int,open(0).read().split())
p=max(a)
k=a.index(p)#かり
s=max(a[:k]+a[k+1:])#second
print('\n'.join(str(p) if i!=k else str(s) for i in range(n)))
# Judge status: Accepted
N=int(input())
A=[]
ans=-1
for i in range(N):
    A.append(int(input()))

num=A[0]
for j in range(N):
    if num==2:
        ans=j+1
        break
    num=A[num-1]
print(ans)
# Judge status: Accepted

from collections import defaultdict as dic
s = int(input())

flag = dic(int)
flag[s - 1] = 1
def f(n, i):
    if flag[n - 1] == 1:
        print(i)
        exit()
    else:
        flag[n - 1] = 1
        if n % 2 == 1:
            f(3 * n + 1, i + 1)
        else:
            f(int(n / 2), i + 1)
        

if s % 2 == 1:
    f(3 * s + 1, 2)
else:
    f(int(s / 2), 2)
# Judge status: Accepted
N = int(input())
S = list(input())

stack = ""
mi = ord('A')
mx = ord('Z')

for i in S :
    if ord(i)+N <= mx:
        stack = stack + chr(ord(i)+N)
    else:
        mem = ord(i)+N
        while mem > mx:
            mem = mem-26
        stack = stack + chr(mem)

print(stack)
# Judge status: Accepted
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))


flag = True

x_max = max(x)
y_min = min(y)

for z in range(X+1,Y+1):
    if x_max < z and y_min >= z:
        flag = False
if flag:
    print('War')
else:
    print('No War')
# Judge status: Accepted
a, b, k = map(int, input().split())
c = []
for i in range(1, min(a,b)+1):
    if a%i == 0 and b %i == 0:
        c.append(i)
print(c[-k])
# Judge status: Wrong Answer
n,m,k=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
A.insert(0,0)
cntB=0
cnt_list=[]

for i in range(n+1):
  timeA=sum(A[:i+1])
  cntA=i
  time=timeA
  if timeA>k:
    break
  for j in range(m):    
    if time+B[j]<=k:
      timeB=sum(B[:j+1])
      time=timeA+timeB    
      cntB=j+1
    else:
      break
  cnt=cntA+cntB
  cnt_list.append(cnt)
  
print(max(cnt_list))
# Judge status: Accepted
N, M = list(map(int,input().rstrip().split()))
Amin = 1
Amax = N
for i in range(M):
    L, R = list(map(int,input().rstrip().split()))
    Amin = max(Amin,L)
    Amax = min(Amax,R)
    if Amin>Amax:
        print(0)
        break
else:
    print(Amax-Amin+1)
# Judge status: Accepted
def div(x):
    cnt = 0
    for i in range(1, x + 1):
        if x % i == 0:
            cnt += 1
    return cnt


n = int(input())
ans = 0
for i in range(1, n + 1, 2):
    if div(i) == 8:
        ans += 1
print(ans)
# Judge status: Accepted
n = int(input())
k = n//15
res = 800*n - 200*k

print(res)
# Judge status: Wrong Answer
import math 
str = input().strip()
print(int(str)*math.pi)
# Judge status: Wrong Answer
N,M=map(int,input().split())
f=set()
t=set()
for i in range(M):
  a,b=map(int,input().split())
  if a<2:
    f.add(b)
  if b==N:
    t.add(a)
print("IM"*len(f&t)+"POSSIBLE")
# Judge status: Accepted
from itertools import permutations
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]

ans = 0
count = 0
for i in permutations(range(n), n):
  for j in range(n-1):
    ans += ((xy[i[j]][0] - xy[i[j+1]][0])**2 + (xy[i[j]][1] - xy[i[j+1]][1])**2)**0.5
  count += 1

print(ans/count)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
ans=0
maenomax=a[0]
for i in range(n):
    if maenomax > a[i]:
        ans += maenomax-a[i]
    elif maenomax < a[i]:
        maenomax=a[i]
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())

if b - a == c - b:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
N = int(input())

count = 0
flag = False
for i in range(N):
  D1, D2 = map(int, input().split())
  if D1 == D2:
    count += 1
  else:
    count = 0
  if count == 3:
    flag = True

if flag:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = [[0]*(N+1) for _ in range(N+1)]
for i in range(M):
    a, b = map(int, input().split())
    A[a][b] = 1
    A[b][a] = 1
for i in range(1, N+1):
    sum = 0
    for j in range(1, N+1):
        sum += A[i][j]
    print(sum)
# Judge status: Accepted
K = int(input())
flag = 0
now = 0
for i in range(1,K+1):
    now = now +  7*pow(10, i-1, K)
    now = now%K
    if now==0:
        flag = 1
        print(i)
        break
if flag==0:
    print(-1)
# Judge status: Accepted
D, N = map(int, input().split())

count = 0
for i in range(1, 10 ** 7):
    tmp = i
    flag = True
    div_count = 0
    for j in range(3):
        if tmp%100 == 0:
            tmp = tmp // 100
            div_count += 1

    if div_count == D:
        count += 1

    if count == N:
        print(i)
        break
# Judge status: Wrong Answer
X, Y, A, B, C = map(int, input().split())

P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))
        
P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)

A=P[:X]+Q[:Y]+R

A.sort(reverse=True)

print(A[X+Y])
# Judge status: Accepted
N, K = map(int, input().split())
if N % K == 0:
    print(0)
else:
    print(1)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
k=int(input())
if c>b and b>a:
    print("Yes")
    exit()
else:
    while(k>0):
        if b<a:
            b*=2
            k=k-1
        else:
            c*=2
            k=k-1
    if c>b and b>a:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
from collections import deque

s = input()
q = int(input())
Q = [input() for _ in range(q)]

s = deque(list(s))
insert = s.appendleft
append = s.append
flag = True

for query in Q:
    if query[0] == '1':
        flag = not flag
    else:
        if (query[2] == '1' and flag) or (query[2] == '2' and not flag):
            insert(query[4])
        else:
            append(query[4])

if not flag:
    s.reverse()

print(*s, sep='')
# Judge status: Wrong Answer
S, T = input().split()
A, B = list(map(int, input().split()))
U = input()

if U == "red":
    A = A - 1
else:
    B = B - 1

print(A, B)
# Judge status: Accepted
def solve():
    N = int(input())
    cnt = [1]*(N+1)

    for i in range(2, N+1):
        j = 1
        while i*j<=N:
            cnt[i*j] += 1
            j += 1

    ans = 0
    for i in range(1, N+1):
        ans += i*cnt[i]
    print(ans)

solve()
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
t1,t2,a1,a2= list(map(int,readline().rstrip().split()))
nnn = lambda x: 0 if x == 0 else 1  
if a1//t2 + nnn(a1%t2) <= t1//a2 + nnn(t1%a2):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n = input()
if n[0] == '1':
    ans = 0
    judge = set(n[1:])
    if len(judge) == 1 and '9' in judge:
        for i in n:
            ans += int(i)
        print(ans)
    else:
        ans = 9 * (len(n) - 1)
        print(ans)
else:
    ans = int(n[0]) - 1
    for i in range(1,len(n)):
        ans += 9
    print(ans)
# Judge status: Wrong Answer
s = input()
t = 0
u = 0
n = len(s)
for i in range(n):
  if s[i] == "A":
    t = i
    break
for j in range(n):
  if s[n-j-1] == "Z":
    u = n-j-1
print(u-t+1)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n, k, s = MI()
    if s == 10 ** 9:
        ans = [s] * k + [1] * (n - k)
    else:
        ans = [s] * k + [s + 1] * (n - k)
    print(*ans)

main()
# Judge status: Accepted
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
l = abs(b-a)
r = v-w
if l-(r*t)<=0:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
s = input()
if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
# Judge status: Wrong Answer
import collections
N = int(input())
A = list(map(int, input().split()))

c = collections.Counter(A)
ans = 0
for i in range(N):
  ans+=c[i]*(c[i]-1)//2

for i in range(N):
  print(ans-(c[A[i]]-1))
# Judge status: Accepted
N = int(input())
tmp = 0
ans = 0
for _ in range(N):
    a = int(input())
    if a != 0:
        tmp += a
    else:
        ans += tmp // 2
        tmp = 0
ans += tmp // 2
print(ans)
# Judge status: Accepted
cost = input()
amari = int(cost[-3:])
if amari == 0:
  amari = 1000
print(1000 - amari)
# Judge status: Accepted
n = int(input())

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

cumsum_a = a.copy()

for i in range(n-1, -1, -1):
    cumsum_a[i] += cumsum_a[i+1]

ans = 0
childable_node = 1

for i in range(n + 1):
    if a[i] > childable_node:
        ans = -1
        break

    ans += childable_node

    if i < n:
        b_max1 = 2 * (childable_node - a[i])
        b_max2 = cumsum_a[i + 1]
        childable_node = min(b_max1, b_max2)

print(ans)
# Judge status: Accepted
# 2020/02/22
# AtCoder Beginner Contest 123 - C

# Input
n = int(input())
ae = list()
for i in range(5):
    ae.append(int(input()))

# Calc
minae = min(ae)
ans = n // minae + 4
if n % minae > 0:
    ans = ans + 1

# Output
print(ans)
# Judge status: Accepted
N = int(input())
S = input()
Black = [0]*(N+1)
White = [S.count('.')]*(N+1)
DispS = [S.count('.')]*(N+1)
for TN in range(0,N):
    Black[TN+1] = Black[TN]+[0,1][S[TN]=='#']
    White[TN+1] = White[TN]-[0,1][S[TN]=='.']
    DispS[TN+1] = Black[TN+1]+White[TN+1]
print(min(DispS))
# Judge status: Wrong Answer
n, x, y = map(int, input().split())
loop = y-x+1
line = n-y+x
l1 = x-1
l2 = n-y
print(n)
for k in range(2, n):
    ans = max(line-k+1, 0)
    if k<=loop//2:
        ans += loop
    if k-l1<=1 and k>2:
        ans += (loop//2)*2-1
    else:
        ans += max((loop//2-(k-l1)+1), 0)*2
    if k-l2<=1 and k>2:
        ans += (loop//2)*2-1
    else:
        ans += max((loop//2-(k-l2)+1), 0)*2
    print(ans)
# Judge status: Wrong Answer
x=[]

n=int(input())
d1={}
for i in range(n):
  s=input()
  x.append(s)
  if s in d1:
    d1[s]+=1
  else:
    d1[s]=1
    
m=int(input())
d2={}
for i in range(m):
  t=input()
  x.append(t)
  if t in d2:
    d2[t]+=1
  else:
    d2[t]=1

ans=0
for s in x:
  cnt=0
  if s in d1:
    cnt+=d1[s]
  if s in d2:
    cnt+=d2[s]
  if ans<cnt:
    ans=cnt

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ans = 0
rout = []
for i in range(n):
    ans += b[a[i]-1]
    rout.append(a[i]-1)

for i in range(n-1):
    if rout[i] + 1 == rout[i+1]:
        ans += c[rout[i]]
print(ans)
# Judge status: Accepted
A, B, N = map(int, input().split())

ans = 0
if B != 1:
    if N < B:
        ans = int(A*N/B) - A * int(N/B)
    else:
        x = N//B * B - 1
        ans = int(A*x/B) - A * int(x/B)

print(ans)
# Judge status: Accepted
import math
a,b,c=map(int,input().split())
if c-b-a<=0:
  print('No')
elif 4*a*b<(c-a-b)**2:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
s = input()
n = len(s)

print("x"*n)
# Judge status: Wrong Answer
N=int(input())
A=[int(input())for i in range(N)]
ans=0
prev=A[0]
ans2=0
for i in range(1,N):
  x=min(A[i-1],A[i])
  ans+=x
  A[i-1]-=x
  A[i]-=x
  ans+=(A[i-1]//2)
ans+=A[N-1]//2
for i in range(N-1):
  x=min(A[N-1-i],A[N-2-i])
  ans2+=x
  A[N-1-i]-=x
  A[N-2-i]-=x
  ans2+=(A[N-i-2]//2)
ans2+=A[0]//2
print(max(ans,ans2))
# Judge status: Wrong Answer
import collections

n = int(input())
a = [int(input()) for i in range(n)]
m = list(set(a))
c =collections.Counter(a)

t = [max(a)]*n

if c[max(a)] == 1:
    t[a.index(max(a))] = m[-2]

[print(i) for i in t]
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    S = input().rstrip()

    is_valid = True
    for s in S[:A]:
        if s not in "0123456789":
            is_valid = False
    if S[A] != "-":
        is_valid = False
    for s in S[A + 1:]:
        if s not in "0123456789":
            is_valid = False

    ans = "Yes" if is_valid else "No"
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
# coding: utf-8
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
sa=sum(A)
sb=sum(B)
#print(sa)
#print(sb)
flg=True
if sa >= sb:
    flg=False
else:
    if (sb-sa)%2==0:
        flg=False
if flg:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import math

N,K = map(int,input().split())
p = [0] * (N+1)
for i in range(1,N+1):
    if (1 <= i) and (i <= K-1):
        r = int(1+math.log(K/i,2))
        p[i] = float( (1/N) * (math.pow(1/2,r)) )
    elif i >= K:
        p[i] = float(1/N)
ans = sum(p)
print(ans)
# Judge status: Accepted
N = int(input())
points = [list(map(int, input().split())) for _ in range(N)]
INF = 10**10
xmax = -INF
xmin = INF
ymax = -INF
ymin = INF
for x, y in points:
  minus = x-y
  plus = x+y
  xmax = max(xmax, minus)
  xmin = min(xmin, minus)
  ymax = max(ymax, plus)
  ymin = min(ymin, plus)
print(max(xmax-xmin, ymax-ymin))
# Judge status: Accepted
a, b = map(int, raw_input().split())
c = b - a
x = 1 + c
y = x * c
f = y / 2
print f - b
# Judge status: Accepted
a, b, c = map(int, input().split())

if c - a - b < 0:
    print('No')
elif 4 * a * b < (c - a - b) ** 2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n, k = map(int, input().split())

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


min_a = A.index(min(A))

left = min_a
right = n - min_a - 1


min_ = min(left, right)
max_ = max(left, right)


t = 0
min_ = min_ - k
t +=1
temp = 0
if min_ > 0:
    if min_ % (k - 1) != 0:
        temp = min_ // (k - 1)
    else:
        temp = min_ // (k - 1) + 1
    min_ -= temp * (k - 1)
t += temp

max_ = max_ + min_ + 1

if max_ % (k - 1) == 0:
    t += max_ // (k - 1)
else:
    t += max_ // (k - 1) + 1

print(t)
# Judge status: Accepted
from collections import Counter
def factorization(n) -> list:
	ret = []
	i = 2
	while i * i <= n:
		while n % i == 0:
			n //= i
			ret.append(i)
		i += 1
	if n != 1:
		ret.append(n)
	return ret

n=int(input())
if n==1:
	print(0)
	exit()
c=Counter(factorization(n))
ans=0
for x in c.values():
	r=0
	while r*(r+1)//2<=x:
		r+=1
	ans+=r-1
print(ans)
# Judge status: Wrong Answer
S=int(input())
if S==25:
  print("Crisitmas ")
if S==24:
  print("Christmas Eve")
if S==23:
  print("Christmas Eve Eve")
if S==22:
  print("Christmas Eve Eve Eve")
# Judge status: Accepted
N=int(input())
ans=(N*(N+1))//2  #1の時
for i in range(2,N+1):
  m=N//i
  ans+=i*(m*(m+1)//2)
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))

max_n = max(a)
min_n = min(a)

result = max_n - min_n 

print(result)
# Judge status: Accepted
n = int(input())  #一応読むけど、ループ回せば不要では
aList=list(map(int,input().split()))

aList.sort(reverse = True)

ap = 0
bp = 0

for i,a in enumerate(aList):
    if i%2 == 0: #0から始まるので偶数奇数逆で考える
        ap = ap + a
    else:
        bp = bp + a
print(ap-bp)
# Judge status: Accepted
def main():
    a, b, c, k = map(int, input().split())
    res = 0

    res += 1 * min(a, k)
    k -= a
    if k > 0:
        k -= b
    if k > 0:
        res += (-1 * min(c, k))
    print(res)

if __name__ == '__main__':
    main()
# Judge status: Accepted
q,h,s,d=map(int,input().split());n=int(input());print(n//2*min(8*q,4*h,2*s,d)+n%2*min(4*q,2*h,s))
# Judge status: Accepted
A,B = map(int,input().split(' '))

if A > 8 or B > 8:
  print(':(')
  
else:
  print('Yay!')
# Judge status: Accepted
n, c, k = map(int, input().split())
t = [int(input()) for i in range(n)]
t.sort()
ans = 1
cur = t[0]
cnt = 0
for i in t:
    if i > cur + k or cnt == c:
        ans += 1
        cnt = 1
        cur = i
    else:
        cnt += 1
print(ans)
# Judge status: Wrong Answer
N = int(input())
ans, i = 0, 1
def toN(X, n):
    if (int(X/n)):
        return toN(int(X/n), n)+str(X%n).zfill(2)
    return str(X%n).zfill(2)

while N > ans + 26**i:
    ans += 26**i
    i += 1
    
a = toN(N, 26)
lang = []

for j in range(0, i*2, 2):
    if j == 0:
        lang.append('a')
    else:
        lang.append(chr(int(a[j:j+2])+96))
        pre = int(a[j:j+2])
    
print(''.join(lang))
# Judge status: Accepted
n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = []
for _ in range(m):
    b, c = map(int, input().split())
    bc.append([c, b])
a.sort()
bc.sort(reverse = True)
x = [0] * n
i, j = 0, 0
while i < n:
    for _ in range(bc[j][1]):
        x[i] = bc[j][0]
        i += 1
        if i == n:
            break
    j += 1
    if j == m:
        break
ans = 0
for i in range(n):
    ans += max(a[i], x[i])
print(ans)
# Judge status: Wrong Answer
x = list(map(int, input().split()))

a = x[0]
b = x[1]
c = x[2]
k = x[3]

if a >= k:
  print(a)
else:
  count = k - a
  if b >= count:
    print(a)
  else:
    count = k - a - b
    ans = a - count
    print(ans)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

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

    ans = 1
    N -= K
    ans += (N + K - 2)//(K - 1)
    print(ans)
if __name__ == '__main__':
    main()
# Judge status: Accepted
n,c,k=map(int, input().split())
t=[int(input()) for _ in range(n)]
t.sort()
tmp_lim=t[0]+k
num_bus=0
num_person=1
for i in range(1, n):
    if tmp_lim<t[i] or c<=num_person:
        num_bus+=1
        tmp_lim=t[i]+k
        num_person=1
    else:
        num_person+=1
    # print(num_bus, num_person, tmp_lim)
print(num_bus+1)
# Judge status: Accepted
import itertools
n, m, q = list(map(int,input().split()))
sets = [list(map(int,input().split())) for i in range(q)]
#print(sets)
mx = 0
nums = list(range(1,m+1))
for h in itertools.combinations_with_replacement(nums,n):
    mxtemp = 0
    for j in range(q):
        a = sets[j][0]
        b = sets[j][1]
        if list(h)[b-1] - list(h)[a-1] == sets[j][2]:
            mxtemp += sets[j][3]
    if mxtemp > mx:
        mx = mxtemp
print(mx)
# Judge status: Wrong Answer
S=input()
T=input()

dict_S={}
dict_T={}

for x, y in zip(S, T):
    if x not in dict_S:
        dict_S[x]=y
    else:
        if dict_S[x]!=y:
            print("No")
            break

    if y not in dict_T:
        dict_T[y]=x
    else:
        if dict_T[y]!=x:
            print("No")
            break

print("Yes")
# Judge status: Wrong Answer
s=input()

if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("NO")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if (a==b and b==c and a==c):
  print(3)
elif(a==b and b!=c):
  print(2)
elif(b==c and c!=a):
  print(2)
elif(c==a and a!=b):
  print(2)
else:
  print(1)
# Judge status: Accepted
import math

n=int(input())
count,cnt=0,0

for i in range(1,n+1,2):
  for j in range(1,math.ceil(i/2)):
    if i%j==0:
      count+=1
      
  if count+1==8:
    cnt+=1
    
  count=0
  
print(cnt)
# Judge status: Accepted
k,x=map(int,input().split())
print('Yes' if k*500>=x else 'No')
# Judge status: Accepted
a, b = map(int, input().split())

if a * b <= 0:
    print('Zero')
elif 1 <= a:
    print('Positive')
else:
    if (b - a) %2 == 0:
        print('Negative')
    else:
        print('Positive')
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
n=int(input())

B = [int(input())-1 for i in range(n)]


def fun(k):
    if B[k] == 1:
     	return False                                                    
    else:
        return B[k]
ans = 0
cnt = 0
for i in range(n):
    cnt = fun(cnt)
    ans +=1
    if cnt ==False:
        print(ans)
        sys.exit() 
print(-1)
sys.exit()
# Judge status: Accepted
def main():
  import sys
  num,capacity=map(int,input().split())
  items=tuple([list(map(int,sys.stdin.readline().split())) for _ in range(num)])
  DP=[-1]*(capacity+1)
  DP[0]=0
  for item in items:
    weight=item[0]
    value=item[1]
    left=capacity-weight
    for i in range(left,-1,-1):
      if DP[i]<0:
        continue
      DP[i+weight]=max(DP[i]+value,DP[i+weight])
  print(max(DP))
      
if __name__=="__main__":
  main()
# Judge status: Accepted
A, B = map(int, input().split())
if A <= 9 and B <= 9:
  print(A*B)
else:
  print(-1)
# Judge status: Accepted
h, a = map(int, input().split())
print(-(-h // a))
# Judge status: Accepted
a, b, c = map(int, input().split())
if c-b == b-a:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
import math
print(math.ceil((N-1)/(K-1)))
# Judge status: Accepted
t = input()
t = t.replace("P?", "PD")
t = t.replace("?", "D")
print(t)
# Judge status: Accepted
weather=input()
if(weather=="Sunny"):
    print("Cloudy")
elif(weather=="Cloudy"):
    print("Rainy")
else:
    print("Sunny")
# Judge status: Accepted
O = input()
E = input()
n = len(E)
m = len(O)
L = []
if m== n:
    for i in range(n):
        L.append(O[i]+E[i])
else:
    for i in range(n):
        L.append(O[i]+E[i])
    L.append(O[m-1])
ans = ''.join(L)
print(ans)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*d))
# Judge status: Wrong Answer
n = int(input())
A = [list(map(int, input().split())) for _ in range(n)]

def chmax(a, b):
    if a > b:
        return a
    else:
        return b

dp = [[ 0 for _ in range(3)]for _ in range(n+10)]

for i in range(n):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            else:
                dp[i][k] = chmax(dp[i+1][k], dp[i][j]+A[i][k])

print(max(dp[n-1]))
# Judge status: Accepted
N,K=map(int,input().split())
A=list(map(int,input().split()))

F=[-1]*N
l=0
prev=0
while True:
  if F[prev]!=-1:
    break
  
  if l==K:
    print(prev+1);exit()
  F[prev]=l
  l+=1
  prev=A[prev]-1
  #print(l,prev)
l = (K-F[prev])%(l-F[prev])
#print(l)
for i in range(l):
  prev=A[prev]-1
print(prev+1)
# Judge status: Accepted
n=int(input())
s=input()
from itertools import groupby as gb
head=0
m=0
for k,v in [(a,len(list(b))) for a,b in gb(s)]:
    if k==")":
        if m<v:head+=v-m;m=0
        else:m-=v
    else:
        m+=v
print("("*head+s+")"*m)