peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
[n,x,y]=list(map(int,input().split()))
anslist=[0]*(n-1)
for i in range(n-1):
    for j in range(i+1,n):
        if i<=x-1 and y-1<=j:
            kyori=j-y+x-i+1
        else:
            kyori=j-i
        anslist[kyori-1]+=1
for i in range(len(anslist)):
    print(anslist[i])
# Judge status: Accepted
from collections import Counter
n = int(input())
list_N = [int(input()) for _ in range(n)]
l = Counter(list_N)
k = l.values()
ans = 0
for num in k:
    if num % 2 == 1:
        ans += 1
print(ans)
# Judge status: Accepted
def main():
    n,m = tuple([int(t)for t in input().split()])
    a = [int(t)for t in input().split()]

    e = [tuple([int(t)for t in input().split()])for _ in [0]*m]

    e.sort(key=lambda x:x[1])
    t = 0
    for _ in [0]*m:
        b,c = e.pop()
        t+=b
        for _ in [0]*b:
            a.append(c)
        if t>n:break
    
    a.sort(reverse = True)
    print(sum(a[:n]))
if __name__ == "__main__":
    main()
# Judge status: Accepted
import collections

N = int(input())
A = list(map(int, input().split()))
a_dic = collections.Counter(A)
Q = int(input())
sum_a = sum(A)
for i in range(Q):
    b, c = list(map(int, input().split()))
    sum_a += (c-b) * a_dic[b]
    if b not in a_dic:
        pass
    else:
        if c not in a_dic:
            a_dic[c] = a_dic[b]
        else:
            a_dic[c] += a_dic[b]
        a_dic[b] = 0
    print(sum_a)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=sum(a)
q=int(input())
dp=[0]*(10**5+1)
for i in range(1,10**5+1):
  dp[i]=a.count(i)
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    a = [int(input()) for i in range(n)]
    b = sorted(a, reverse=True)

    for i in range(n):
        if a[i] == b[0]:
            print(b[1])
        else:
            print(b[0])

if __name__ == '__main__':
    main()
# Judge status: Accepted
import collections
n=int(input())
a=collections.Counter(input())
for i in range(n-1):
    s=collections.Counter(input())
    a=a&s
ans=""
k=a.keys()
v=a.values()
for i,j in zip(k,v):
    ans+=i*j
print("".join(sorted(ans)))
# Judge status: Wrong Answer
def solve(s):
  memo = [0]*(len(s)+1)
  def dp(string):
    l = len(string)
    if l == 0:
      return 0
    elif l == 1:
      return 1
    elif l == 2:
      if s[0] == s[1]:
        return 1
      else:
        return 2
    elif s[-1] == s[-2]:
      return memo[l-3] + 2
    else:
      return memo[l-1] + 1
  for i in range(len(s)):
    memo[i+1] = dp(s[:i+1])
  return memo[-1]

print(solve(input()))
# Judge status: Accepted
s=int(input())
a=[0]*10**6
a[0]=s
def f(n):
    if n%2==0:
        return int(n/2)
    else:
        return 3*n+1
for i in range(1,10**6):    
    a[i]=f(a[i-1])
    if a[i] in a[:i]:
        ans=i+1
        break
print(ans)
# Judge status: Accepted
N,K = map(int,input().split())
X = list(map(int,input().split()))
A = []

for n in range(N-K+1):
  A+=[X[n+K-1]-X[n]+min(abs(X[n]),abs(X[n+K-1]))]

print(min(A))
# Judge status: Accepted
X = int(input())
f = X // 500
X = X - f * 500
g = X // 5
print(1000*f + 5*g)
# Judge status: Wrong Answer
n = int(input())
p = 1
for i in range(1, n+1):
	p *= i
print(i % 10**9+7)
# Judge status: Wrong Answer
n = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
  if(n%i==0):
    print("OK")
    exit(0)
print("NG")
# Judge status: Accepted
import math
n, d = map(int ,input().split())
print(math.ceil(n/(d*2+1)))
# Judge status: Accepted
s = int(input())
x1 = 10**9
x2 = 1
def ceil(a, b):
   return a // b + (a % b > 0)

