peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a,b,c,d=map(int,input().split())

if (max(a,b)-min(a,b)) <= d and (max(c,b)-min(c,b)) <= d:
    print('Yes')
elif (max(a,c)-min(a,c)) <= d:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[]
for i in range(m):
  a.append(int(input()))
d=[1]*(n+1)
if 1 in a:
  d[1]=0

for i in range(n-1):
  if (i+2) in a:
    d[i+2]=0
  else:
    d[i+2]=(d[i]+d[i+1])%1000000007

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

from collections import deque

ans = deque()

if N%2 == 0:
    for i in range(N):
        if i%2 == 0:
            ans.append(a[i])
        else:
            ans.appendleft(a[i])
else:
    for i in range(N):
        if i%2 == 0:
            ans.appendleft(a[i])
        else:
            ans.append(a[i])

for i in range(N):
    print(ans[i],end=" ")
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

def main():
    S = set(input())
    if len(S) == 26:
        print("None")
        sys.exit()
    for i in range(97, 97+26):
        if chr(i) not in S:
            print(chr(i))
            sys.exit()

if __name__ == '__main__':
    main()
# Judge status: Accepted
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()
p.reverse()
q.sort()
q.reverse()
P = p[:x]
Q = q[:y]
R = P+Q+r
R.sort()
R.reverse()
T = R[:x+y]
ans = sum(T)
print(ans)
# Judge status: Wrong Answer
import math
r=int(input())
a=r**2*math.pi
A=1*math.pi
d=a//A
# Judge status: Accepted
s=input()
if s<="2019/04/30":
  print("Heisei")
else:
  print("TBD")
# Judge status: Accepted
a,b,m = map(int,input().split())

r = tuple(map(int,input().split()))
d = tuple(map(int,input().split()))

ans = min(r)+min(d)

for i in range(m):
    x,y,c = map(int,input().split())
    ans = min(ans,r[x-1]+d[y-1]-c)
    
print(ans)
# Judge status: Wrong Answer
w,a,b = map(int,input().split())
c = min(a,b)
d = max(a,b)
if c + w >= d:
  print(0)
else:
  print(d-c+w)
# Judge status: Wrong Answer
T = input()
T= T.replace("D?","DP")
T= T.replace("?","D")
print(T)
# Judge status: Accepted
def main():
  import bisect
  n=int(input())
  A=sorted(list(map(int,input().split())))
  B=list(map(int,input().split()))
  C=sorted(list(map(int,input().split())))
  lc=len(C)
  ans=0
  for b in B:
    ma = bisect.bisect_left(A, b)
    mc = lc-bisect.bisect_right(C, b)
    ans += ma*mc
  print(ans)

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



cnt = 0
i = 0
j = M
while i+1 < j and cnt < M:
    print(i+1, j)
    i += 1
    j -= 1
    cnt += 1

i = M
j = 2*M+1
while i+1 < j and cnt < M:
    print(i+1, j)
    i += 1
    j -= 1
    cnt += 1
# Judge status: Accepted
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))


d = {}
for num in a:
    d[num] = d.get(num, 0) + 1


for i in range(1, len(a)+2):
    if i in d:
        print(d[i])
    else:
        print(0)
# Judge status: Wrong Answer
n = int(input())
lis = []
for i in range(n):
    lis.append(int(input()))
button = lis[0]
count = 1
if button == 2:
    ans = 1
while True:
    count += 1
    button = lis[button - 1]
    if button == 2:
        ans = count
        break
    if count > n:
        ans = -1
        break
print(ans)
# Judge status: Accepted
a = int(input())
for n in list(range(a+1)):
  if n == 1:
    b,c,d = map(int, input().split())
    if c + d > b or (c + d - b) % 2 != 0:
      print('No')
      break
  if n >= 2:
    b1 = b
    c1 = c
    d1 = d
    b,c,d = map(int, input().split())
    if abs(c-c1) + abs(d-d1) > b-b1 or (abs(c-c1) + abs(d-d1) - (b-b1)) % 2 != 0:
      print('No')
      break
