Harryxun/stf_run huggingface dataset:
import numpy as np

num_i, num_j = input().split(" ")
num_i = int(num_i)
num_j = int(num_j)
inputs = [input() for i in range(num_i)]


x = []
for _ in inputs:
    for value in _:
        x.append(value)
x = np.array(x)
x = x.reshape(num_i, num_j)

count = 0
boolean = True
while (boolean):
    count += 1
    i_arr = []
    j_arr = []
    for i in range(num_i):
        for j in range(num_j):
            if (x[i][j] == "#"):
                i_arr.append(i)
                j_arr.append(j)
    for i, j in zip(i_arr, j_arr):
        if (i == 0) & (j == 0):
            x[1][0] = "#"
            x[0][1] = "#"
        elif (i == num_i - 1) & (j == num_j - 1):
            x[i - 1][j] = "#"
            x[i][j - 1] = "#"
        elif (i == num_i - 1) & (j == 0):
            x[i - 1][0] = "#"
            x[i][1] = "#"
        elif (i == 0) & (j == num_j - 1):
            x[1][j] = "#"
            x[0][j - 1] = "#"
        elif (i == 0):
            x[1][j] = "#"
            x[0][j - 1] = "#"
            x[0][j + 1] = "#"
        elif (j == 0):
            x[i - 1][0] = "#"
            x[i + 1][0] = "#"
            x[i][1] = "#"
        elif (i == num_i - 1):
            x[i - 1][j] = "#"
            x[i][j + 1] = "#"
            x[i][j - 1] = "#"
        elif (j == num_j - 1):
            x[i - 1][j] = "#"
            x[i + 1][j] = "#"
            x[i][j - 1] = "#"
        else:
            x[i - 1][j] = "#"
            x[i + 1][j] = "#"
            x[i][j - 1] = "#"
            x[i][j + 1] = "#"
    if len(set(list(x.flatten()))) == 1:
        print(count)
        boolean = False
    else:
        boolean = True

### FIXED CODE ###

from collections import deque

H, W = map(int, input().split())

# input black cells
black_cells = []

for h in range(H):
    line = list(input())
    for w in range(W):
        if line[w] == "#":
            black_cells.append(h * W + w)


# Graph
def r(p):
    q_list = []
    h = p // W
    w = p % W
    if h != 0:
        q_list.append(p - W)
    if h != H-1:
        q_list.append(p + W)
    if w != 0:
        q_list.append(p - 1)
    if w != W-1:
        q_list.append(p + 1)
    return q_list


queue = deque(black_cells)
d = [10000] * (H * W)
for i in black_cells:
    d[i] = 0

# dijkstra
while len(queue) > 0:
    p = queue.popleft()
    for q in r(p):
        if d[q] > d[p] + 1:
            d[q] = d[p] + 1
            queue.append(q)

print(max(d))
n,a=map(int,input().split())

l=[a+i-1 for i in range(1,n+1)]
b=min(abs(l))

if b==0:
  l.remove(0)
else:
  l.remove([b,-b])
  
print(sum(l))

### FIXED CODE ###

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

l=[a+i-1 for i in range(1,n+1)]

import numpy as np
b=min(np.abs(l))

if b==0:
  l.remove(0)
elif b in l:
  l.remove(b)
elif -b in l:
  l.remove(-b)
  
print(sum(l))
# coding: utf-8
"""Snuke's Coloring 2 (ABC Edit)

@author: hijiri.n
@modified: 11-19-2016

"""

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


def solve(init, point):
    w, h, N = init
    rect = [0, w, 0, h]

    for p in point:
        x, y, a = p

        if [1, -1][a % 2] * ([x, y][a > 2] - rect[a - 1]) < 0:
            rect[a - 1] = [x, y][a > 2]

        if rect[1] <= rect[0] or rect[3] <= rect[2]:
            return 0
        
    return (rect[1] - rect[0]) * (rect[3] - rect[2])

i_in = data()
p_in = [data() for _ in i[-1]]
print(solve(i_in, p_in))