y2 = ceil(s, x1)
y1 = 10**9 - s % 10**9
if y1 == 10**9:
    y1 = 0
print(0)
print(0)
print(x1)
print(y1)
print(x2)
print(y2)
# Judge status: Accepted
n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

As = [0] * (n + 1)
Bs = [0] * (m + 1)
for i in range(n):
  As[i + 1] = A[i] + As[i]
for i in range(m):
  Bs[i + 1] = B[i] + Bs[i]

l = 0
r = n + m + 1
while r - l > 1:
  p = (l + r) // 2
  best = min(
    As[i] + Bs[p - i] for i in range(p + 1)
    if min(i, n) + min(p - i, m) == p
  )
  if best <= k:
    l = p
  else:
    r = p
print(l)
# Judge status: Accepted
S = input()

from datetime import datetime as dt

ans = 0

#x = dt.strptime(S, "%Y%m")

try:
  x = dt.strptime("20"+S, "%Y%m")
  ans_s = "YYMM"
except:
  ans += 1
try:
  dt.strptime(S[:2] + "20" + S[2:], "%m%Y")
  ans_s = "MMYY"
except:
  ans += 1
  
if ans == 2:
  print("NA")
elif ans == 0:
  print("AMBIGUOUS")
else:
  print(ans_s)
# Judge status: Accepted
X, Y = map(int, input().split())

tmp = X
cnt = 1
while True:
    tmp *= 2
    if tmp > Y:
        break
    else:
        cnt += 1
print(cnt)
# Judge status: Accepted
a, b, k = list(map(int, input().split()))

if k >= a:
    print(0, max(0, b-k+a))
else:
    print(a-k, b)
# Judge status: Accepted
import sys,math,collections,itertools
input = sys.stdin.readline

N = int(input())
s = input().rstrip()
cntb =0
cntw = s.count('.')
ans =cntw
for i in range(len(s)):
    if s[i] == '#':
        cntb +=1
    else:
        cntw -=1
    ans = min(ans,cntb+cntw)
print(ans)
# Judge status: Accepted
from itertools import product
from collections import Counter
K = int(input())

import functools
def gcd(a,b):
    while b:
        a,b = b, a%b
    return a

def list_gcd(l):
    return functools.reduce(gcd,l)

ans = 0
l = []
for i,j in product(range(1,K+1),repeat=2):
    l.append(gcd(i,j))
dic = Counter(l)

for k,v in dic.items():
    for i in range(1,K+1):
        ans += gcd(k,i)*v

print(ans)
# Judge status: Accepted
def m():
    N = int(input())
    A = [0] + list(map(int, input().split()))
    X = [0] * (N+1)
    for i in range(N, 0,-1):
        p = 0
        for j in range(i, N+1, i):
            if X[j]: p +=1
        if p % 2 != A[i]:
            X[i] = 1
    M = X.count(1)
    print(M)
    for i in range(1, N+1):
        if X[i] == 0:
            continue
        print(i, end=' ')
    return

m()
# Judge status: Accepted
import datetime

s = input()
ans = [['NA', 'MMYY'], ['YYMM', 'AMBIGUOUS']]

try:
    datetime.datetime.strptime(s,"%y%m")
    ans1 = 1
except ValueError:
    ans1 = 0

try:
    datetime.datetime.strptime(s,"%m%y")
    ans2 = 1
except ValueError:
    ans2 = 0

print(ans[ans1][ans2])
# Judge status: Accepted

N = input()
dp = [[0] * 2 for _ in range(len(N) + 1)]
dp[0][1] = 1

for i in range(len(N)):
    n = int(N[i])
    dp[i + 1][0] = min(dp[i][0] + n, dp[i][1] + 10 - n)
    dp[i + 1][1] = min(dp[i][0] + n + 1, dp[i][1] + 10 - (n + 1))

print(dp[-1][0])
# Judge status: Wrong Answer
l = int(input())
n = l
l = round(l / 3)
print(l*l*(n-l*2))
# Judge status: Accepted
S = input()
from collections import Counter
C = Counter(S)
A = [C['a'], C['b'], C['c']]
print("YES" if max(A) - min(A) < 2 else "NO")
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))
ans = 0
for i, l in enumerate(L):
  if i % 2 == 1 and l % 2 == 1:
    ans += 1
