peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
from collections import Counter

s = input()
len_s = len(s)
counter_s = Counter(s)
maxVal = max(counter_s.values())
if maxVal - (len_s - maxVal) >= 1:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
X, Y, Z = list(map(int, input().split()))

print(Z,X,Y)
# Judge status: Wrong Answer
N = int(input())

if (N % 7) % 4 == 0 or (N % 4) % 7 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
w,a,b = map(int,input().split())

if abs(a-b) <= w:
  print(0)
else:
  print(abs(a-b)-w)
# Judge status: Accepted
s = input()
temp = s
while len(temp) > 4:
    if temp[len(temp) - 3:] == 'eam' and temp[len(temp) - 5:] == 'dream': temp = temp[: len(temp) - 5]
    elif temp[len(temp) - 3:] == 'mer' and temp[len(temp) - 7:] == 'dreamer': temp = temp[: len(temp) - 7]
    elif temp[len(temp) - 3:] == 'ase' and temp[len(temp) - 5:] == 'erase': temp = temp[: len(temp) - 5]
    elif temp[len(temp) - 3:] == 'ser' and temp[len(temp) - 6:] == 'eraser': temp = temp[: len(temp) - 6]
    else: break
if len(temp) > 4: print('NO')
else: print('YES')
# Judge status: Accepted
a,b,c = map(int,input().split())
res = 0
while a%2==0 and b%2==0 and c%2==0: # 値が偶数の間
    if a==b==c: #無限ループ
        print(-1)
        exit()
    tmpa = b//2+c//2
    tmpb = a//2+c//2
    tmpc = a//2+b//2
    a = tmpa
    b = tmpb
    c = tmpc
    res += 1
print(res)
# Judge status: Wrong Answer
import math
a, b = map(float, input().split())
w = a * b
ans = math.floor(w)
print(ans)
# Judge status: Accepted
a = int(input())
b = int(input())
 
if a!=1 and b!=1:
  print(1)
elif a!=2 and b!=2:
  print(2)
else:
  print(3)
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
if a%x!=0:
  a+=x-a%x

if a>=b:
  print(0)
