Harryxun/stf_run huggingface dataset:
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

MOD = 10**9 + 7

def main(N, A, B, S):
    if A > B:
        A, B = B, A
    if np.max(S[2:] - S[:-2]) < A:
        return 0
    INF = 1 << 62
    S = np.append(S, INF)
    # A 未満でたどって、Xがどこまで置けるか
    X = np.zeros_like(S)
    for i in range(1, N + 1):
        if S[i] - S[i - 1] >= A:
            X[i] = X[i - 1]
        else:
            X[i] = i
    # 直前の Y としてありうる最も右
    Y = np.searchsorted(S, S - B, side='right') - 1
    dp = np.zeros_like(S)
    dp_cum = np.zeros_like(S)

    dp[0] = 1
    dp_cum[0] = 1
    for n in range(1, N + 1):
        if X[n - 1] == 0:
            # 初出の Y
            dp[n] = 1
        # 直前の Y の範囲
        l, r = max(0, X[n - 1] - 1), min(n - 1, Y[n])
        if l <= r:
            dp[n] += dp_cum[r] - dp_cum[l] + dp[l]
        dp[n] %= MOD
        dp_cum[n] = (dp_cum[n - 1] + dp[n]) % MOD
    return dp[-1]

signature = '(i8,i8,i8,i8[:],)'
if sys.argv[-1] == 'ONLINE_JUDGE':
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', signature)(main)
    cc.compile()

from my_module import main

N, A, B = map(int, readline().split())
S = np.array(read().split(), np.int64)

print(main(N, A, B, S))

### FIXED CODE ###

import sys
input = sys.stdin.readline

from bisect import bisect_left, bisect_right

INF = 10**18 + 100
N,A,B = map(int,input().split())
S = [-INF] + [int(x) for x in sys.stdin.read().split()]

MOD = 10**9 + 7

dpX = [0] * (N+1) # 最後にYを選んだとして、直前に選んだXがどこにあるか
dpY = [0] * (N+1) # 最後にXを選んだとして、直前に選んだYがどこにあるか
dpX[0] = 1
dpY[0] = 1
dpX_cum = [1] * (N+1) + [0] # -1
dpY_cum = [1] * (N+1) + [0] # -1
dpX_left = 0
dpY_left = 0
for n,x in enumerate(S[2:],2):
    iA = bisect_right(S,x-A)
    iB = bisect_right(S,x-B)
    # ....XY
    xy = dpY_cum[iB-1] - dpY_cum[dpY_left-1] if iB >= dpY_left else 0
    # ....YX
    yx = dpX_cum[iA-1] - dpX_cum[dpX_left-1] if iA >= dpX_left else 0
    # ....XX が不可能なら捨てる。明示的に捨てるのではなく、生きている番号だけ持つ
    if iA != n:
        dpY_left = n-1
    if iB != n:
        dpX_left = n-1
    dpX[n-1] = xy
    dpX_cum[n-1] = (dpX_cum[n-2] + xy) % MOD
    dpX_cum[n] = dpX_cum[n-1]
    dpY[n-1] = yx
    dpY_cum[n-1] = (dpY_cum[n-2] + yx) % MOD
    dpY_cum[n] = dpY_cum[n-1]

answer = dpX_cum[N-1] - dpX_cum[dpX_left-1]
answer += dpY_cum[N-1] - dpY_cum[dpY_left-1]
answer %= MOD
print(answer)
N, M, K= map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
t = 0
n = 0
a = 0
b = 0
 
while K > t :
    if a < N and b < M :
        if A[a] <= B[b] :
            t += A[a]
            n += 1
            a += 1
            if K < t :
                n -=1
                break
 
        else :
            t +=B[b]
            n += 1
            b += 1
            if K < t :
                n -=1
                break
    
    elif a == N :
        while b < M :
            t += B[b]
            n += 1
            b += 1
            if K < t :
                n -=1
                break
        
        else :
            break
 
    else :
        while a < N :
            t += A[a]
            n += 1
            a += 1
            if K < t :
                n -=1
                break
 
print(n)