else:
  print('Yes')
# Judge status: Wrong Answer
a,b,c=map(int, input().split())

print(c-a+b)
# Judge status: Wrong Answer
n, m = [int(x) for x in input().split()]
lst = [None]*(n+1)
a = 0
b = 0
for i in range(m):
  p, s = input().split()
  p = int(p)
  if s == 'AC' and lst[p] is None:
    a += 1
    lst[p] = True
  elif s == 'WA' and lst[p] is None:
    b += 1
print(a,b)
# Judge status: Accepted
s = input()
s = s[:-1]

while len(s) % 2 != 0 or s[:len(s)//2] != s[len(s)//2:]:
  s = s[:-1]
print(len(s))
# Judge status: Accepted
a,b = map(int,input().split())
print(a*b) if a<=9 and b<=9 else print(-1)
# Judge status: Accepted
K, X = map(int,input().split())
for cnt in range(2*K-1):
  print(X-K+cnt+1, end = " ")
3
# Judge status: Wrong Answer
s= str(input())
ans = 0
for i in range(len(s)):
    if i // 2 == 0:
        if s[i] == '0':
            ans += 1
    else:
        if s[i] == '1':
            ans += 1
print(min(ans,len(s)-ans))
# Judge status: Accepted
n=int(input())
a=[0]*n
a[:]=map(int,input().split())
r=0
import copy
for ii in range(n-2):
  b=copy.copy(a[ii:ii+3])
  c=copy.copy(b)
  b.sort()
  if b[1]==c[1]:
    r+=1
print(r)
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
z = -1
res = float("inf")
for r in range(N):
  if a[r] < 0:
    z = r
    continue
  if r < K - 1: continue
  x = r - z
  y = a[z - (K - x) + 1]
  if K == x: y = 0
  t = min(abs(a[r]), abs(y))
  if r - z >= K: t = 0
  res = min(res, abs(a[r]) + abs(y) + t)
for l in range(N):
  if z - l + 1 == K:
    res = min(res, abs(a[l]))
    break
print(res)
# Judge status: Wrong Answer
import itertools
n,m=map(int,input().split())
ab= [list(input()) for _ in range(m)]
ab=list(itertools.chain.from_iterable(ab))
for i in range(1,n+1):
    print(ab.count(i))
# Judge status: Accepted
n = int(input())
a = [list(input().split()) for nesya in range(n)]
s = 1

for hoge in a:
  hoge[1] = int(hoge[1])*(-1)
  hoge.append(s)
  s += 1
a.sort()
for raw in a:
  print(raw[2])
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    a[i] -= i + 1
us, vs = 0, sum(a)
uc, vc = 0, n
a.sort()
ans = vs - a[0] * n
for i in range(n):
    us += a[i]
    uc += 1
    vs -= a[i]
    vc -= 1
    b = a[i]
    ans = min(ans, uc * b - us + vs - vc * b)
print(ans)
# Judge status: Wrong Answer
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
c = read().decode("utf-8")
l = [chr(ord('a') + i) for i in range(26)]
 
if c == "z":
    print("a")
    quit()
 
f = False
for a in l:
    if a == c:
        f = True
        continue
    if f:
        ans = a.strip()
        print(ans)
        quit()
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
if a==b and b==c:
    print(1)
elif a==b or b==c:
    print(2)
else:
    print(3)
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
maxNum = l[0]
total = 0

for i in range(1,len(l)):
    if maxNum <= l[i]:
        maxNum = l[i]
    else:
        total += maxNum - l[i]
print(total)
# Judge status: Accepted
S = input()
S_a = int(S[0] + S[1])
S_b = int(S[2] + S[3])
if((S_a >= 1 and S_a <= 12) and (S_b < 1 or S_b > 12)):
  print('MMYY')
elif((S_a < 1 or S_a > 12) and (S_b >= 1 and S_b <= 12)):
  print('YYMM')
elif((S_a >= 1 and S_a <= 12) and (S_b >= 1 and S_b <= 12)):
  print('AMBIGUOUS')
else:
  print('NA')
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from math import floor

x = int(readline())
v = 100
for i in range(x):
    v = floor(v * 1.01)
    if v >= x:
        print(i + 1)
        exit()
# Judge status: Accepted
n,m=map(int,input().split())
for i in range(0,m):
  if n-2*i-1>n/2 or n%2==1 :
    print(i+1,n-i)
  else:
    print(i+1,n-i-1)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))