else:
  print(b//x-a//x+1)
# Judge status: Accepted
def gcd(x, y):
    if y > x:
        x, y = y, x
    while y != 0:
        x, y = y, x % y
    return x


N = int(input())
A = [int(i) for i in input().split()]
ans = A[N - 1]
for i in range(N - 1):
    ans = gcd(ans, A[i])
print(ans)
# Judge status: Wrong Answer
from math import log

x, y = map(int, input().split())
print(1 + int(log(y // x, 2)))
# Judge status: Accepted
#!/usr/bin/env python3
n, *a = map(int, open(0).read().split())
b = [0] * 60
c = [0] * 60
ans = 0
for i in range(n):
    for j in range(60):
        c[j] += i - b[j] if a[i] >> j & 1 else b[j]
        b[j] += a[i] >> j & 1
for j in range(60):
    ans += c[j] << j
    ans %= 10**9 + 7
print(ans)
# Judge status: Accepted
a,b,x = map(int,input().split())
print('YES') if a <= x and x <= a+b else print('NO')
# Judge status: Accepted
n=int(input())
t,a=map(int,input().split())
ans=0
min=1000000000
h=list(map(int, input().split()))
for i in range(n):
  b=t-h[i]*0.006
  if min>abs(a-b):
    ans=i+1
    min=abs(a-b)
print(ans)
# Judge status: Accepted
ab,bc,ca = map(int,input().split())
print(int(ab*bc*(0.5)))
# Judge status: Wrong Answer
from math import gcd
n = int(input())
res = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            res += gcd(gcd(i, j), k)
print(res)
# Judge status: Wrong Answer
[n, x, t] = map(int, input().split())

ans = (n // x) * t

print(int(ans))
# Judge status: Accepted
N,M=map(int,input().split())
N,M=min(N,M),max(N,M)

if N==1:
    if M>=2:
        print(M-2)
    else:
        print(1)
else:
    print((N-2)*(M-2))
# Judge status: Accepted
N, K = map(int, input().split())
D = list(map(int, input().split()))
ans = N
while True:
    for i in D:
        if str(i) in str(ans):
            break
    else:
        break

    ans += 1

print(ans)
# Judge status: Accepted
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    s = list(input()[:-1].decode())
    if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
        print('Bad')
    else:
        print('Good')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
# Judge status: Wrong Answer
n=int(input())
cnt=0
tmp=0
l=list(map(int,input().split()))
for i in range(n-1):
    if l[i]>=l[i+1]:
        cnt+=1
        tmp=cnt

    else:
        tmp=cnt
        cnt=0
print(tmp)
# Judge status: Wrong Answer
import itertools
n, m, q = map(int, input().split())
l = []
for i in range(q):
    a, b, c, d = map(int, input().split())
    l.append([a-1, b-1, c, d])
ll = [i for i in range(1, 11)]
h = itertools.combinations_with_replacement(ll, n)
ans = 0
for v in h:
    vl = list(v)
    cnt = 0
    for i in range(q):
        ai, bi, ci, di = l[i]
        if vl[bi] - vl[ai] == ci:
            cnt += di
    ans = max(ans, cnt) 
print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
*A, = map(int, input().split())
d = [0]*(N+1)
for a in A:
        d[a] += 1
        d.sort()
        d.reverse()

print(sum(d[K:]))
# Judge status: Accepted
def f():
  n=int(input())
  l=tuple(tuple(map(int,input().split())) for i in range(n-1))
  for i in range(n):
    now=0
    for a,s,d in l[i:]:
      now=a+s-(-max(0,now-s)//d)*d
    print(now)
if __name__=="__main__":
  f()
# Judge status: Accepted
T = input()
print(chr(ord(T) + 1))
# Judge status: Accepted
S =input()

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
elif S == "SAT":
    print(1)
# Judge status: Wrong Answer
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
S = []
for i in range(N):
	S.append(rs())

import collections
h = collections.defaultdict(int)
for s in S:
	l = [0] * 26
	for c in s:
		n = ord(c)-ord('a')
		l[n] = 1
	h[tuple(l)] += 1

def comb(n, k):
	p, q = 1, 1
	for i in range(1, k+1):
		p = p * (n-i+1)
		q = q * i
	return p // q

ans = 0
for k, v in h.items():
	if v > 1:
		ans += comb(v, 2)
print(ans)
# Judge status: Accepted
import math
n, d = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]

count = 0
for i in range(n-1):
    for j in range(i+1, n):
        distance = 0
        for k in range(d):
            distance += (x[i][k] - x[j][k]) ** 2
        if math.sqrt(distance).is_integer():
            count += 1

print(count)
# Judge status: Accepted
from bisect import bisect_right

def main():
    inf=float("inf")
    n=int(input())
    alst=[int(input()) for _ in range(n)]
    work=[inf]*n
    for i in range(n-1,-1,-1):
        j=bisect_right(work,alst[i])
        work[j]=alst[i]
    print(n-work.count(inf))

main()
# Judge status: Accepted
N = int(input())
A = [((i+1),int(s)) for i,s in enumerate(input().split())]

for a in sorted(A, key = lambda x : x[1]):
	print(a[0],end = ' ')
# Judge status: Wrong Answer
a, b, x = map(int, input().split())

p = 0

for i in range(1,b//x+1):
    if a <= x*i:
        p = x*i
        break

if p != 0:
    t = b-p
    s = t//x
    ans = s + 1
    print(ans)
else:
    print(0)
# Judge status: Accepted
K = int(input())

x = 7
for i in range(K):
  if x % K == 0:
    print(i+1)
    exit()
  else:
    x = (10*x + 7) % K
print(-1)
# Judge status: Accepted
n,k=map(int,input().split(' '))
s=input()
m=''
if s[k-1].isupper():
    m=s[k-1].lower()
else:
    m=s[k-1].upper()

print(s[:k-1]+m+s[k:])
# Judge status: Accepted
def iip():
    return [int(i) for i in input().split()]

N, K = iip()
R, S, P = iip()
T = input()

point = 0
win = []
wp = {
    "r":P,
    "s":R,
    "p":S
}

for i in range(N):
    if i >= K and win[i-K] == T[i]:
        win.append(False)
    else:
        win.append(T[i])
        point += wp[T[i]]

#print(win)
print(point)
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))
cnt = 0
sum_a = 0
min_a = A[0]
for i in range(n):
    if A[i] <= 0:
        cnt += 1
        A[i] = A[i]*(-1)
    sum_a += A[i]
    if min_a > A[i]:
        min_a = A[i]
if cnt % 2 == 0:
    for a in A:
        ans = sum_a
else:
    ans = sum_a - 2*min_a
print(ans)
# Judge status: Wrong Answer
x = int(input())
a = 100
i = 0
while a < x:
  a = int(a * 1.01)
  i += 1
print(i)
# Judge status: Accepted
n = int(input())
ls = list(map(int,input().split()))
md = round(sum(ls)/n)
p = 0
for i in ls:
    p += (md-i)**2
print(p)
# Judge status: Accepted
import sys
from collections import defaultdict
def input(): return sys.stdin.readline().strip()

def main():
    N = int(input())
    A = list(map(int, input().split()))
    d = defaultdict(int)
    for a in A: d[a] += 1
    cand = []
    for key in d:
        for _ in range(d[key] // 2): cand.append(key)
    cand.sort(reverse=True)
    if len(cand) < 2:
        print(0)
        return
    print(cand[0] * cand[1])
    
    


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
A, B, N = map(int,input().split())

mx = 0

N = min(N,A)

for x in range(1,N+1):
    v = (A*x)//B - A * (x//B)
    #print (v)
    mx = max(mx,v)
print (mx)
# Judge status: Accepted
n,k=map(int,input().split())
s=input()
l=[]
for i in range(len(s)):
    l.append(s[i])
b = l[k-1].lower()
l[k-1] = b
print(''.join(l))
# Judge status: Accepted
N, K = map(int, input().split())
H = list(map(int, input().split()))

if N <= K:
  print("0")
  exit()

ans = 0

def quicksort(a):
  if len(set(a)) < 2:
    return a
  left = []
  center = a.pop(0)
  right = []
  for i in a:
    if i > center:
      right.append(i)
    else:
      left.append(i)
  left = quicksort(left)
  right = quicksort(right)
  left.append(center)
  left.extend(right)
  return left

H = quicksort(H)

for i in range(N-K):
  ans += H[i]

print(ans)
# Judge status: Accepted
n,y = map(int,input().split())

a,b,c = (-1,-1,-1)
for i in range(n+1):
    for j in range(n+1-i):
        if 10000*i + 5000*j + 1000*(n-i-j) == y:
            a,b,c = (i,j,n-i-j)
            break

print(a,b,c)
# Judge status: Accepted
a, b, c=map(int, input().split())
if a<=c<=b:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n, k = map(int, input().split())
D = set(map(int, input().split()))
for ans in range(n,10000):
    for c in str(ans):
        if int(c) in D:
            break
    else:
        print(ans)
        break
# Judge status: Wrong Answer
A, B, C, X = map(int, open(0).read().split())

print(sum(i * 500 + j * 100 + k * 50 for i in range(A + 1) for k in range(B + 1) for j in range(C + 1)))
# Judge status: Accepted
def counting(tar_word,tar_list):
	count = 0
	for i in range(len(tar_list)):
		if tar_word == tar_list[i]:
			count += 1
	return count

# 青いカード(1円加算)
N = int(input())
s = list()
for i in range(N):
	s.append(str(input()))
# 赤いカード(1円損失)
M = int(input())
t = list()
for i in range(M):
	t.append(str(input()))
target = s+t
target = set(target)
target = list(target)

ans = list()
for tar in target:
	count = 0
	count += counting(tar,s)
	count -= counting(tar,t)
	ans.append(count)

print(max(ans)) if max(ans) >= 0 else print(0)
# Judge status: Accepted
K = int(input())

gu = 0
for i in range(1,K+1):
    if i % 2 ==0:
        gu+=1

ki = 0
for j in range(1,K+1):
    if j % 2 ==1:
        ki+=1

print(gu*ki)
# Judge status: Accepted
#python3
s=input()
d={k:s.count(k) for k in set(s)}

def solve():
  if len(d) != 2:
    return False
  for i in d.values():
    if i != 2:
      return False
  return True

print('Yes') if solve() else print('No')
# Judge status: Accepted
a,b,x = map(int,input().split())

if a + b < x or a > x:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('a1.in')


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


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    A = read_int_list()
    if sum(A) >= 22:
      print('bust')
    else:
      print('win')


main()
# Judge status: Accepted
B=int(input())
S=input()
if B>=3200:
  print(S)
else:
  print("red")
# Judge status: Accepted
a, b, c = map(int, input().split())

if (a == b and b == c) or (a != b and b != c and c != a):
    print("No")
else:
    print("Yes")
# Judge status: Accepted
n, k = map(int, input().split())
a = [int(i) for i in input().split()]
b = set(a)
if k >= len(b):
    print(0)
else:
    d = {}
    for i in a:
        if i in d:
            d[i] += 1
        else:
            d[i] = 1
    c = list(d.values())
    c.sort()
    e = 0
    for i in range(len(b) - k):
        e += c[i]
    print(e)
# Judge status: Accepted
a,b=map(int,input().split())

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

for i in range(len(s)):
  a=a-s[i]
  
if a>=0:
  print(a)
else:
  print("-1")
# Judge status: Wrong Answer
# N=1079
N=int(input())

ans=int(round((N*100/108)+0.5))

if round((ans*1.08)+0.5) == N:
    print(ans)
else:
    print(":(")
# Judge status: Accepted
N = int(input())
base = N%10
if base in [2,4,5,7,9]:
    print('hon')
elif base in [0,1,6,8]:
    print('pon')
elif base == 3:
    print('bon')
# Judge status: Accepted
from bisect import bisect_left
from collections import deque
n = int(input())
a = [int(input()) for _ in range(n)]

LIS = deque()  # LISの中身は、LISの最小の数字を保持する
LIS.append(a[0])
for i in range(1, n):
    idx = bisect_left(LIS, a[i])
    if idx == 0:
        LIS.appendleft(a[i])
    else:
        LIS[idx-1] = a[i]
print(len(LIS))
# Judge status: Accepted
a,b,x = map(int, input().split())
if a%x == 0:
    print(b//x-a//x+1)
else:
    print(b//x-a//x)
# Judge status: Accepted
s = str(input())
k = int(input())
S = []
for i in range(len(s)):
    S.append(ord(s[i]) - 97)
i = 0
while k > 0:
    if S[i] > 0 and 26 - S[i] <= k:
        k -= 26 - S[i]
        S[i] = 0
        i += 1
    else:
        i += 1
    if i >= len(s):
        S[-1] += k
        break
ans = ''
for x in S:
    ans += chr((x % 26) + 97)
print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
print(1) if n%k else print(0)
# Judge status: Accepted
from collections import defaultdict
D1 = defaultdict(int)

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

for i in A:
  D1[i] += 1

for _ in range(M):
  B, C = map(int, input().split())
  D1[C] += B

D2 = sorted(D1.items(), reverse=True)

ans = 0
temp = N

for i in range(len(D2)):
  if temp <= D2[i][1]:
    ans += D2[i][0] * temp
    break
  else:
    ans += D2[i][0] * D2[i][1]
    temp -= D2[i][1]

print(ans)
# Judge status: Wrong Answer
n = input()[:-1]
while n[:len(n)//2] != n[len(n)//2:]:
  n = n[:-1]
print(len(n))
# Judge status: Accepted
import math

N = int(input())
rN = int(math.ceil(math.sqrt(N)))

for i in (range(rN,0,-1)):
    a=N//i
    if a*i==N:
        print(a+i-2)
        break
# Judge status: Wrong Answer
# 2020-08-30, Sun

n = int(input())
lis = sorted(list(map(int, input().split())))
a = 0
b = 0

for i in lis[::2]:
    a += i

for i in lis[1::2]:
    b += i

print(b - a)
# Judge status: Wrong Answer
#coding:utf-8
n, a, b = map(int, input().split())
ans = 0

for i in range(1, n+1):
    num = sum(map(int, str(i)))
    if num >= a and num <= b:
        ans += num
print(ans)
# Judge status: Accepted
N=int(input())
C,S,F=[],[],[]

for i in range(N-1):
    c,s,f=map(int,input().split())
    C.append(c)
    S.append(s)
    F.append(f)

T=[0]*N
for i in range(N):
    A=0
    for j in range(i,N-1):
        if A>=S[j]:
            A=((A+F[j]-1)//F[j])*F[j]
        else:
            A=S[j]
        A+=C[j]
    T[i]=A

print("\n".join(map(str,T)))
# Judge status: Accepted
N=int(input())
for i in range(1,10):
  if N%i==0:
    if N/i<10:
      print('Yes')
      break
else:
  print('No')
# Judge status: Accepted
n = int(input())
wr = input()
R_cnt = wr.count('R')
ans = wr.count('W',0,R_cnt)
print(ans)
# Judge status: Accepted
N = int(input())
d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for _ in range(N):
    S = input()
    d[S] += 1
print('AC x ' + str(d['AC']))
print('WA x ' + str(d['WA']))
print('TLE x ' + str(d['TLE']))
print('RE x ' + str(d['RE']))
# Judge status: Wrong Answer
A,B,X=map(int,input().split())

space=A*A*B-X

less=False
if space>A*A*B/2:
  less=True
  space=A*A*B-space

h=space/(A*A)*2
import math
print(math.degrees(math.atan(h/A))if less==False else 90-math.degrees(math.atan(h/A)))
# Judge status: Wrong Answer
a,b,c=map(int, input().split())
print("Yes" if a<=b<=c else "No")
# Judge status: Wrong Answer
import math
x, y = map(int, input().split())

if x == y:
    print(0)
else:
    print(int(math.log2(y/x)) + 1)
# Judge status: Accepted
s = sorted(input())
t = sorted(input(), reverse=True)
N = len(s)
M = len(t)

if s < t:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N,M=map(int, input().split())
a=N//2
b=a+1
if N&1:
    for i in range(M):
        print(a,b)
        a-=1
        b+=1
else:
    for i in range(M):
        print(a,b)
        a-=1
        b+=1
        if 2+N//2>b-a>=N//2: b+=1
# Judge status: Accepted
S = input()
T = input()
ans = "No"
def rot(s):
    return s[len(s)-1] + s[0:len(s)-1]
s = rot(S)
while(s != S):
    if (s == T):
        ans = "Yes"
        break
    s = rot(s)

if (s == T):
    ans = "Yes"
print(ans)
# Judge status: Accepted
N=int(input())
for i in range(1,N+1):
    #print("*",i)
    if (i*(i+1))//2>=N:
        print(i)
        break
# Judge status: Accepted
n=int(input())
lists=list(map(int,input().split()))
flag=True
for i in range(n):
    if lists[i]%2==0 and (lists[i]%3!=0 and lists[i]%5!=0):
        flag=False
if flag:
    print("APPROVED")
else:
    print("DENIED")
# Judge status: Wrong Answer
S = input()
S = list(S)

str_max = 0
for start in range(len(S)):
    for end in range(start, len(S)+1):
        if {"A","C","G", "T" } |set(S[start:end+1]) == {"A","C","G", "T" }:
            str_max = max(str_max, -start+end+1)

print(str_max)
# Judge status: Accepted
docs = [str(i) for i in input()]
res = [sub.replace('?', 'D') for sub in docs]
print(''.join(res))
# Judge status: Accepted
import math
n = int(input())

ans = []
d = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

todo = ['a']
while len(todo)>0:
    p = todo.pop(-1)
    l = len(p)
    cou = len(set(p))
    if l < n:
        for i in range(cou+1):
            todo.append(p+d[i])
    else:
        ans.append(p)


print('\n'.join(sorted(set(ans))))
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
ans = [0]*9
for i in a:
    if i < 400: ans[0] = 1
    elif i < 800: ans[1] = 1
    elif i < 1200: ans[2] = 1
    elif i < 1600: ans[3] = 1
    elif i < 2000: ans[4] = 1
    elif i < 2400: ans[5] = 1
    elif i < 2800: ans[6] = 1
    elif i < 3200: ans[7] = 1
    else: ans[8] += 1
print(max(sum(ans[:8]), 1), sum(ans[:8])+ans[-1])
# Judge status: Accepted
import sys
K = int(input())

t = 7
for i in range(K):
    if t % K == 0:
        print(i + 1)
        break
    t = (t*10+7) % K
else:
    print(-1)
# Judge status: Accepted
n = int(input())
if 1<=n<=999:
    print("ABC")
else:
    print("ABD")
# Judge status: Accepted
# 2020/07/05
# AtCoder Beginner Contest 173 - D

# Input
n = int(input())
a = list(map(int,input().split()))

# Calc
a.sort()
a.reverse()

ans = a[0]
idx = 1
for i in range(2, n):
    ans = ans + a[idx]
    if i % 2 != 0:
        idx = idx + 1
        
# Output
print(ans)
# Judge status: Accepted
import math
H,W = map(int,input().split())
all = H*W
if H == 1 or W == 1:
    print(1)
    exit()

if all % 2 == 1:
    print(all//2 + 1)
else:print(all//2)
# Judge status: Wrong Answer
n,m = map(int, input().split())

if n==m==1: print(1)
if n==1 or m==1: print(max(n,m)-2)
else:
    print((n-2)*(m-2))
# Judge status: Accepted
def f():
  n = int(input())
  *li,=map(int, input().split())
  from collections import Counter
  c = Counter()
  for i in li:
    c[i] += 1
  ans=0
  from math import comb
  for i in c.values():
    ans += comb(i, 2)
  for i in li:
    print(ans - comb(c[i], 2) + comb(c[i]-1, 2))
f()
# Judge status: Wrong Answer
N,K=map(int,input().split())
A=[0]+list(map(int,input().split()))
L=[]
tmp=1
cnt=1
L.append(1)
while True:
  L.append(A[tmp])
  tmp=A[tmp]
  cnt+=1
  #print(cnt,tmp)
  if A[tmp] in L:
    L.append(A[tmp])
    break
#print(L)
res=0
for i in range(len(L)):
  if L[i]!=L[-1]:
    res+=1
  else:
    break
#print(res)
R=L[res:-1]
#print(R)
K-=res
num=K%len(R)
ans=R[num]
print(ans)
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split())) [::-1]


for i in range(n-1):
    if h[i] < h[i + 1]:
        h[i + 1] -= 1
        if h[i] < h[i + 1]:
            print('No') 
            exit()
print('Yes')
# Judge status: Accepted
N,A,B,C,D =list(map(int,input().split()))
s = input()
flag = 0
if C<D:
    if s[B-1:D].count('##') == 0 and s[A-1:C].count('##') == 0:
        print('Yes')
    else:
        print('No')
else:
    if (s[B-2:D+1].count('...')>=1) and (s[A-1:C].count('##') == 0 ):
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
string=input()
for s in string:
  s='x'
print(string)
# Judge status: Wrong Answer

s = list(input())
ans = 0
tmp = []

for i in range(len(s)):
    for j in range(1,len(s)-i):
        tmp = s[i:(-1)*j]

#        print(tmp)
#        print(tmp.count("A"))
#        print(tmp.count("C"))
#        print(tmp.count("G"))
#        print(tmp.count("T"))

        if tmp.count("A") + tmp.count("C") + tmp.count("G") + tmp.count("T") == len(tmp):
            if len(tmp) >= ans:
                ans = len(tmp)

print(ans)
# Judge status: Accepted
S=raw_input()
prev=""
cur=""
ans=0
for x in S:
    cur+=x
    if prev!=cur:
        ans+=1
        prev=cur
        cur=""
    else:
        pass
print ans
# Judge status: Wrong Answer
n = int(input())

s = []
for i in range(n):
  s_i = int(input())
  if s_i%10==0:
    s_i=0
  s.append(s_i)
  
print(sum(s))
# Judge status: Accepted
x, a, b = map(int, input().split())

if b <= a:
    ans = "delicious"
elif b > a and b <= a + x:
    ans = "safe"
else:
    ans = "dangerous"
print(ans)
# Judge status: Wrong Answer
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
ls=[a,b,c]
ls.sort()
if a+b==c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
A = input()
B = input()

print("YES" if A[0] == B[-1] and A[-1] == B[0] and A[1] == B[1] else "NO")
# Judge status: Wrong Answer
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = 2
ans = ''

while n != 0:
    if n%a == 0:
        ans = '0' + ans
    else:
        ans = '1' + ans
        n-=(a//2)
    a*=(-2)

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

ans = 0
chk = a[0]
for x in a[1:]:
    if chk > x:
        ans += chk - x
    else:
        chk = x
print(ans)
# Judge status: Accepted

S = input()
T = input()

#TT = T[:len(S)]

if S == T[:len(S)]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x = int(input())
if x==1:
  print(1)
  exit()
ans = 1
for i in range(x, 0, -1):
  m = i
  div = []
  for j in range(2,int(m**0.5)+2):
    if m%j==0:
      count = 0
      while m%j ==0:
        m //= j
        count += 1
      div.append(count)
  if m!= 1:
    div.append(1)
  count = div[0]
  for c in div:
    if c!= count or count ==1:
      break
  else:
    print(i)
    exit()
print(ans)
# Judge status: Wrong Answer
def solve():
  n = int(input())
  l = list(map(int,input().split()))
  a = 1
  for i in l:
    a*=i
    if a>pow(10,18):
      return -1
  return a
print(solve())
# Judge status: Accepted
n=int(input())
print("ABC" if n<1000 else "ABD")
# Judge status: Accepted
import collections
w=input()
words=[a for a in w]
c=collections.Counter(words)
values,counts=zip(*c.most_common())
count=0
for n in counts:
    if n%2==1:
        print('No')
        break
    else:
        count+=1
        continue

if count==len(values):
    print('Yes')
else:
    pass
# Judge status: Accepted
a, b = map(int, input().rstrip().split())
r = -1 if 10 <= a or 10 <= b else a * b
print(r)
# Judge status: Accepted
import sys
input = sys.stdin.readline

N = int(input())
a = list(map(int, input().split()))
X = 0

for ai in a:
    X ^= ai

ans = [X^ai for ai in a]
print(*ans)
# Judge status: Accepted
d, t, s = map(int, input().split(' '))

if (s * t) >= d:
    print('Yes')
else:
    print('No')