### FIXED CODE ###

a = int(input())
 
print(a + a**2 + a**3)
a, b = int(input())
if a + b < 10:
  print(a + b)
else:
  print('error')

### FIXED CODE ###

a, b = map(int,input().split())
if a + b < 10:
  print(a + b)
else:
  print('error')
import math
prime = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]

M = N
fac_lst = []
for i in prime:
    count = 0
    M = N
    while M % i == 0:
        M = M // i
        count += 1
    fac_lst.append(count)
    
count0, count1, count2, count3, count4 = 0, 0, 0, 0,0
for i in fac_lst:
    if i >= 74:
        count0 += 1
        count1 += 1
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 24:
        count1 += 1
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 14:
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 4:
        count3 += 1
        count4 += 1
    elif i >= 2:
        count4 += 1
count_lst = [count0, count1, count2, count3, count4]

ans0 = count_lst[0]
ans1 = count_lst[1] * (count_lst[4] - 1)
ans2 = count_lst[2] * (count_lst[3] - 1)
ans3 = (count_lst[3]*(count_lst[3]-1) // 2) * (count_lst[4] - 2)
if ans1 < 0:
    ans1 = 0
if ans2 < 0:
    ans2 = 0
if ans3 < 0:
    ans3 = 0
print(ans0+ans1+ans2+ans3)

### FIXED CODE ###

import math
prime = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]

n = int(input())
N = math.factorial(n)

M = N
fac_lst = []
for i in prime:
    count = 0
    M = N
    while M % i == 0:
        M = M // i
        count += 1
    fac_lst.append(count)
    
count0, count1, count2, count3, count4 = 0, 0, 0, 0,0
for i in fac_lst:
    if i >= 74:
        count0 += 1
        count1 += 1
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 24:
        count1 += 1
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 14:
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 4:
        count3 += 1
        count4 += 1
    elif i >= 2:
        count4 += 1
count_lst = [count0, count1, count2, count3, count4]