### FIXED CODE ###

# coding: utf-8

w, h, N = list(map(int, input().split()))

rect = [0, w, 0, h]
for i in range(N):
    x, y, a = list(map(int, input().split()))
    rect[a - 1] = (lambda c, r, p: [r, c][[c < r, c > r][p]])([x, y][a > 2], rect[a - 1], a % 2)

length = lambda x: [x, 0][x < 0]
print(length(rect[1] - rect[0]) * length(rect[3] - rect[2]))
# https://atcoder.jp/contests/dp/tasks/dp_b

N,K = map(int,input().split())
h = [int(x) for x in input().split()]

dp = [0] * (N)
dp[0] = 0

# 参考：https://atcoder.jp/contests/dp/submissions/10181844
for i in range(1, N):
    tmp = [dp[k] + abs(h[i] - h[k]) for k in range(max(0, i - K), i)]
    dp[i] = min(tmp)
print(dp[-1])


### FIXED CODE ###

N=int(input())
h=[int(i) for i in input().split()]

#DPテーブル＆最小化問題なのでINFに初期化
dp = [float("inf")]*N
#初期条件
dp[0] = 0
#ループ
for i in range(N):
    dp[i] = min(dp[i],dp[i-1]+abs(h[i]-h[i-1]))
    if i>1:
        dp[i] = min(dp[i],dp[i-2]+abs(h[i]-h[i-2]))

print(dp[-1])
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N,M = map(int,input().split())
S = str(input())
T = str(input())

L = lcm(N,M)
if L == max(N,M):
  L *= 2
X = [""]*L
if S[0] != T[0]:
  print(-1)
  exit()
else:
  X[0] = S[0]