print(ans)
# Judge status: Accepted
import math
from functools import reduce
N, X = map(int, input().split())
x = list(map(int, input().split()))
x = [y - X for y in x]
if len(x)==1:
    for y in x:
        print(abs(y))
else:
    print(reduce(math.gcd, x))
# Judge status: Accepted
n = int(input())
s = input()

if n % 2 == 1:
    print("No")
else:
    if s[0:n//2] == s[n//2:]:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
import sys
n,m = map(int,input().split())
if m < 2:
  print(0)
  sys.exit()
if(1 < m < n) or 2*n > m >= n:
  print(m//2)
  sys.exit()
m -= 2*n
print(n+(m//4))
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**9)

def main():
    n, x, t = map(int, input().split())
    if n % x == 0:
        print((n//x)*t)
    else:
        print((n//x+1)*t)
    return


if __name__ == "__main__":
    main()
# Judge status: Accepted
import math
n = int(input())
d = 1
i = 1
while i <= math.sqrt(n):
  if n%i == 0:
    d = i
  i+=1
print(d + n//d -2)
# Judge status: Accepted
N = int(input())
if N == 0 or N%1000 == 0:
  print('0')
else:
  print(1000 - N%1000)
# Judge status: Wrong Answer
d,n  =map(int,input().split())
if n%100 != 0:
    ans = 10**d*n
else:
    ans = 10**d*101
print(ans)
# Judge status: Accepted
def nc2(n):
  if n<2:
    return 0
  else:
    return (n*(n-1))//2
n,m = map(int, input().split())
print(nc2(n)+nc2(m))
# Judge status: Accepted
n = int(input())

now = 0
ans = [0] * (n)
CSF = [list(map(int, input().split())) for _ in range(n - 1)]
for i in range(n - 1):
    now = 0
    for j in range(n - i - 1):
        c, s, f = CSF[i + j]
        if now <= s:
            now = s
        else:
            now = f * ((now + f - 1) // f)
        now += c
    ans[i] = now

print("\n".join(map(str, ans)))
# Judge status: Accepted
N, M = map(int, input().split())
K = [list(map(int,input().split())) for _ in range(N)]


result = {i : 0 for i in range(1, M+1)}

for i in range(1, M+1):
  dislike =False
  for j in range(N):
    if not i in K[j][1:]:
      dislike = True
  if not dislike:
    #print(i)
    result[i] = 1
    
print(sum(result.values()))
# Judge status: Wrong Answer
D = int(input())
c = list(map(int, input().split()))
import numpy as np
N = 5
S = np.zeros((N, 26))
for i in range(N):
    temp_s = list(map(int, input().split()))
    S[i, :] = temp_s
sumS = np.sum(S, axis=0)
for i in range(26):
    sumS[i] -= c[i]*132860
for i in range(N):
    print(np.argmax(sumS+1))
# Judge status: Wrong Answer
K=int(input())
sevens=7
count=1

if K%2==0:
  print(-1)
else:
  while True:
    if sevens%K==0:
      print(count)
      break
    else:
      sevens+=7*(10**count)
      
      if sevens>10**6:
        print(-1)
        break
        
      count+=1
# Judge status: Accepted
import sys
readline = sys.stdin.readline

MOD = 10**9+7
def comb(a, b):
    res = 1
    pres = 1
    for i in range(b):
        res = (res*(a-i))%MOD
        pres = (pres*(i+1))%MOD
    return res*pow(pres, MOD-2, MOD) % MOD


N, A, B = map(int, readline().split())
ans = pow(2, N, MOD) - 1 - comb(N, A) - comb(N, B)
print(ans%MOD)
# Judge status: Accepted
a,b,c=map(int,input().split())
if b+c>a:
    print(b+c-a)
else:
    print(0)
# Judge status: Wrong Answer
def main():
    H1,M1,H2,M2,K = [int(x) for x in input().split()]
    if M2 >= M1:
        print(((H2-H1)*60 + M2-M1 - 1) // K * K)
    else:
        print(((H2-H1)*60 + M1+M2-60 - 1) // K * K)

if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b, c, d = [c for c in input()]
candids = []
for i in range(8):
    candid = []
    for k in range(3):
        if i >> k & 1 > 0:
            candid.append("+")
        else:
            candid.append("-")
        
    candids.append(candid)
#print(candids)
for op1, op2, op3 in candids:
    if eval(a+op1+b+op2+c+op3+d) == 7:
        print (a+op1+b+op2+c+op3+d+"=7")
        break
# Judge status: Accepted
n,m = map(int, input().split())
if n==m==1: print(1)
elif n == 1 or m == 1: print(max(n,m)-2)
else: print((n-2) * (m-2))
# Judge status: Accepted
from math import gcd

ans = 0
k = int(input().strip())
for a in range(1, (k + 1)):
    for b in range(1, (k + 1)):
        for c in range(1, (k + 1)):
            ans += gcd(gcd(a, b), c)
print(ans)
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))
S=0
cnt=0 #マイナスの個数
m=10**10 #絶対値の最小値
for a in A:
    S+=abs(a)
    m=min(abs(a),m)
    if a<0:
        cnt+=1

if cnt%2==0 or m==0:
    print(S)
    
else:
    print(S-2*m)
# Judge status: Wrong Answer
N=int(input())
A=[]
B=[]
for _ in range(N):
  a, b=map(int, input().split())
  tmpa=a%b
  A.append(tmpa)
  B.append(b)
ans=0
for i in range(N-1, -1, -1):
  if A[i]==0:
    continue
  tmp=B[i]-(A[i]+ans)%B[i]
  ans+=tmp
print(ans)
# Judge status: Accepted
import bisect,collections,copy,heapq,itertools,math,operator,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
S = S()
condition1 = S[0]=='A'
condition2 = S[2:-1].count('C')==1
S = S.replace('A','a',1)
S = S.replace('C','c',1)
condition3 = S.islower()
print('AC' if condition1 and condition2 and condition3 else 'WA')
# Judge status: Wrong Answer
from collections import defaultdict
n = int(input())
dd = defaultdict(int)
for i in range(n):
    s = int(input())
    dd[i+1] = s
res = 0
tmp = 0
for key in dd.keys():
    res+=((dd[key]+tmp)//2)
    tmp = dd[key]%2  #余った分
print(res)
# Judge status: Accepted
import math
a,b,h,m=map(int,input().split())
h=h%12
m=m%60
deg_a=2*math.pi*(h/12+m/720)
deg_b=2*math.pi*m/60
distance=a**2+b**2-2*a*b*math.cos(deg_a-deg_b)
print(math.sqrt(distance))
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))

Y = sorted(X)

med = N // 2
for i in range(N):
    if X[i] < Y[med]:
        print(Y[med])
    else:
        print(Y[med - 1])
# Judge status: Accepted
N,X= map(int,input().split())
A = [int(a) for a in input().split()]
A.sort()

tmp = 0
ans = 0

for a in A:
    tmp+=a
    if tmp<=X:
        ans+=1
if ans==N and tmp<X:
    ans-=1
print(ans)
# Judge status: Wrong Answer
n = int(input())
dp = [0] * (n + 1)
index = 0
a = list(map(int, input().split()))
dp[1] = max(a)
index = a.index(dp[1])
for i in range(2, n + 1):
    a = list(map(int, input().split())) + [0]
    a[index] = -1
    dp[i] = max(a) + dp[i - 1]
    if a.count(max(a)) != 1:
        index = 3
    else:
        index = a.index(max(a))
print(dp[n])
# Judge status: Wrong Answer
#AtCorder Common Raccoon vs Monster

def main():
	H,N=map(int, input().split())
	A = [int(_) for _ in input().split()]
	if sum(A)>=H:
		print('YES')
	else:
		print('NO')
main()
# Judge status: Accepted
import sys

n, m = map(int, sys.stdin.readline().split())
s = sys.stdin.readline().rstrip()
lr = zip(*[map(int, sys.stdin.read().split())] * 2)

def main():
    cnt = [0] * n
    for i in range(n - 1):
        cnt[i+1] = s[i:i+2] == 'AC'
    for i in range(n - 1): cnt[i+1] += cnt[i]
    for l, r in lr:
        print(cnt[r-1] - cnt[l-1])

if __name__ ==  '__main__':
    main()
# Judge status: Accepted
# -*- coding: utf-8 -*-

n, d = map(int, input().split())

print((n-1)//(2*d+1) + 1)
# Judge status: Accepted
n=str(input())
sum=0
for i in range(len(n)):
    sum+=int(n[i]); 
if(sum%9==0):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a11,a12,a13,a21,a22,a23,a31,a32,a33,n,*b=map(int, open(0).read().split())
b=set(b)
if {a11,a12,a13}<=b or {a21,a22,a23}<=b or {a31,a32,a33}<=b or {a11,a21,a31}<=b or {a12,a22,a32}<=b or {a13,a23,a33}<=b or {a11,a22,a33}<=b or{a13,a22,a31}<=b:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N = int(input())
eat_list = list(map(int, input().split()))
manzok_list = list(map(int, input().split()))
add_manzok_list = list(map(int, input().split()))

manzok = 0

for i in range(N):
 manzok += manzok_list[eat_list[i]-1]
if(i > 0 and (eat_list[i] - eat_list[i-1]) == 1):
  manzok += add_manzok_list[eat_list[i-1]-1]

print(manzok)
# Judge status: Accepted
x,y = map(int,input().split())
ans = 1
while 1:
  x*=2
  if x <= y:
    ans += 1
  else:
    break
print(ans)
# Judge status: Accepted
# Problem C - To Infinity

# input
S = list(input())
s_len = len(S)
K = int(input())

# initialization
pos = 0
while K>0:
    K -= 1
    if int(S[pos])==1:
        pos += 1
    else:
        K += 1
        break
    if pos==s_len:
        pos -= 1
        break

# output
if K==0:
    print(S[pos-1])
else:
    print(S[pos])
# Judge status: Accepted
from bisect import bisect_left, bisect_right
N = int(input())
A, B, C = [sorted(map(int, input().split())) for _ in range(3)]
print(sum(bisect_left(A,b)*(N-bisect_right(C,b)) for b in B))
# Judge status: Accepted
A,B =map(int, input().split())

print((A + B) % 24)
# Judge status: Accepted
def g(x):
  return x*(x+1)//2
n=int(input())
ans=0
for i in range(1,n+1):
  ans=ans+i*g(n//i)
print(ans)
# Judge status: Accepted
def main():
    MOD = 10 ** 9 + 7

    N, M = map(int, input().split())
    if abs(N - M) > 1:
        print(0)
        return

    ans = 1
    for i in range(1, N + 1):
        ans = (ans * i) % MOD

    for i in range(1, M + 1):
        ans = (ans * i) % MOD

    if N == M:
        ans = (ans * 2) % MOD

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
w,a,b=map(int,input().split())
print(max(0,abs(a-b)-w))
# Judge status: Wrong Answer
S = input()
K = int(input())
length = 0
t = 5 * 10 ** 15
for s in S:
    s = int(s)
    if s == 1: length += 1
    else:
        length += s * t
    if K <= length:
        print(s)
        exit()
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
x = A[0]
for a in A[1:]:
  x ^= a
  
ans = [0] * N
for i in range(N):
  ans[i] = x ^ A[i]
  
print(' '.join(list(map(str, ans))))
# Judge status: Wrong Answer
import math
X = int(input())

def Eratosthenes(n):
  list = [i + 1 for i in range(n)]
  num = 2
  for j in range(2,math.ceil(math.sqrt(n))):
    for k in range(len(list)):
      if list[k] % j == 0:
        list[k] = 0
      else:
        continue
  return list

L = Eratosthenes(2*X)
for l in range(X,2*X):
  if L[l] != 0:
    print(L[l])
    break
# Judge status: Wrong Answer
sl = list(input())

x, y = 0, 0

for s in sl:
    if s == 'N':
        y += 1
    elif s == 'S':
        y -= 1
    elif s == 'E':
        x += 1
    elif s == "W":
        x -= 1

if x == 0 and y == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

l=[0 for i in range(10**5+2)]

for i in range(n):
    l[a[i]-1]+=1
    l[a[i]]+=1
    l[a[i]+1]+=1
print(max(l))
# Judge status: Accepted
N=int(input())
a=N//15
print(800*N-200*a)
# Judge status: Wrong Answer
a,b = map(int,input().split())
s = a-b
m = int(s*(s+1)/2)
print(m-b)
# Judge status: Accepted
import math

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

Sum = 0
mod = (10 ** 9) + 7

for i in range(len(bin(max(A)))-2):
    Sum_1 = 0
    for j in range(N):
        #print(i, j)
        if ((A[j] >> i) & 1):
            Sum_1 += 1

    Sum_0 = N - Sum_1

    Sum = (Sum + ((Sum_0 * Sum_1) % mod * (2 ** i)) % mod) % mod
    # print(Sum_0,Sum_1)

print(Sum)
# Judge status: Accepted
N = int(input())
A = [int(input())-1 for _ in range(N)]

visited = {0}

G = 1
t = 0
for i in range(N):
    n = A[t]
    if n in visited:
        print(-1)
        break
    elif n == G:
        print(i+1)
        break
    else:
        visited.add(n)
        t = n
else:
    print(-1)
# Judge status: Accepted
s = input().split()
print(s[1]+s[0])
# Judge status: Accepted
N,Y = map(int,input().split())
for i in range(min(N+1,Y//10000 + 1)):
    for j in range(N+1-i):
        if 10000 * i + 5000 * j + 1000 * (N-i-j) == Y:
            print(i,j,N-i-j)
            exit(0)
print(-1,-1,-1)
# Judge status: Accepted
x,a,b=map(int,input().split())

print("A" if abs(x-a)<abs(x-b) else "B")
# Judge status: Wrong Answer
print("hanhanahanahnahanahananaaananan")
# Judge status: Wrong Answer
A,B = map(int,input().split())

counter = 0

for i in range(B-A+1):
    n = A + i
    s = list(str(n))
    st = ""
    for j in range(5):
        st += s[4-j]
    if A <= int(st) <= B:
        counter += 1
    else:
        continue

print(counter)
# Judge status: Accepted
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()

if u == s:
  a = a-1
else:
  b = b-1
print(a, b)
# Judge status: Accepted
N=int(input())
def dfs(S):
    if len(S)==N:
        print(S)
    else:
        for i in range(97,ord(max(S))+2):
            dfs(S+chr(i))
dfs("a")
# Judge status: Accepted
n = int(input())
ans = (n)*(n-1)//2
print(int(ans))
# Judge status: Accepted
#103_B
S=input()
T=input()
print('Yes' if S in T*2 else 'No')
# Judge status: Accepted
x,y = map(int,input().split())

if (y < 2*x) or (4*x < y) :
    print('No')
elif (y%2 == 0) :
    print('Yes')
else :
    print('No')
# Judge status: Accepted
N,A,B,C,D=map(int,input().split())
S=input()
if C<D:
    if "##" not in S[A-1:D]:
        print("Yes")
    else:
        print("No")
elif D<C:
    if "##" not in S[A-1:C] and "..." in S[B-2:D+1]:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
n = int(input())

a = []
for x in input().split():
    a.append(int(x))
    
is_approved = True

for i in a:
    if i % 2 ==0:
        if (i % 3 !=0) and (i % 5 !=0):
            is_approved = False
            
if is_approved:
    print('APPROVED')
else:
    print('DENIED')
# Judge status: Accepted
a = list(input())
b = list(input())

if a[0] == b[2] and b[0] == a[2] and a[1]==b[1]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
N = int(input())
a = [2 if int(x) % 4 == 0 else 1 if int(x) % 2 == 0 else 0 for x in input().split()]
if N % 2 == 0:
    if sum(a) >= N:
        print('Yes')
    else:
        print('No')
else:
    if sum(a) >= N-1:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
import math

a, b, t = [int(x) for x in input().split()]
print(math.ceil((t + 0.5) // a) * b)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

B = [0] * (n + 1)
for a in A:
    B[a] += 1

for b in B[1:]:
    print(b)
# Judge status: Wrong Answer
a = input()

print('A' if a == 'A' else 'a')
# Judge status: Wrong Answer
s = open(0).read()

if len(s)%2:
    s = s[:-1]
else:
    s = s[:-2]

while s[:len(s)//2] != s[len(s)//2:]:
    s = s[:-2]

print(len(s))
# Judge status: Accepted
a, b, k = map(int, input().split())

x = b - a
if x < 2 * k:
    for i in range(a, b + 1):
        print(i)
else:
    for i in range(a, a + k):
        print(i)

    for i in range(b - k + 1, b + 1):
        print(i)
# Judge status: Wrong Answer

n=int(input())
ans=1
for i in range(1,n+1):
  ans*=i
print(ans%(10**9+7))
# Judge status: Accepted
h,w = map(int,input().split())

if h==1 or w==1:
    print(1);exit()
tmp = (h*w)//2+(h*w)%2
print(tmp)
# Judge status: Accepted
a=set(range(26))-set([ord(i)-97for i in input()])
print(chr(min(a)+97)if a else'None')
# Judge status: Accepted
n, h = map(int,input().split())
throw = []
attack = 0
for _ in range(n):
    a, b = map(int,input().split())
    throw.append(b)
    attack = max(attack, a)
throw.sort(reverse=True)

ans = 0
for t in throw:
    if t > attack:
        ans += 1
        h -= t
        if h <= 0:
            break
    else:
        break
if h > 0:
    ans += -(-h//attack)

print(ans)
# Judge status: Wrong Answer
N, K = map(int,input().split())

ans = 0

if N >= K:
    ans += (N - K + 1) / N
    L = K-1
else:
    L = N



for i in range(1,L+1,1):
    ans_i = 0
    score = i
    c = 0
    
    while score <= K:
        score = score * 2
        c += 1
    rate = (1 / N)*(1/2)** c
    ans += rate
    #print(ans)

print(ans)
# Judge status: Accepted

import numpy as np

n, w = map(int, input().split())
dp = np.full(w + 1, 0, dtype=int)

# dp[w] : wまでitemを取捨選択した際の最大価値

for _ in range(n):
    wi, vi = map(int, input().split())
    dp[wi:] = np.maximum(dp[:-wi] + vi, dp[wi:])
print(dp[-1])
# Judge status: Accepted
n=input()
x=800*n
y=200*(n/15)
print x-y
# Judge status: Accepted
n=int(input())
a=sorted([int(input()) for _ in range(n)])

ptr=0
res=0
while ptr<n:
    cc=a[ptr]
    f=0
    while ptr<n and a[ptr]==cc: #出現回数をカウント
        f+=1
        ptr+=1
    res+=f%2 #奇数回の場合インクリメント
print(res)
# Judge status: Wrong Answer
a,b,c =input().split()
total = int(a) + int(b) + int(c)
if total >= 22:
    print('bust')
else:
    print('won')
# Judge status: Accepted
n=int(input())
num=[int(i) for i in input().split()]

ans=1
ch=num[0]
for i in range(1,n):
  if  num[i]<=ch:
    ans+=1
  ch=min(ch,num[i])
print(ans)
# Judge status: Wrong Answer
W,H,x,y=map(int,input().split())

a=min(x*H,(W-x)*H)
b=min(y*W,(H-y)*W)
ans=0

if a==b:
    ans=1
    print(a,ans)
elif a>b:
    print(a,ans)
else:
    print(b,ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
print(("NO", "YES")[b - a == c - b])
# Judge status: Wrong Answer
n = int(input())
l = []
for _ in range(n):
  A = list(map(int, input().split()))
  l.append(A)
  
l = sorted(l)

x0,l0 = l[0][0],l[0][1]
y = x0 + l0
count = 1
for i in range(n-1):
  x,d = l[i+1][0],l[i+1][1]
  z = x - d
  
  if z >= y:
    y = x + d
    count = count + 1
  else:
    continue
print(count)