ans0 = count_lst[0]
ans1 = count_lst[1] * (count_lst[4] - 1)
ans2 = count_lst[2] * (count_lst[3] - 1)
ans3 = (count_lst[3]*(count_lst[3]-1) // 2) * (count_lst[4] - 2)
if ans1 < 0:
    ans1 = 0
if ans2 < 0:
    ans2 = 0
if ans3 < 0:
    ans3 = 0
print(ans0+ans1+ans2+ans3)
n=int(input())
s=input()
ans=0
for i in range(n):
  x=s[:i]
  y=s[i:]
  X=set(x)
  Y=set(y)
  ans=max(ans,X&Y)
print(ans)

### FIXED CODE ###

n=int(input())
s=input()
ans=0
for i in range(n):
  x=s[:i]
  y=s[i:]
  X=set(list(x))
  Y=set(list(y))
  ans=max(ans,len(X&Y))
print(ans)
import functools
import math
N, X = map(int, input().split())
x = list(map(int, input().split()))
new_list = list(map(lambda l: abs(l - X), x))
new_list.sort()
gcd = functools.reduce(math.gcd, new_list)
print(gcd)

### FIXED CODE ###

from functools import reduce
from fractions import gcd
N, X = map(int, input().split())
x = list(map(int, input().split()))
new_list = list(map(lambda l: abs(l - X), x))
new_list.sort()
gcd = reduce(gcd, new_list)
print(gcd)
def main ():
	N = int(input())
	A = list(map(int,input().split()))
	if 0 in A:
		print (0)
      	return
	prod = 1 for a in A:
		prod *= a
		if prod > 1000000000000000000:
		print(-1)
        return
	print(prod)

main()


### FIXED CODE ###

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

res = 1
for a in A:
    res = min(res*a, 10**18 + 1)
if res == 10**18 + 1: print(-1)
else: print(res)
# -*- coding: utf-8 -*-


def judge_class(s):
    if s <= 48.00:
        return 'light fly'
    elif 48.00 < s <= 51.00:
        return 'fly'
    elif 51.00 < s <= 54.00:
        return 'bantam'
    elif 54.00 < s <= 57.00:
        return 'feather'
    elif 57.00 < s <= 60.00:
        return 'light'
    elif 60.00 < s <= 64.00:
        return 'light welter'
    elif 64.00 < s <= 69.00:
        return 'welter'
    elif 69.00 < s <= 75.00:
        return 'light middle'
    elif 75.00 < s <= 81.00:
        return 'middle'
    elif 81.00 < s <= 91.00:
        return 'light heavy'
    elif 91.00 <= s:
        return 'heavy'


if __name__ == '__main__':
    s = input()
    print(judge_class(s))

### FIXED CODE ###

# -*- coding: utf-8 -*-


def judge_class(s):
    if s <= 48.00:
        return 'light fly'
    elif 48.00 < s <= 51.00:
        return 'fly'
    elif 51.00 < s <= 54.00:
        return 'bantam'
    elif 54.00 < s <= 57.00:
        return 'feather'
    elif 57.00 < s <= 60.00:
        return 'light'
    elif 60.00 < s <= 64.00:
        return 'light welter'
    elif 64.00 < s <= 69.00:
        return 'welter'
    elif 69.00 < s <= 75.00:
        return 'light middle'
    elif 75.00 < s <= 81.00:
        return 'middle'
    elif 81.00 < s <= 91.00:
        return 'light heavy'
    elif 91.00 <= s:
        return 'heavy'


while True:
    try:
        weight = float(input())
        print(judge_class(weight))
    except:
        break
N = int(input())
A = list(map(int,input().split()))

A.sort()
check = []
while True:
    min_num = A[0]
    for i in A:
        # 余りのリスト
        if
        check.append(i%A[0])
    check[0] = min_num
    if A[1] - A[0]>0:
        A[1] = A[1] - A[0]
    else:
        break
    A = check
    A.sort()

print(A[0])

### FIXED CODE ###

from fractions import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

N = int(input())
A = list(map(int,input().split()))
answer = gcd_list(A)
print(answer)
S = input()
ans = 0
p = ''
i = 0

while i < N:
  ans+=1
  if p==S[i]:
    i+=2
    p=''
  else:
    i+=1
    p=S[i]
    
print(ans)

### FIXED CODE ###

S = input()
ans = 0
p = ''
i = 0

while i < len(S):
  ans+=1
  if p==S[i]:
    if i==len(S)-1:
      ans-=1
    i+=2
    p=''
  else:
    p=S[i]
    i+=1
print(ans)
x,y,z=map(int,input().split())
if x <= z and x+y => z :
  print("YES")
else:
  print("NO")

### FIXED CODE ###

x,y,z=map(int,input().split())
if x <= z <= x+y :
  print("YES")
else:
  print("NO")
a,b = [int(i) for i in input().split()]
     
    souwa = 0
    n = b - a
    for i in range(n):
        souwa += i
         
    x = souwa - b
         
    print(x)

### FIXED CODE ###

n = int(input())
if n<1000:
    print('ABC')
else:
    print('ABD')
n = int(input.strip())
print(n**3)

### FIXED CODE ###

n = int(input().strip())
print(n**3)
5
2 4 3 5 15
2 4 3 5 1

### FIXED CODE ###

n = int(input())
arr = list(map(int, input().split()))
sorted_arr = sorted(arr)

counter = 0
for i in range(n):
    if arr[i] != sorted_arr[i]:
        counter += 1
    if counter > 2:
        break

if counter == 2 or counter == 0:
    print("YES")
else:
    print("NO")
li = list(map(int,input().split()))
mtx = [[] for _ in range(li[0])]
li_sum = []

for i in range(li[0]):
    a = input()
    mtx[i] = list(map(int,a.split()))
    print(a,end='')
    print(' ' ,sum(mtx[i]),sep='')
    
    for j in range(li[j]):
        li_sum[j] += mtx[i][j]
    li_sum[j] += sum(mtx[i])

print(' '.join(map(str,li_sum)))


### FIXED CODE ###

l, c = map(int, input().split())
tbl = [[] for _ in range(l)]
li_sum = [0 for _ in range(c+1)]

for i in range(l):
  a = input()
  tbl[i] = list(map(int, a.split()))
  print(a, end='')
  print(' ', sum(tbl[i]), sep ='')

  for j in range(c):
    li_sum[j] += tbl[i][j]
  li_sum[c] += sum(tbl[i])

print(' '.join(map(str, li_sum)))
n = int(input())
ns= int(input.spit())
for i in range(n):
    ns[i]= int(ns[i])
asum = sum(ns)
amin = min(ns)
amax = max(ns)

print(amin, amax, asum)


### FIXED CODE ###

n=int(input())
ns=input().split()
for i in range(len(ns)):
    ns[i]=int(ns[i])
asum=sum(ns)
amin=min(ns)
amax=max(ns)
print(amin,amax,asum)
n = int(input())
count = 0
for j in range(n):
    x = int(input())
    if (x == 2):
        count += 1
    else if (x % 2 == 0):
        continue
    else:
        if (pow(2, x - 1, x) == 1):
            count += 1
print(count)
 

### FIXED CODE ###

n = int(input())
count = 0
for i in range(n):
    x = int(input())
    if (x == 2):
        count += 1
    elif (x % 2 == 0):
        continue
    else:
        if (pow(2, x - 1, x) == 1):
            count += 1
print(count)
hotel=int(input())
hotel2=int(input())
hotel3=int(input())
hotel4=int(input())

sum1=int(hotel)*int(hotel2)
sum2=int(hotel39*int(hotel4)
fee=int(sum1)+int(sum1)

print(str(fee))

### FIXED CODE ###

hotel=int(input())
hotel2=int(input())
hotel3=int(input())
hotel4=int(input())

if hotel > hotel2:
	sum1=int(hotel2)*int(hotel3)
	hotel5=int(hotel)-int(hotel2)
	sum2=int(hotel5)*int(hotel4)
	fee=int(sum1)+int(sum2)
else:
  fee=int(hotel)*int(hotel3)
 
print(str(fee))
import sys
import fractions

sys.setrecursionlimit(10**5+1)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def LIST(): return [int(x) for x in input().split()]
MOD = 10**9 + 7

N = INT()

A = LIST()

def gcd_all(n):
    if len(n) == 1:
        return n[0]

    tail = n.pop(-1)
    return fractions.gcd(tail, gcd_all(n))

print(gcd_all(A))


### FIXED CODE ###

import sys
import fractions

sys.setrecursionlimit(10**9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def LIST(): return [int(x) for x in input().split()]
MOD = 10**9 + 7

N = INT()

A = LIST()

def gcd_all(n):
    if len(n) == 1:
        return n[0]

    tail = n.pop(-1)
    return fractions.gcd(tail, gcd_all(n))

print(gcd_all(A))
import math
import os
import random
import re
import sys
def findpath(a):
  if len(a)==3:
    return min(abs(a[2]-a[1])+abs(a[1]-a[0]),abs(a[2]-a[0]))
  return min(abs(a[2]-a[0])+findpath(a[2::]),abs(a[1]-a[0])+findpath(a[1::]))
n=int(input())
a=[]
for i in range(n):
  a.append(int(input()))
print findpath(a)

### FIXED CODE ###

import math
import os
import random
import re
import sys
def dpfindpath(a):
	dpath=[int(0) for _ in range(len(a))]
	dpath[0]=0
	dpath[1]=abs(a[1]-a[0])
	for i in range(2,len(a)):
		dpath[i]=min(abs(a[i]-a[i-1])+dpath[i-1],abs(a[i]-a[i-2])+dpath[i-2])
	return dpath[len(a)-1]
n=int(input())
a=input().split()
for i in range(n):
  a[i]=int(a[i])
print (dpfindpath(a))
import math
while True:
    n = int(input())
    if n == 0:
        break
    s = [int(i) for i in input().split(" ")]
    m = sum(s) / n
    print("{:.8f}".format(math.sqrt(sum([(x-m) ** 2]) / n )

### FIXED CODE ###

import math
while True:
    n = int(input())
    if n == 0:
        break
    s = [int(i) for i in input().split(" ")]
    m = sum(s) / n
    print("{:.8f}".format(math.sqrt(sum([(x-m) ** 2 for x in s]) / n)))
import math
r = float(input())
pi=math.pi
s = ( r ** 2 ) * pi
l = 2 * r * pi
print s, l


### FIXED CODE ###

pi = 3.14159265359 
r = float(input()) 
area = r*r*pi 
length = 2*r*pi 

print('{:.6f}'.format(area),'{:.6f}'.format(length))
p,q,r = map(int(input().split()))
print(min(p+q,p+r,q+r))

### FIXED CODE ###

p,q,r = map(int,input().split())
print(min(p+q, q+r, r+p))
memo = [{} for _ in range(30)]
MOD = 10 ** 9 + 7

def combo(p,q):
    if p == 0:
        return 1
    elif q == 0 or q == p:
        return 1
    elif q in memo[p]:
        return memo[p][q]
    else:
        ret = (combo(p-1,q-1) + combo(p-1,q)) % MOD
        memo[p][q] = ret
        return ret

#print(combo(2,1))

n,m = map(int,input().split())
fac = [0] * (m+1)
mm = m
for i in range(2,m+1):
    while mm % i == 0:
        mm = mm // i
        fac[i] += 1
        #print(mm,fac)

count = 1

for i in range(2,m+1):
    if fac[i] >= 1:
        count = (count * combo(fac[i]+n-1,fac[i])) % MOD
    #print(count)
    
print(count)

### FIXED CODE ###

n,m = map(int,input().split())
mod = 10 ** 9 + 7

def combo(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    else:
        r = min(r, n-r)
        return g1[n] * g2[r] * g2[n-r] % mod



N = n + 100
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

#print(combo(2,1))

#print(m)
fac = {}
mm = m
#print(mm)
count = 0
while mm % 2 == 0:
    count += 1
    mm //= 2
if count > 0:
    fac[2] = count
f = 3
count = 0
while f ** 2 <= mm:
    while mm % f == 0:
        count += 1
        mm //= f
        #print(f,count)
    if count > 0:
        fac[f] = count
        count = 0
    f += 2
    #print(fac)
if mm != 1:
    if mm in fac:
        fac[mm] += 1
    else:
        fac[mm] = 1
#print(fac)

count = 1

for i in fac:
    if fac[i] >= 1:
        count = (count * combo(fac[i]+n-1,fac[i],mod)) % mod
    #print(count)
    
print(count)
a,b=map(int,[input() for i in range(2)])
if (a*b)%2==0:
    print("Even")
else:
    print("Odd")


### FIXED CODE ###

a,b=map(int,input().split())
if (a*b)%2==0:
    print("Even")
else:
    print("Odd")
n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-(i+1)>=2:
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
  else:
    pass
print(c)    


### FIXED CODE ###

n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-(i+1)>=2:
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
  else:
    pass
print(d)
a, b = int(input().split())
print((a+b)//2)

### FIXED CODE ###

a, b = map(int, input().split())
print(-(-(a+b)//2))
Wethers={"Sunny":0,"Cloudy":1,"Rainy":2}
Wether=["Sunny","Cloudy","Rainy"]
S=input()
S_id = Wethers[S]
print(Wether(S_id+1)%3)



### FIXED CODE ###

Wethers={"Sunny":0,"Cloudy":1,"Rainy":2}
Wether=["Sunny","Cloudy","Rainy"]
S=input()
S_id = Wethers[S]
print(Wether[(S_id+1)%3])
a=int(input())
b=int(input())

print(set(1,2,3)-set(a,b))

### FIXED CODE ###

u={1,2,3}
AB=[int(input()) for i in range(2)]
print(list(u-set(AB))[0])
n=int(input())
dat=list(map(int, input().split()))
      
re = 0
flag=True
while (flag==True):
       for e in dat:
            if e%2==1:
                flag=False
                break
            else:
                e = e/2
        re = re+1

print(re)

### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
x=input()
list=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]

for i in range(26):
  if list[i] = x:
    print(list[i+i])

### FIXED CODE ###

x = input()
list = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

for i in range(26):
    if list[i] == x:
        print(list[i + 1])
a,b=map(int,input())
print("Odd") if (a*b)%2==1 else print("Even")

### FIXED CODE ###

a,b=map(int,input().split())
print("Odd") if (a*b)%2==1 else print("Even")
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n**4
for i in a:
    ans[i]+=1
    ans[i+1]+=1
    ans[i+2]+=1
print(max(ans))

### FIXED CODE ###

import collections
n=int(input())
a=list(map(int,input().split()))

for i in range(n):
    a.append(a[i]+1)
    a.append(a[i]-1)
c=collections.Counter(a)
print(c.most_common()[0][1])
m = 1e8
NIL = -1

def h1(key):
    return key % m

def h2(key):
    return 1 + (key % (m - 1))

def h(key, i):
    return (h1(key) + i * h2(key)) % m

def insert(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == NIL:
            t[j] = key
            return j
        else:
            i += 1

def find(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == key:
            return j
        elif t[j] == NIL or i >= m:
            return NIL
        else:
            i += 1

def convert(word):
    result = ""
    for i in word:
        if i == "A":
            result += "1"
        elif i == "T":
            result += "2"
        elif i == "G":
            result += "3"
        else:
            result += "4"
    return int(result)


t = [NIL]*m
n = int(input())
for i in range(n):
    com = input().split()
    key = convert(com[1])
    if com[0] == "insert":
        insert(t, key)
    else:
        if find(t, key) != NIL:
            print("yes")
        else:
            print("no")



### FIXED CODE ###

n = int(input())
d = set()

for i in range(n):
    com = input().split()
    if com[0] == "insert":
        d.add(com[1])
    else:
        print("yes" if com[1] in d else "no")
x,y=map(int,input().split())
a=0
if x==y==1:a=40000
a+=10000*((4-x)+(4-y))x,y=map(int,input().split())
a=0
x=min(x,4)
y=min(y,4)
if x==y==1:a=400000
a+=100000*((4-x)+(4-y))
print(a)

### FIXED CODE ###

x,y=map(int,input().split())
a=0
x=min(x,4)
y=min(y,4)
if x==y==1:a=400000
a+=100000*((4-x)+(4-y))
print(a)
s=str(input())
s=list(s)
ans=[]
for i in range(0,len(s)):
  if s%2==0:
    ans.append(s[i])
print("".join(ans))

### FIXED CODE ###

s=str(input())
s=list(s)
ans=[]
for i in range(0,len(s)):
  if i%2==0:
    ans.append(s[i])
print("".join(ans))
a, b = map(input().slice())
if a <= 0 or a >= 10:
  return -1
if b <= 0 or b >= 10:
  return -1
return a*b

### FIXED CODE ###

a, b = map(int, input().split())
if 1 > a or a > 20:
    raise ValueError("invalid number")
    
if 1 > b or b > 20:
    raise ValueError("invalid number")

if a <= 0 or a >= 10:
    print("-1")
elif b <= 0 or b >= 10:
    print("-1")
else:
    print("{}".format(a*b))
a,b=int(input())
c=[0]+[list(map(int,input().split()))for i in range(n)]
def f(s,t):
    if t==0:
        return 10000007
    else:
        l=min(s//(i*100),c[i][0])
        k=100*i*l
        if n==c[i][0]:
            l+=s[i][1]
        if l<G:
            n+=f(s-l,i-1)
        return min(n,f(s,i-1))
print(f(b,a))

### FIXED CODE ###

a,b=map(int,input().split())
c=[0]+[list(map(int,input().split()))for i in range(a)]
def f(t,s):
    if t==0:
        return 10**9
    l=min(s//(t*100),c[t][0])
    k=100*t*l
    if l==c[t][0]:
        k+=c[t][1]
    if k<s:
        l+=f(t-1,s-k)
    return min(l,f(t-1,s))
print(f(a,b))
list1 = [int(i) for i in input().split()]
print("{0} {1}".format(list[0],list[1]))

### FIXED CODE ###

item = [int(i) for i in input().split()]
print(item[0]*item[1],2*(item[0]+item[1]))
a,b = int(input().split())
if "a" * b > "b" * a:
    print("b" * a)
else:
    print("a" * b)

### FIXED CODE ###

a,b = input().split()
if a * int(b) > b * int(a):
    print(b * int(a))
else:
    print(a * int(b))
n=int(input())
p=[int(i) for i in input().split()]
ans=0
for x in range(2,n):
    a=p[x-1]
    b=p[x]
    c=p[x+1]
    if a<b<c or c<b<a:
        ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
p=[int(i) for i in input().split()]
ans=0
for x in range(1,n-1):
    a=p[x-1]
    b=p[x]
    c=p[x+1]
    if a<b<c or c<b<a:
        ans+=1
print(ans)
N,K = map(int, input().split())

min = 10**18+1
flag = True

while flag==True:
  N = abs(N-K)
  if N < min: min = N
  else: flag = False
    
return min


### FIXED CODE ###

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

print(min(n%k, abs(n%k-k)))
a = list(map(int, input().split()))
a.sort()
if a[0] + a[1] == a[2]:
    print('YES')
else:
    pritn('NO')

### FIXED CODE ###

a = list(map(int, input().split()))
a.sort()
if a[0] + a[1] == a[2]:
    print('Yes')
else:
    print('No')
A,B = map(int, input().split())
 
if 1 >=A<=9 and 1>=B<=9:
    print(A*B)
elif:
    print(-1)

### FIXED CODE ###

A,B = map(int, input().split())
 
if A<=9 and B<=9:
    print(A*B)
else:
    print(-1)
N = int(input())
A - int(input())
print(N**2-A)

### FIXED CODE ###

N = int(input())
A = int(input())
print(N**2-A)
n , m , d = map(int,input().split())
cou = 0
if d == 0:
    cou += n
elif d+1 <= n-d:
    cou += 2*n-2*d-2
else:
    cou += n
print(pow(cou,m-1)*(m-1)/pow(n,m))
    

### FIXED CODE ###

n , m , d = map(int,input().split())
cou = 0
if d == 0:
    cou += n
else:
    cou += 2*(n-d)
print(cou*(m-1)/pow(n,2))
N=int(input())
d = list(map(int, input().split()))
total=0
for n in range(N):
    for j in range(n+1,N):
        total+=d[n]*d[j]
total

### FIXED CODE ###

A, B = map(int,input().split())
if A>2*B:
    print(A-2*B)
else:
    print(0)
def dfs(f, stack, cnt):
    while stack:
        y, x = stack.pop()
        f[y][x] = '.'
        cnt += 1

        dxy = [(0,1), (0,-1), (1,0), (-1,0)]
        for dx, dy in dxy:
            nx, ny = x + dx, y + dy
            if 0 <= nx < w and 0 <= ny < h and f[ny][nx] == '#':
                stack.append([ny, nx])
                cnt, f = dfs(f, stack, cnt)
    return cnt, f

h, w = map(int, input().split())
f = [list(input()) for i in range(h)]

flg = False
dxy = [(0,1), (0,-1), (1,0), (-1,0)]
stack = []
for y in range(h):
    for x in range(w):
        if f[y][x] == '#':
            stack.append([y, x])
            cnt = 0
            cnt, f = dfs(f, stack, cnt)
            if cnt < 2:
                flg = True

print('No') if flg else print('Yes')

### FIXED CODE ###

h, w = map(int, input().split())
f = [["."] * (w + 2)] + \
    [list("." + input() + ".") for i in range(h)] + \
    [["."] * (w + 2)]

flg = False
for y in range(h):
    for x in range(w):
        if f[y][x] == '#':
            cnt = 0
            if f[y+1][x] == f[y-1][x] == f[y][x+1] == f[y][x-1] == '.':
                flg = True

print('No') if flg else print('Yes')