border_4 = n//2
border_2 = n

cnt_4=0
cnt_2=0

for i in range(n):
    if a[i]%4==0:
        cnt_4+=1
        cnt_2+=1
    elif a[i]%2==0:
        cnt_2+=1
    else:
        continue


if cnt_4>=border_4:
    print('YES')
elif n-cnt_4*2<=(cnt_2-cnt_4):
    print('YES')
else:
    print('NO')
# Judge status: Accepted
def sol():
    n = int(input())
    mul = 1
    arr = list(map(int, input().split()))
    arr.sort()
    for i in arr:
        mul*=i
        if(mul>10**18):
            print(-1)
            return
    print(mul)
sol()
# Judge status: Accepted
S = input()
T = input()
if S == T[:-1] and (len(S)+1)==len(T):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = [[] for i in range(N)]
ans = [0]*N
for k, a in enumerate(A):
    a = a - 1
    B[a].append(k)


S = 0
for b in B:
    lenb = len(b)
    if lenb >= 1:
        S += lenb * (lenb-1) / 2

for i, b in enumerate(B):
    for j, k in enumerate(b):
        ans[k] = int(S - (len(b) - 1))
for i in ans:
    print(i)
# Judge status: Wrong Answer
n = int(input())
a = list(map(lambda x:int(x)//400, input().split()))

cnt = 0
for i in a:
    if i >= 8: cnt += 1

x = len(set(a))-(cnt>0)
y = len(set(a))+cnt-(cnt>0)
print(x, y)
# Judge status: Accepted
n = input()
keta = len(n)
if n[0] == '9':
    # 9999
    if n[1:] == '9'*(keta-1):
        print(9*keta)
    # 9899
    else:
        print(9*keta-1)
else:
    # 49999
    if n[1:] == '9'*(keta-1):
        print(int(n[0]) + 9*(keta-1))
    # 234
    else:
        print(int(n[0])-1 + 9*(keta-1))
# Judge status: Wrong Answer
import collections
n=int(input())
a=list(map(int,input().split()))

b=collections.Counter(a)
for i in range(n+1):
    print(b[i])
# Judge status: Accepted
n = int(input())
L = [0 for _ in range(n+2)]
L[0]=2
L[1]=1
if n >= 2:
    for i in range(2,n+1):
        L[i] = L[i-1]+L[i-2]
print(L[n])
# Judge status: Accepted
#--Palindrome-philia

S = input()
s_str = list(S)
s_rev = s_str[::-1]

num = len(s_str)

j = 0
for i in range(num):
  if (s_str[i] == s_rev[i]):
    pass
  else:
    j = j + 1

print (int(j/2))
# Judge status: Wrong Answer
s=int(input())
a=10**9
"""
def tr(x1,y1,x2,y2,x3,y3):
    a1=x2-x1
    b1=y2-y1
    a2=x3-x1
    b2=y3-y1
    return(abs(a1*b2-a2*b1)/2)
"""
if s<=10**9:
    print(0,0,s,0,0,1)
elif s%a==0:
    print(0,0,a,0,s,s//a)
else:
    x1,y1=0,0
    x2,y2=s//a+1,a-s%a
    x3,y3=1,a
    print(x1,y1,x2,y2,x3,y3)
# Judge status: Wrong Answer
N, K = map(int, input().split())
c = 0
 
while 1:
    if (N%2==0)and(K%2==0)and(N>=K):
        a = 0
        break
    if K==1:
        a = 0
        break
    if N==0:
        a = K
        break
    a = N
    N = abs(N-K)
 
    if c==0:
        c += 1
        continue
    if a<=N:
        break
print(a)
# Judge status: Wrong Answer
s = input()
for i in s:
  if s[-1] == 's':
    s.join('es')
  else:
    s.join('s')
print(s)
# Judge status: Wrong Answer
n = int(input())
flag = 0
ans = 0
if len(str(n)) > 2:
    ans += (len(str(n)) - 2) * 9
    X = n // 10 ** (len(str(n)) - 2)
    if str(n % 10 ** (len(str(n)) - 2)).count('9') == len(str(n)) - 2:
        flag = 1
else:
    X = n

if len(str(X)) == 1:
    ans += X
else:
    if X // 10 == 1:
        ans += 9
        flag = 0
    else:
        ans += (X // 10 - 1) + 9
if flag:
    ans += 1
print(ans)
# Judge status: Accepted
X,Y,Z = map(int,input().split())
print((X-Z)//(Y+Z))
# Judge status: Accepted
N = int (input ())
x =0
for i in range (N):
  x += N-i
print (x)
# Judge status: Accepted
a,b=map(int,input().split())
print(a*b if a<10 and b<10 else -1)
# Judge status: Accepted
n = int(input())
if n>999:
    print("ABD")
else:
    print("ABC")
# Judge status: Wrong Answer
import bisect

n = int(input())
seq = []
for i in range(n):
    seq.append(int(input()))
seq.reverse()
LIS = [seq[0]]
for i in range(len(seq)):
    if seq[i] >= LIS[-1]:
        LIS.append(seq[i])
    else:
        LIS[bisect.bisect_left(LIS, seq[i])] = seq[i]

print(len(LIS)-1)
# Judge status: Accepted
N, W = map(int, input().split())
dp = [[0] * (W+1) for _ in range(N+1)]
w, v = [0]*N, [0]*N
for i in range(N):
    w[i], v[i] = map(int,input().split())
for i in range(N):
    for k in range(W+1):
        if w[i] <= k:
            dp[i+1][k] = max(dp[i][k-w[i]]+v[i], dp[i][k])
        else:
            dp[i+1][k] = dp[i][k]
print(dp[N][W])
# Judge status: Accepted
S = input()
N = len(S)
for i in reversed(range(N)):
    S = S[:-1]
    if i % 2 == 0:
        if S == S[:i//2]*2:
            print(i)
            exit()
# Judge status: Wrong Answer
a = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
# 数値の取得
a = int(input())
b = int(input())
h = int(input())

# 面積を求めて出力
area = (a + b) * h / 0.5
print(area)
# Judge status: Wrong Answer
n = int(input())
 
def eq2(y):
    c2 = 0
    while y % 2 == 0:
        c2 += 1 
        y = y // 2
    return c2
def eq5(y):
    c5 = 0
    while y % 5 == 0:
        c5 += 1 
        y = y // 5
    return c5

cc2 = 0
cc5 = 0
if n % 2 != 0:
    print(0)
else:
    for k in range(n, 1, -2):
        cc2 += eq2(k)
        cc5 += eq5(k)
print(min(cc2, cc5))
# Judge status: Accepted
n, m = map(int, input().split())

count = n * (n - 1) // 2 + m * (m - 1) // 2
print(count)
# Judge status: Wrong Answer
s = input()
n = len(s)
a=[]
for i in range(n):
    a.append(s[i])

if len(a) == len(set(a)):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
ans=''
for i in range(1,99):
    if N<=26**i:
        N-=1
        for j in range(i):
            ans += chr(ord('a')+N%26)
            N//=26
        break
    else:
        N -= 26**i
print(ans[::-1])
# Judge status: Wrong Answer
import math
import queue

def readInt():
	return int(input())

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

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


q = queue.Queue()

for i in range(1,10):
	q.put(i)

n = readInt()

for i in range(1,100000):
	a = str(q.get())
	b = int(a[-1])
	print(b)
	if b!=0:
		q.put(int(a+str(b-1)))
	q.put(int(a+str(b)))
	if b==9:
		q.put(int(a+str(b+1)))	
	if i==n:
		print(int(a))
		break
# Judge status: Accepted
s=list(map(int,input().split("/")))
if s[0]<2019:
    print("Heisei")
elif s[0]>2020:
    print("TBD")
else:
    print("TBD" if s[1]>4 else "Heisei")
# Judge status: Accepted
x,k,d=map(int,input().split())
x=abs(x)
c=x//d
if k<=c:
  print(abs(x-k*d))
else:
  f=x-c*d
  k-=c
  if f>0:
    if k%2==1:
      print(abs(f-d))
    else:
      print(abs(f))
  if f<0:
    if k%2==1:
      print(abs(f+d))
    else:
      print(abs(f))
  if  f==0:
    if k%2==1:
      print(abs(f+d))
    else:
      print(0)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

B = [0]*N

for i in range(N):
    B[A[i]-1] = i+1

print(*B)
# Judge status: Accepted
N,M,X = map(int,input().split())
d=[]
ans = []
for i in range(N):
    l=list(map(int,input().split()))
    d.append(l)
for i in range(2**N):
    u=[0]*M
    price=0
    for j in range(N):
           if ((i>>j) & 1):
                price+=d[j][0]
                for k in range(M):
                    u[k]+=d[j][k+1]
    if all(x>=X for x in u):
        ans.append(price)
print(min(ans) if len(ans) > 0 else -1)
# Judge status: Wrong Answer
import numpy as np

N, K = [int(x) for x in input().split()]
A = list([int(x) for x in input().split()])

r = np.cumprod(A, dtype='int64')

before = r[K-1]
for i in range(K, N):
    after = before // A[i-K]
    after *= A[i]

    if after > before:
        print('Yes')
    else:
        print('No')

    before = after
# Judge status: Accepted
s = input()

if s == "ABC":
    print("ARC")
else:
    print("ABC")
# Judge status: Accepted
s=int(input())

if s==1 or s==2 or s==4:
  cnt=0
else:
  cnt=0
  while s!=4:
    if s%2==0:
      s=s/2
      cnt+=1
    else:
      s=3*s+1
      cnt+=1 

print(cnt+4)
# Judge status: Accepted
n,*a=map(int,open(0).read().split());t=sum(a);print(sum([w:=1]+[exit(print(-1)) if(w:=min(2*(w-q),t:=t-q))<0 else w for q in a]))
# Judge status: Wrong Answer
n = int(input())
a = [int(input()) for i in range(n)]
b = a[0]
if b == 2:
    print(0)
else:
    c = 1
    d = []
    while b != 2:
        b = a[b - 1]
        if b in d:
            print(- 1)
            break
        else:
            d.append(b)
            c += 1
    else:
        print(c)
# Judge status: Accepted
import os, sys, re, math

(N, K) = [int(n) for n in input().split()]

if K == 1:
    print(1)
else:
    lk = math.log2(K - 1)
    p = 0
    for i in range(1, N + 1):
        if i >= K:
            p += 1.0
        else:
            p += (0.5 ** (int(lk - math.log2(i) + 1)))
    print(p / N)
# Judge status: Accepted
print(input() if int(input()) >= 3200 else "red")
# Judge status: Accepted
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

c = 0
n = int(input())
l = list(map(int,input().split()))

l_cm = lcm_list(l)

for i in range(0,n):
    c = c + l_cm//l[i]
print(c%(10**9 + 7))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

c = 1
m = a[0]

s = 1 # 0:- 1:_ 2:+

for i in a:
    if m == i:
        continue
    elif m > i:
        if s == 2:
            s = 1
            c += 1
        else:
            s = 0
    else:
        if s == 0:
            s = 1
            c += 1
        else:
            s = 2
    m = i

print(c)
# Judge status: Accepted
s = input()
t = input()
n = len(s)
m = len(t)
ans = m
for i in range(n-m+1):
    p = 0
    for j in range(m):
        if s[i+j] != t[j]:
            p += 1
    ans = min(ans,p)
print(ans)
# Judge status: Accepted
n=int(input())
ans=(n)*(n-1)//2
print(ans)
# Judge status: Accepted
n, m = list(map(int,input().split()))

res = 10**9
for i in range(n, m):
    for j in range(i+1, m+1):
        res = min(res, (i*j % 2019))
        if res == 0:
            print(0)
            exit()
print(res)
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
s = 0
if n <= 2:
  s = 0
else:
  for i in range(n):
    for j in range(i+1, n):
      for k in range(j+1, n):
        a = l[i]
        b = l[j]
        c = l[k]
        if a+b>c and b+c>a and c+a>b and a != b and b != c and c != a:
          s += 1
print(s)
# Judge status: Accepted
a,b,c = map(int,input().split())
if b-a == c-b:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
N,D =(int(x) for x in input().split())
xy = [map(int,input().split()) for _ in range(N)]
x,y = [list(i) for i in zip(*xy)]
n = 0
 
for i in range(N):
  if(x[i]**2 + y[i]**2 <= D**2):
    n += 1
 
print(n)
# Judge status: Accepted
x = int(input())
S = set()
S.add(1)
for b in range(2, int(1000**0.5) + 1):
	for p in range(2, 10):
		if b**p > 1000:
			break
		S.add(b**p)
for n in range(x, 0, -1):
	if n in S:
		print(n)
		exit()
# Judge status: Accepted
k,x=map(int, input().split())
print(" ".join([str(i) for i in range(x-(k-1), x+(k-1)+1)]))
# Judge status: Accepted
N, C, K = map(int, input().split())

T = [int(input()) for _ in range(N)]
T.sort()

bus = []

count = 0
for i in range(N):
    if count == 0:
        first = T[i]
        count += 1
    else:
        if T[i] - first <= K:
            count += 1
        else:
            bus.append(count)
            first = T[i]
            count = 1
    if count >= C:
        bus.append(count)
        count = 0

if count > 0:
    bus.append(count)

print(len(bus))
# Judge status: Accepted
mod = 1000000007
eps = 10**-9


def main():
    import sys
    from collections import Counter
    input = sys.stdin.readline

    N = int(input())
    S = input().rstrip('\n')

    C = Counter(S)
    ans = 1
    for x in C.values():
        ans = (ans * (x+1))%mod
    print(ans-1)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import numpy as np
s = input()
n = len(s)
ans = 0
for i in range(n // 2):
	if s[2 * i] == "0":
		ans += 1
	if 2 * i + 1 == n:
		break
	if s[2 * i + 1] == "1":
		ans += 1
print(min(ans, n - ans))
# Judge status: Wrong Answer
import math
n=int(input())
s=input()
s1=s[:n//2]
s2=s[math.ceil(n/2):]
if s1==s2:
    print('Yes')
else :
    print('No')
# Judge status: Accepted
s=input()
cnt_c=0
for i in s:
    if i=='C':
        cnt_c+=1
c_present=False
n=len(s)
for i in range(2,n-1):
    if s[i]=='C':
        c_present=True
flag=True
for i in s:
    if i!='A' and i!='C':
        if i.isupper():
            flag=False
if s[0]=='A' and cnt_c==1 and c_present and  flag:
    print('AC')
else:
    print('WA')
# Judge status: Accepted
s=sorted(set(input()))
print('Yes' if ['A','B'] == s else 'No')
# Judge status: Accepted
import numpy as np
import sys

input = sys.stdin.readline

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


if A == B == C and A%2 == 0 and B%2 == 0 and C%2 == 0:
    ans = -1
else:
    ans = 0
    while A%2 == 0 and B%2 == 0 and C%2 == 0:
        next_a = C/2 + B/2
        next_b = A/2 + C/2
        next_c = A/2 + B/2
        A = next_a
        B = next_b
        C = next_c
        ans += 1

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

cnt = 0
while x <=  y:
    x *= 2
    cnt += 1
print(cnt)
# Judge status: Accepted
import math
N,X,T = list(map(int,input().split(" ")))
k = math.ceil(N/X)
print(k*T)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

s = int(input())
arr = [0] * 1000100
cnt = 0
while True:
    if s % 2 == 0:
        s //= 2
    else:
        s = 3 * s + 1
    cnt += 1
    arr[s] += 1
    if arr[s] > 1:
        print(cnt + 1)
        exit()
# Judge status: Wrong Answer
a = input()
t =list(a)
if t[len(t)-1] == "?":
    t[len(t)-1] = "D"
for i in reversed(range(1,len(t)-1)):
    if t[i] == "?" and t[i+1] == "D":
        t[i] = "P"
    elif t[i] == "?":
        t[i] = "D"
if t[0] == "?":
    if t[1] == "D":
        t[0] = "P"
    else:
        t[0] = "D"
answer = "".join(t)
print(answer)
# Judge status: Wrong Answer
n = int(input())
s = str(input())
ans = 0
ans_lis = []

for i in range(n):
    if s[i] == "I":
        ans += 1
        ans_lis.append(ans)
    else:
        ans -= 1
        ans_lis.append(ans)

print(max(ans_lis))
# Judge status: Accepted
n,a,b = map(int,input().split())
mod = 10**9+7
ans = pow(2,n,mod)
def cmb(n,r,mod):
  if n == r:
    return 1
  p,q = 1,1
  r = min(r,n-r)
  for i in range(r):
    p = p*(n - i)%mod
    q = q*(i + 1)%mod
    Y = pow(q,10**9+5,mod)
  return p*Y%mod
ans = ans - cmb(n,a,mod) - cmb(n,b,mod) - 1
print(ans%mod)
# Judge status: Accepted
n = int(input())
P = list(map(int, input().split()))

count = 0
for i in range(n - 1):
    if P[i] == i + 1:
        P[i], P[i + 1] = P[i + 1], P[i]
        count += 1
if P[-1] == n:
    count += 1

print(count)
# Judge status: Wrong Answer
from collections import Counter
N = int(input())
A = Counter(map(int, input().split()))
X = 0
for x, y in A.items():
  if x <= y and X < x:
    X = x
print(N - X)
# Judge status: Accepted
w = input()
G = []
q = 0
for x in w:
    if not ([x, True] in G or [x, False] in G):
        G.append([x, True])
    else:
        if [x, True] in G:
            G[G.index([x, True])][1] = False
        else:
            G[G.index([x, False])][1] = True
for h in range(len(G)):
    q += G[h][1]
#print(G)
if q == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N > K:
    print(K*X+((N-K)*Y))
else:
    print(N*X)
# Judge status: Accepted
A,B = map(int, input().split())
if A==B:
    print(A*2)
else:
    print(max(A,B)*2-1)
# Judge status: Accepted
L = int(input())
x = L/3
ans = x**3
print(ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
A, B = map(int, input().split())
print(':(' if A > 8 or B > 8 else 'Yay!')
# Judge status: Wrong Answer
a = int(input())
b=0
for i in range(1,a+1):
  if i%3 != 0 and i%5 != 0 :
    b+=i
print(b)
# Judge status: Wrong Answer
n,m,x,y=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
cnt=0
if max(X)>=min(Y):
  print('War')
else:
  for i in range(max(X)+1,min(Y)+1):
    if x<i and i<=y:
      print('No war')
      cnt+=1
      exit()
  if cnt==0:
    print('War')
# Judge status: Wrong Answer
n, k = map(int, input().split())

s = 0
for i in range(n):
  t = float(k / (2 * (i+1)))
  s += (1/n) * ((1/2) ** t)
  
print(s)