for i in range(1,N):
  X[i*L//N] = S[i]
for j in range(1,M):
  if X[j*L//M] == "":
    X[j*L//M] = T[j]
  elif X[j*L//M] == T[j]:
    pass
  else:
    print(-1)
    exit()

print(L)

### FIXED CODE ###

import math
 
N,M = map(int,input().split())
S = list(str(input()))
T = list(str(input()))
g = math.gcd(N,M)
gn,gm = N//g,M//g
for i in range(g):
  if S[i*gn] != T[i*gm]:
    print(-1)
    exit()

print(gn*gm*g)
s, t = input().split()
a, b = map(int, input().split())
u =input()

if s == u:
  print(a-1, b)
else:
  prtin(a, b-1)

### FIXED CODE ###

s, t = input().split()
a, b = map(int, input().split())
u =input()
 
if s == u:
  print(a-1, b)
else:
  print(a, b-1)
n = int(input())

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

ans = 0
li = [0]*(n+1)

for i,a in enumerate(a_li):
  ans += (i+1)*a

for i,a in enumerate(a_li[::-1]):
  if i >= 1:
    li[i] = li[i-1]+a
  else:
    li[i] = a

li = li[::-1]

flag = True
ne = 0.5
for i in range(n+1):
  if li[i]  > 2*ne:
    ans -= li[i] -2*ne

  ne = 2*ne - a_li[i]
  if i == n+1 and ne <= 0:
    flag = False

  
if flag:
  print(int(ans))
else:
  print(-1)

### FIXED CODE ###

n = int(input())

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

ans = 0
li = [0]*(n+1)

for i,a in enumerate(a_li):
  ans += (i+1)*a

for i,a in enumerate(a_li[::-1]):
  if i >= 1:
    li[i] = li[i-1]+a
  else:
    li[i] = a

li = li[::-1]

flag = True
ne = 0.5
for i in range(n+1):
  if li[i]  > 2*ne:
    ans -= li[i] -int(2*ne)

  
  ne = min(li[i] - a_li[i],int(2*ne)-a_li[i])

  if (i == n and ne != 0) or (i != n and ne <= 0):
    flag = False

  
if flag:
  print(ans)
else:
  print(-1)
S, T = [input() for _ in range(2)]
answer = 1001

for i in range(len(S) - len(T) + 1):
	k = 0
	U = S[i:i + len(T)]
	for j in range(len(T)):
		if T(j) != U(j):
			k += 1
	answer = min(answer, k)
print(answer)

### FIXED CODE ###

S, T = [input() for _ in range(2)]
answer = 1001

for i in range(len(S) - len(T) + 1):
	k = 0
	U = S[i:i + len(T)]
	for j in range(len(T)):
		if T[j] != U[j]:
			k += 1
	answer = min(answer, k)
print(answer)
a = int(input())
b = int(input())
c = int(input())
if a == b == c:
 print("1")
elif a == b or b ==c or a ==c:
 print("2")
else:
 print("3")

### FIXED CODE ###

j = input().split()
a = int(j[2])
b = int(j[1])
c = int(j[0])
if a == b and b== c:
 print("1")
elif a == b:
 print("2")
elif b == c:
 print("2")
elif a==c:
 print("2")
else:
 print("3")
import sys
input = sys.stdin.readline
N = int(input())
s = []
for _ in range(N):
    s.append(input().rstrip())
M = int(input())
t = []
for _ in range(M):
    t.append(input().rstrip())
from collections import Counter
cs = Counter(s)
ct = Counter(t)
ans = {}
for i in cs.keys():
    ans[i] = cs[i] - ct[i]
print(max(ans.values(), 0))

### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
s = []
for _ in range(N):
    s.append(input().rstrip())
M = int(input())
t = []
for _ in range(M):
    t.append(input().rstrip())
from collections import Counter
cs = Counter(s)
ct = Counter(t)
ans = {}
for i in cs.keys():
    ans[i] = cs[i] - ct[i]
ans_max = max(ans.values())
print(max(0, ans_max))
import math
N = int(input())

sum = list(range(2,N))

print(sum)

### FIXED CODE ###


import math
N = int(input())
print(int(N * (N - 1) // 2))
#n=int(input())
h,w=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
v1=h//2
v2=w//2
if h==1 or w==1:
    print(0)
elif h%2==0:
    
    ans=v1*w
else:
    if w%2==0:
        ans=v1*v2+(v1-1)*v2
    else:
        t=v1+1
        ans=v2*(t-1)+(v2+1)*t
print(ans)


### FIXED CODE ###

#n=int(input())
h,w=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
v1=h//2
v2=w//2
if h==1 or w==1:
    ans=1
elif h%2==0:
    ans=v1*w
else:
    if w%2==0:
        ans=(v1+1)*v2+(v1)*v2
    else:
        t=v1+1
        ans=v2*(v1)+(v2+1)*(v1+1)
print(ans)
#!/usr/bin/env python3

def main():
    n, k, c = map(int, input().split())
    s = input()

    left = getleft(s, n, c)
    right = list(reversed(getleft(s[::-1], n, c)))

    for i in range(n):
        if i == 0:
            canrest = (right[i + 1][0] >= k)
        elif i == n - 1:
            canrest = (left[i - 1][0] >= k)
        else:
            if left[i - 1][0] + right[i + 1][0] >= k + 1:
                canrest = True
            elif (left[i - 1][0] + right[i + 1][0] >= k) and (left[i - 1][1] + right[i + 1][1] >= c - 1):
                canrest = True
            else:
                canrest = False
        if not canrest:
            print(i + 1)

def getleft(s, n, c):
    left = [None] * n  # x, d
    x = 0
    d = 10 ** 9
    for i in range(n):
        if s[i] == "o":
            if d >= c:
                x += 1
                d = 0
            else:
                d += 1
        else:
            d += 1
        left[i] = (x, d)
    return left

if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3

def main():
    n, k, c = map(int, input().split())
    s = input()

    left = getleft(s, n, c)
    right = list(reversed(getleft(s[::-1], n, c)))

    if n == 1:
        print(1)
        return

    for i in range(n):
        if i == 0:
            canrest = (right[i + 1][0] >= k)
        elif i == n - 1:
            canrest = (left[i - 1][0] >= k)
        else:
            if left[i - 1][0] + right[i + 1][0] >= k + 1:
                canrest = True
            elif (left[i - 1][0] + right[i + 1][0] >= k) and (left[i - 1][1] + right[i + 1][1] >= c - 1):
                canrest = True
            else:
                canrest = False
        if not canrest:
            print(i + 1)

def getleft(s, n, c):
    left = [None for i in range(n)]
    x = 0
    d = 10 ** 9
    for i in range(n):
        if s[i] == "o":
            if d >= c:
                x += 1
                d = 0
            else:
                d += 1
        else:
            d += 1
        left[i] = (x, d)
    return left

if __name__ == "__main__":
    main()
import sys
from heapq import *
sys.setrecursionlimit(10**8)

input = sys.stdin.readline

tree = [[] for _ in range(200001)]
res = [0]*200001

def dfs(p, pre):
    for child in tree[p]:
        if child == pre: continue
        res[child] += res[p]
        dfs(child, p)

def main():
    """ main """
    N, Q = map(int, input().split())
    for _ in range(N-1):
        a,b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    for _ in range(Q):
        p,x = map(int, input().split())
        res[p] += x
    dfs(1, 0)

    print(*res[1:N+1])

if __name__ == '__main__':
    main()


### FIXED CODE ###

a = int(input())
s = str(input())

if a >= 3200:
    print(s)
else:
    print('red')
# B - Two Anagrams
# coding: utf-8

A = list(raw_input())
B = list(raw_input())
A.sort()
B.sort(), B.reverse()

print "Yes" if A < B else "No"

### FIXED CODE ###

A, B = map(int, raw_input().split())
print (A+B+1)/2
a=int(input())
s=input
if a => 3200:
    print(s)
else:
    print("red")

### FIXED CODE ###

a = int(input())
s=  input()

if a >= 3200:
    print(s)
else:
    print("red")
import sympy
import math

n=int(raw_input())
m=sympy.factorint(math.factorial(n))
res=1
v=m.values()
for i in xrange(len(v)):
 res*=v[i]+1
print res%(10**9+7)


### FIXED CODE ###

#ARC052C

n=int(raw_input())
s=[1 for i in range(n+1)]
res=1
for i in range(2,n+1):
 if s[i]:
  for j in range(i*2,n+1,i):
   s[j]=0
  cnt=0
  temp=n
  while temp:
   cnt+=temp/i
   temp/=i
  res=res*(cnt+1)%(10**9+7)
print res
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append([a-1,b-1])
if n==2:
    print(0)
    exit()


def f(x,y,c):
    c += 1
    if len(edge)-1 >=x and x >= 0:
        for e in edge[x]:
            if e != y:
                if c > d:
                    used[e] = 1
                f(e,x,c)


if k % 2 == 0:
    d = k//2
    res = []
    for i in range(n):
        used = [0]*n
        f(i,-1,0)
        res.append(sum(used))
    print(min(res))
else:
    d = (k-1)//2
    res = []
    for e1 in alledge:
        nag = [0]*n
        used = [0]*n
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        res.append(sum(used))
    print(min(res))


### FIXED CODE ###

import sys
#input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append((a-1,b-1))

def f(x,y,c):
    global tmp
    c += 1
    for e in edge[x]:
        if e == y:
            continue
        if c > d:
            tmp +=1
        f(e,x,c)

sys.setrecursionlimit(4100000)

if k % 2 == 0:
    d = k//2
    ass = 2001
    for i in range(n):
        tmp = 0
        f(i,-1,0)
        ass = min(ass,tmp)
    print(ass)
else:
    d = (k-1)//2
    ass = 2001
    for e1 in alledge:
        tmp = 0
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        ass = min(ass,tmp)
    print(ass)
from math import gcd
a,b=map(int,input().split())
print(a*b//gcd(a,b))

### FIXED CODE ###

from fractions import gcd
a,b=map(int,input().split())
print(int((a*b) // gcd(a,b)))
import numpy as np

n, p = map(int, input().split())
s = np.array([int(i) % p for i in input()])
mod = np.zeros((n, p), dtype=np.int)
for i in range(n):
  mod[i, s[i]] = 1
count = mod[0, 0]
for i in range(1, n):
  idx = s[i]
  for j in range(p):
    mod[i, idx] += mod[i-1, j]
    idx = (idx + 10) % mod
print(mod[:, 0].sum())

### FIXED CODE ###

n, p = map(int, input().split())
s = input()
count = 0
if p == 2 or p == 5:
  for i in range(n):
    if int(s[i]) % p == 0:
      count += i + 1
  print(count)
else:
  mod = [0] * p
  mod[0] = 1
  tmp = 0
  ten = 1
  for i in s[::-1]:
    ten = ten * 10 % p
    tmp = (tmp + int(i) * ten) % p
    mod[tmp] += 1
  for m in mod:
    count += m * (m - 1) // 2
  print(count)
a,b=map(int,input().split())
n=list(map(int,input().split()))
n.sort(reverse=True)
for i in range(b):
  n.remove(n[i])
print(sum(n))  


### FIXED CODE ###

a,b=map(int,input().split())
n=list(map(int,input().split()))
n.sort(reverse=True)
n[0:b]=[]
print(sum(n))
a,b,c=map(int,input().split())
print('Yes':if a+b>=c,else:'No')

### FIXED CODE ###

a,b,c=map(int,input().split())
print('Yes' if a+b>=c else 'No')
n = (int)input()
i = 0
while n > i:
  a.append((int)input())
  i+=1
j = 1
i = 0
max = a[j]-a[i]
 while i < n:
    while  j < n:
       if max < a[j]-a[i]:
          max = a[j]-a[i]
        j+ = 1
     i+ = 1
  print  max

### FIXED CODE ###

N = int(raw_input())
min = int(raw_input())
max = int(raw_input())

ans = max - min
if max < min:
    min = max
 
for i in range(N - 2):
    R = int(raw_input())
    if R - min > ans:
        ans = R - min
    if R < min:
        min = R
 
print ans
import sys
input = sys.stdin.readline
def chmin(a, b):
    if a > b:
        return b
    else:
        return a
import numpy as np  
n,k = map(int,input().split())
h = np.array([int(i) for i in input().split()],dtype = np.int32)
# dpの最小値を変更する関数

# 無限大の値
f_inf = 10 ** 9 
# DP テーブルを初期化　(最小化問題なので INF に初期化)
dp = np.array([f_inf] * (10**5+10), dtype =np.int32)
# 初期条件
dp[0] = 0
# 足場 i-1 から足場 i へ移動する。コストは|h[i]−h[i-1]|
# 足場 i-2 から足場 i へと移動する コストは |h[i]−h[i-2]|
for i in range(1, n):
    for j in range(1,k+1):
        if i-j < 0 :
            continue
        else:
            dp[i] = chmin(dp[i], dp[i - j] + abs(h[i] - h[i-j]))
print(dp[n-1])


### FIXED CODE ###

import sys
input = sys.stdin.readline
def chmin(a, b):
    if a > b:
        return b
    else:
        return a
  
n,k = map(int,input().split())
h = [int(i) for i in input().split()]
# dpの最小値を変更する関数

# 無限大の値
f_inf = 10 ** 9 
# DP テーブルを初期化　(最小化問題なので INF に初期化)
dp = [f_inf] * (10**5+10)
# 初期条件
dp[0] = 0
# 足場 i-1 から足場 i へ移動する。コストは|h[i]−h[i-1]|
# 足場 i-2 から足場 i へと移動する コストは |h[i]−h[i-2]|
for i in range(1, n):
    for j in range(1,k+1):
        if i-j < 0 :
            continue
        else:
            dp[i] = chmin(dp[i], dp[i - j] + abs(h[i] - h[i-j]))
print(dp[n-1])
def main():
    a, b = map(int, input().split())
    if a >= 13:
        print(b)
    elif a >= 6:
        print(int(b/2))
    else:
        print(0)
if __name__ == '__main__':
    main(

### FIXED CODE ###

def main():
    a, b = map(int, input().split())
    if a >= 13:
        print(b)
    elif a >= 6:
        print(int(b/2))
    else:
        print(0)
if __name__ == '__main__':
    main()
n, m = map(int,input().split())
a = []
pam = -1

fibk={}
def fib(k):
    if k in fibk:
        return fibk[k]
    if k<0:
        return 0
    elif k==0 or k==1:
        return 1
    elif k-2 in fibk and not(k-1 in fibk):
        return fib(k-1)+fibk[k-2]
    elif k-2 in fibk and k-1 in fibk:
        return fibk[k-1]+fibk[k-2]
    else:
        return fib(k-1)+fib(k-2)


for i in range(0,m):
    am = int(input())
    a.append(am-pam)
    pam = am
a.append(n+1-pam)
count = 1
for aa in a:
    count = count * fib(aa-2)
print(count%(1000000007))

### FIXED CODE ###

n, m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))
dp = []
dp.append(1)
if m == 0:
    a.append(-1)
j = 0
k = len(a)-1
if 1 == a[j]:
    dp.append(0)
    j = min(k,j+1)
else:
    dp.append(1)

for i in range(2,n+1):
    if i == a[j]:
        dp.append(0)
        j = min(k,j+1)
    else:
        dp.append(dp[i-1] + dp[i-2])

print(dp[n]%(1000000007))
n,k = map(int,input().split())
list=[]
for i in range(k):
    d = int(input())
    sunuke = input().split()
    for j in range(d):
        if int(sunuke[j]) not in list:
            list.append(int(sunuke[j]))
print(str(n - len(list)))

### FIXED CODE ###

s = input()

if s == 'ABC':
    print('ARC')
if s == 'ARC':
    print('ABC')
def yesno(S)

if S=='AAA' or S=='BBB':
  return('No')
else:
  return('Yes')
S=input()
print(yesno(S))

### FIXED CODE ###

def yesno(S):
  if S=="AAA" or S=="BBB":
    return "No"
  else:
    return "Yes"
S=input()
print(yesno(S))
N, K = list(map(int,input().split()))
move_list = list(map(int,input().split()))
 
  
test = 1
find_f = {}
for i in range(N):
  find_f[i+1]=[]
 
find_f[1].append(0)
for i in range(K):
  test = move_list[test-1]
  find_f[test].append(i+1)
  if len(find_f[test]) == 2 and find_f[test][1]-find_f[test][0]<=100:
    state ,f = test, find_f[test]
    break
  
K = K-f[0]
f = f[1]-f[0]
remain = K%f
 
for i in range(remain):
  state = move_list[state-1]
  
print(state)
#state = 1

### FIXED CODE ###

N, K = list(map(int,input().split()))
move_list = list(map(int,input().split()))
 
  
test = 1
find_f = {}
for i in range(N):
  find_f[i+1]=[]
 
find_f[1].append(0)
for i in range(K):
  test = move_list[test-1]
  find_f[test].append(i+1)
  if len(find_f[test]) == 2 and find_f[test][1]-find_f[test][0]<=1000000:
    state ,f = test, find_f[test]
    break
try:
  K = K-f[0]
  f = f[1]-f[0]
  remain = K%f
  for i in range(remain):
    state = move_list[state-1]
 
  print(state)
except:
  print(test)
#state = 1
import sys
lines = sys.stdin.readlines()

S = str(lines[0])
X = []

for i in range(len(S)):
  a = int(S[i:])
  c = a-(a//2019)*2019
  X.append(c)
print(c)

### FIXED CODE ###

S = str(input())

#10**nのmod計算
A = []
p =1
for i in range(len(S)):
  A.append(p)
  p = p*10%2019

#左からi文字以降の数字列のmod計算
X = []
a = 0
for i in range(len(S)):
  a = (a + int(S[len(S)-i-1])*A[i]) %2019
  X.append(a)
X.sort()
flag =1
n = 0

#modが同じになる組み合わせ、またはもともとmodが0になる数字列の個数の総和計算
for i in range(len(X)-1):
  if X[i]==0:
    n +=1
  if X[i]==X[i+1]:
    flag += 1
  else:
    n += int(flag*(flag-1)/2)
    flag = 1
n += int(flag*(flag-1)/2)
if X[len(X)-1]==0:
  n +=1
print(n)
K=int(input())
A,B=map(int,input().split())
for i in range(A,B):
  if(i%K==0):
    print("ok")
    break
  if(i==B and i%K not ==0)
    print("NG")
  
 


### FIXED CODE ###

K = int(input())
A, B = map(int, input().split())
mul = 0
for i in range(A, B + 1):
    if i % K == 0:
        mul += 1
print("OK" if mul > 0 else "NG")
flag = 0

counter = Counter(w)

for word, cnt in counter.most_common():
    if cnt % 2 != 0:
        flag = 1
        print("NO")

if flag == 0:
    print("YES")

### FIXED CODE ###

from collections import Counter

w = input()
flag = 0

counter = Counter(w)

for word, cnt in counter.most_common():
    if cnt % 2 != 0:
        flag = 1

if flag == 0:
    print("Yes")
else:
    print("No")
N = int(input())
A = list(map(int,input().split()))
A_count = 0

#A内の奇数を0にする
for i in range(len(A)):
  if A[i]%2 != 0:
    A.pop(A[i]) 
#A内偶数をチェックする
for t in range(len(A)):
  if A[i]%3 == 0 or A[i]%5 == 0:
    A_count +=1
print("APPROVED" if A_count == len(A) else "DENIED")

    

### FIXED CODE ###

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

#A内の奇数を0にする
for i in range(len(A)):
	if A[i]%2 != 0:
		A[i] = 0
#A内偶数をチェックする
for t in range(len(A)):
	if A[t] > 0:
		if A[t]%3 == 0 or A[t]%5 == 0:
			A[t] = 0
print("APPROVED" if sum(A) == 0  else "DENIED")
N=int(input())
L=list(map(int,input().split()))

def aaa(l):
    x=0
    a=l[0]
    b=l[1]
    c=l[2]
    if a+b>c:
        if b+c>a:
            if c+a>b:
                x=1
    return x
ans=0
for l in list(itertools.combinations(L, 3)):
    ans+=aaa(list(l))
print(ans)

### FIXED CODE ###

import bisect
N=int(input())
L=sorted(list(map(int,input().split())))
ans=0
for i in range(N-2):
    for j in range(i+1,N-1):
        ab=L[i]+L[j]
        r=bisect.bisect_left(L,ab)
        l=j+1
        ans+=r-l
print(ans)
X,Y = map(int, input(),split())
XY = int(X + Y / 2)
print(XY)

### FIXED CODE ###

X,Y = map(int, input().split())
XY = int(X + Y / 2)
print(XY)
import sys
sys.setrecursionlimit(10**6)
t=input()
tl=list(t)
tln=len(t)
x=t.find("?")
if x == 0:
    tl[x]="P"
    t="".join(tl)
while x != -1:
    x=t.find("?")
    if x == tln-1:
        tl[x]="D"
        t="".join(tl)
        break
    if tl[x-1]=="P":
        tl[x]="D"
    elif tl[x+1]=="?":
        tl[x]="P"
    elif tl[x+1]=="D":
        tl[x]="P"
    else:
        tl[x]="D"
    t="".join(tl)
print(t)
    

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
t=input()
tl=list(t)
tln=len(t)
x=0
for x in range(tln):
    if tl[x] == "?":
        if x == tln-1:
            tl[x]="D"
            break
        elif x==0:
            if tl[x+1]=="?":
                tl[x]="P"
                tl[x+1]="D"
            else:
                tl[x]="D"
        elif tl[x-1]=="P":
            tl[x]="D"
        elif tl[x+1]=="?":
            tl[x]="P"
            tl[x+1]="D"
        elif tl[x+1]=="D":
            tl[x]="P"
        else:
            tl[x]="D"
t="".join(tl)
print(t)