Harryxun/stf_run huggingface dataset:
N = int(input())
A = list(map(int, input().split()))
if N > 1:
    A[i] -= 1
    for i in range(1,N-1):
        if A[i]<A[i+1]:
            A[i+1] -= 1
    for i in range(N-1):
        if A[i] > A[i+1]:
            print("No")
            break
    else:
        print("Yes")
elif N == 1:
    print("Yes")

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
if N > 1:
    A[0] -= 1
    for i in range(N-1):
        if A[i]<A[i+1]:
            A[i+1] -= 1
    for i in range(N-1):
        if A[i] > A[i+1]:
            print("No")
            break
    else:
        print("Yes")
elif N == 1:
    print("Yes")
import heapq

n,m=map(int,input().split())
l=[[int(_) for _ in input().split()] for __ in range(n)]

l=sorted(l, key=lambda x:x[1], reverse=True)

a=[]
day=0
ans=0
for j in range(1,m+1):
    while 1:
        if day>=n:
            break
        if l[day][0]<=j:
            heapq.heappush(a,-l[day][1])
            day+=1
        else:
            break
    if a:
        ans-=heapq.heappop(a)
print(ans)

### FIXED CODE ###

import sys

n=int(input())
l=["".join(sorted(sys.stdin.readline().strip())) for i in range(n)]


res={}
ans=0
 
for j in range(n):
    ll=list(l[j])
    ll.sort()
    aa="".join(ll)
    if aa in res:
        ans+=res[aa]
        res[aa]+=1
    else:
        res[aa]=1

print(int(ans))
import numpy as np

N = int(input())
A = np.array([int(i) for i in input().split()])
sum = 0

#累積和、二乗和の両方で1項ずつ求めてmodをとる
for x in A:
  sum += x
  sum %= (10**9+7)
#sum = A.sum() % (10**9+7)

sum2 = 0
for x in A:
  sum2 += x*x
  sum2 %= (10**9+7)
#sum2 = (A**2).sum() % (10**9+7)

ans = (sum**2 - sum2) % (10**9+7)
if ans < 0:
  ans += (10**9+7)
ans *= int((10**9+7+1)/2) 
ans %= (10**9+7)
print(int(ans))


### FIXED CODE ###

D, T, S = [int(i) for i in input().split()]

if(D/S <= T):
  print("Yes")
else:
  print("No")
import itertools
import math
from functools import reduce

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

n = int(input())
ls = list(map(int, input().split()))
ls_com = itertools.combinations(ls, n-1)
ans = 0

for i in ls_com:
    ans = max(gcd_list(i),ans)
print(ans)

### FIXED CODE ###

import fractions

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

l = [0]
r = [0]
for i in range(n):
    l.append(fractions.gcd(l[i], a[i]))
    r.append(fractions.gcd(r[i], a[-(i+1)]))
    
m = [fractions.gcd(l[i], r[-(i+2)]) for i in range(n)]
print(max(m))
from collections import defaultdict

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

if n % 3 == 0 and len(set(a)) == 3:
    x = list(set(a))
    a = x[0]
    b = x[1]
    c = x[2]
    if a ^ b != c:
        print('No')
        exit()
    if b ^ c != a:
        print('No')
        exit()
    if c ^ a != b:
        print('No')
        exit()
    d = defaultdict(int)
    for i in a:
        d[i] += 1
    if d[a] != d[b] or d[b] != d[c] or d[c] != d[a]:
        print('No')
        exit()
    print('Yes')
elif n % 2 == 0 and len(set(a)) == 2:
    x = list(set(a))
    x.sort()
    if x[0] == 0:
        t = 1
    else:
        print('No')
        exit()
    d = defaultdict(int)
    for i in a:
        d[i] += 1
    if d[x[0]] != d[x[1]]:
        print('No')
        exit()
    print('Yes')
else:
    print('No')

### FIXED CODE ###

from collections import defaultdict

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

if len(set(a)) == 1 and list(set(a))[0] == 0:
    print('Yes')
    exit()

if n % 3 == 0 and len(set(a)) == 3:
    x = list(set(a))
    e = x[0]
    b = x[1]
    c = x[2]
    if e ^ b != c:
        print('No')
        exit()
    if b ^ c != e:
        print('No')
        exit()
    if c ^ e != b:
        print('No')
        exit()
    d = defaultdict(int)
    for i in a:
        d[i] += 1
    if d[e] != d[b] or d[b] != d[c] or d[c] != d[e]:
        print('No')
        exit()
    print('Yes')
elif n % 3 == 0 and len(set(a)) == 2:
    x = list(set(a))
    x.sort()
    if x[0] == 0:
        t = 1
    else:
        print('No')
        exit()
    d = defaultdict(int)
    for i in a:
        d[i] += 1
    if d[x[0]]*2 == d[x[1]]:
        print('Yes')
        exit()
    print('No')
else:
    print('No')
a, b = map(int, input().split())

if a, b = map(int, input().split())

if a >= 13:
    print(b)
elif a >= 6:
    print(int(b/2))
else:
    print(0)


### FIXED CODE ###

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

if a >= 13:
    print(b)
elif a >= 6:
    print(int(b/2))
else:
    print(0)
n , k = imap ( int , input ().split())
ans = n - k + 1
print ( ans)

### FIXED CODE ###

n , k = map ( int , input ().split())
ans = n - k + 1
print ( ans)
a = int(input())
b = int(input())

x = a * b

if x % 2 == 0:
    answer = 'Even'
elif x % 2 == 1:
    answer = 'Odd'

print(answer)


### FIXED CODE ###

a, b = map(int, input().split())
x = a * b

if x % 2 == 0:
    answer = 'Even'
elif x % 2 == 1:
    answer = 'Odd'

print(answer)
s = input().split()

n = int(s[0])
blue = int(s[1])
red = int(s[2])
br = ["b"]*blue
rr = ["r"]*red
arr = []

f = int(n/(blue + red)) + 1

for i in range(0,f):
  arr.extend(br)
  arr.extend(rr)
  
c = arr[0:n]
print(c)
print(c.count('b'))

### FIXED CODE ###

n,a,b = map(int,input().split())
x = 0
y = 0
if(n%(a+b) == 0):
  x=int(n/(a+b))*a
else:
  y = n%(a+b)
  x = int(n/(a+b))*a + min(a,y)
print(x)
A, B, C, D = map(int, input().split())
print(min(A, B) + min(C, D))

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())
print(min(A, B) + min(C, D))
from collections import deque
while True:
    n = int(input())
    if n == 0:break
    a = [int(input()) for _ in range(n)]
    b = deque([0] * n)
    j = 0
    for i in range(n):
        if a[i] * b[j] >= 0:b[j] += a[i]
        else:j += 1;b[j] += a[i]
    if b[0] < 0:b.popleft()
    while b[-1] <= 0 and len(b) > 1:b.pop()
    m = len(b) // 2 + 1
    v = [[0] * m for _ in range(m)]
    v[0][0] = b[0]
    for i in range(1, m):
        v[0][i] = v[0][i - 1] + b[2 * i] + b[2 * i - 1]
    for i in range(1, m):
        for j in range(i, m):
            v[i][j] = v[i - 1][j] - b[2 * i - 2] - b[2 * i - 1]
    print(max([max(i) for i in v]))


### FIXED CODE ###

from collections import deque
while True:
    n = int(input())
    if n == 0:break
    a = [int(input()) for _ in range(n)]
    b = deque([0] * n)
    j = 0
    for i in range(n):
        if a[i] * b[j] >= 0:b[j] += a[i]
        else:j += 1;b[j] += a[i]
    if b[0] < 0 and len(b) > 1:b.popleft()
    while b[-1] <= 0 and len(b) > 1:b.pop()
    if len(b) == 1 and b[0] <= 0:print(max(a))
    else:
        m = len(b) // 2 + 1
        v = [[0] * m for _ in range(m)]
        v[0][0] = b[0]
        for i in range(1, m):
            v[0][i] = v[0][i - 1] + b[2 * i] + b[2 * i - 1]
        for i in range(1, m):
            for j in range(i, m):
                v[i][j] = v[i - 1][j] - b[2 * i - 2] - b[2 * i - 1]
        print(max([max(i) for i in v]))
S = input()
N = len(S)
A = [int(S[i]) for i in range(N)]
dp = [0] * 2019
cnt = [0] * 2019
cnt[0] = 1

for i in reversed(range(N)):
    dp[i] = (dp[i+1] + (A[i]*(10**(N-i))%2019)) % 2019
    cnt[dp[i]] += 1

ans = 0
for i in cnt:
    ans += i*(i-1)//2

print(ans)

### FIXED CODE ###

S = input()
N = len(S)
A = [int(S[i]) for i in range(N)]
cnt = [0] * 2019
cnt[0] = 1
p = 1
dp = 0

for i in reversed(range(N)):
    dp = (dp + A[i]*p) % 2019
    cnt[dp] += 1
    p = 10 * p % 2019
ans = 0

for i in cnt:
    ans += i*(i-1)//2

print(ans)
# -*- coding: utf-8 -*-
import math

a,b,angle = map(float, raw_input().split())
angle = angle / 180.0 * math.pi

L = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(angle)) + a + b
s = (a + b + c) / 2
S = math.sqrt(s * (s-a) * (s-b) * (s-c))
h = S * 2 / a

print S
print L
print h

### FIXED CODE ###

# -*- coding: utf-8 -*-
import math

a,b,angle = map(float, raw_input().split())
angle = angle / 180.0 * math.pi

# 対辺の長さ
c = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(angle))
L = a + b + c

# 面積
s = (a + b + c) / 2
S = math.sqrt(s * (s-a) * (s-b) * (s-c))

# 高さ
h = S * 2 / a

print S
print L
print h
N, K = map(int, input().split())
S = input()

largest = 0
largest_left_index = -1

sum_list = list()

count = 0
for i in range(N):
    if S[i] == "L":
        if count <= 0:
            count = count - 1
        else:
            sum_list.append(count)
            count = -1
    elif S[i] == "R":
        if count >= 0:
            count = count + 1
        else:
            sum_list.append(-count)
            count = 1
else:
    sum_list.append(count) if count > 0 else sum_list.append(-count)

length = len(sum_list)
current_max = 0
current_max_index = 0
for j in range(length):
    current_sum = sum_list[j]
    if j < length - 1:
        current_sum = current_sum + sum_list[j+1]
    if j < length - 2:
        current_sum = current_sum + sum_list[j+2]

    if current_sum > current_max:
        current_max = current_sum
        current_max_index = j

if current_max_index < length - 2:
    sum_list.pop(current_max_index + 2)
if current_max_index < length - 1:
    sum_list.pop(current_max_index + 1)
sum_list.pop(current_max_index)
sum_list.insert(current_max_index, current_max)

for i in range(K-1):
    left = sum_list[current_max_index]
    if current_max_index > 1:
        left = left + sum_list[current_max_index - 1]
    if current_max_index > 2:
        left = left + sum_list[current_max_index - 2]

    right = sum_list[current_max_index]
    if current_max_index < len(sum_list) - 1:
        right = right + sum_list[current_max_index + 1]
    if current_max_index < len(sum_list) - 2:
        right = right + sum_list[current_max_index + 2]

    if left >= right:
        sum_list.pop(current_max_index)
        sum_list.insert(current_max_index, left)
        if current_max_index > 1:
            sum_list.pop(current_max_index - 1)
        if current_max_index > 2:
            sum_list.pop(current_max_index - 2)
    else:
        length = len(sum_list)
        if current_max_index < length - 2:
            sum_list.pop(current_max_index + 2)
        if current_max_index < length - 1:
            sum_list.pop(current_max_index + 1)
        sum_list.pop(current_max_index)
        sum_list.insert(current_max_index, right)

res = 0
for i in range(len(sum_list)):
    res = res + sum_list[i] - 1

print(res)

### FIXED CODE ###

N, K = map(int, input().split())
S = input()

largest = 0
largest_left_index = -1

sum_list = list()

count = 0
for i in range(N):
    if S[i] == "L":
        if count <= 0:
            count = count - 1
        else:
            sum_list.append(count)
            count = -1
    elif S[i] == "R":
        if count >= 0:
            count = count + 1
        else:
            sum_list.append(-count)
            count = 1
else:
    sum_list.append(count) if count > 0 else sum_list.append(-count)

happines = 0
for i in range(len(sum_list)):
    happines = happines + sum_list[i] - 1

length = len(sum_list)

for i in range(K):
    if length > 2:
        happines = happines + 2
        length = length - 2
    elif length == 2:
        happines = happines + 1
        length = length - 1

print(happines)
3
1 0 0

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

n = int(input())
a = [0]
a += list(map(int, input().split()))

b = [0]*(n+1)

for i in range(n,0,-1):
    sum = 0
    for j in range(2*i, n+1, i):
        sum ^= b[j]
    b[i] = sum^a[i]
    
ans = []
for i in range(1,n+1):
    if b[i]: ans.append(i)

print(len(ans))
print(*ans)
s=input()
k=int(input())
p=s[0]
cnt=1
q=[]
for i in range(len(s)-1):
	if s[i+1]==p:
		cnt+=1
	else:
		q.append(cnt)
		cnt=1
		p=s[i+1]
q.append(cnt)
if q[-1]%2==0:
	cnt=True
else:
	cnt=False
ans=0
if cnt==True:
	for i in range(len(q)):
		ans+=q[i]//2
	print(ans*k)
	exit()
if len(q)==1:
	print(len(s)*k//2)
	exit()
for i in range(k-2):
	ans+=q[i+1]//2
ans*=k
ans+=q[0]//2
ans+=(q[0]+q[1])//2*(k-1)
ans+=q[-1]//2
print(ans)

### FIXED CODE ###

s=input()
k=int(input())
p=s[0]
cnt=1
q=[]
for i in range(len(s)-1):
	if s[i+1]==p:
		cnt+=1
	else:
		q.append(cnt)
		cnt=1
		p=s[i+1]
q.append(cnt)
if q[-1]%2==0:
	cnt=True
else:
	cnt=False
ans=0
if cnt==True:
	for i in range(len(q)):
		ans+=q[i]//2
	print(ans*k)
	exit()
if len(q)==1:
	print(len(s)*k//2)
	exit()
for i in range(len(q)-2):
	ans+=q[i+1]//2
ans*=k
ans+=q[0]//2
if s[0]==s[-1]:#miss
	ans+=(q[0]+q[-1])//2*(k-1)
	ans+=q[-1]//2
	print(ans)
	exit()
else:
	ans=0
	for i in range(len(q)):
		ans+=q[i]//2
	print(ans*k)
import copy
n = int(input())
N = int(n/2-1)
x = list(map(int, input().split()))
y = sorted(x)

for i in range(n):
    Y  = copy.deepcopy(y)
    Y.remove(x[i])
    print(Y[N)


### FIXED CODE ###

a, b, x = map(int, input().split())
if x<a: print('NO')
elif x>a+b: print('NO')
else:print('YES')
S = input()
S_list = list(S)

while len(S_list) >= 5 :
    if S_list[0:5] == ['e', 'r', 'a', 's', 'e']:
        if S_list[5] == 'r':
            del S_list[0:6]
        else:
            del S_list[0:5]
    elif S_list[0:5] == ['d', 'r', 'e', 'a', 'm']:
        if S_list[5:8] == ['e', 'r', 'a']:
            del S_list[0:5]
        elif S_list[5:7] == ['e', 'r'] and S_list[7] != ['a']:
            del S_list[0:7]
        else :
            del S_list[0:5]
    else:
        print('No')
        break


if len(S_list) == 0:
    print('Yes')
elif 0<len(S_list)<5:
    print('No')

### FIXED CODE ###

S = input()
S_list = list(S)

while len(S_list) >= 5 :
    a = len(S_list)
    if S_list[0:5] == ['e', 'r', 'a', 's', 'e']:
        if a >= 6 :
            if S_list[5] == 'r' :
                del S_list[0:6]
            else:
                del S_list[0:5]
        else:
            del S_list[0:5]
    elif S_list[0:5] == ['d', 'r', 'e', 'a', 'm']:
        if a >= 8 :
            if S_list[5:8] == ['e', 'r', 'a'] :
                del S_list[0:5]
            elif S_list[5:7] == ['e', 'r'] :
                del S_list[0:7]
            else :
                del S_list[0:5]
        elif a >= 7 :
            if S_list[5:7] == ['e', 'r'] :
                del S_list[0:7]
            else:
                del S_list[0:5]
        else :
            del S_list[0:5]
    else:
        print('NO')
        break


if len(S_list) == 0:
    print('YES')
elif 0<len(S_list)<5:
    print('NO')
K,S = map(int,input().split())
patterns = 0

arr = [[x+y for y in range(min(S-x+1,K+1))] for x in range(K+1)]
# farr = list(chain.from_iterable(arr))
for a in arr:
    min_z = S - max(a)
    max_z = S - min(a)
    if min_z <= K and max_z >=0:
        patterns += min(max_z,K) - min_z + 1
# print(farr)
# print(farr.count(S))
print(patterns)

### FIXED CODE ###

K,S = map(int,input().split())
patterns = 0

# # arr = [[x+y for y in range(min(S-x+1,K+1))] for x in range(K+1)]
# farr = list(chain.from_iterable(arr))
# for z in farr:
#     temp_z = S - z
#     if temp_z <= K and temp_z >=0:
#         patterns += 1
# print(farr)
# print(farr.count(S))

for x in range(K+1):
    for y in range(max(0,S-K-x), min(K+1,S-x+1)):
        patterns += 1
print(patterns)
while(True):
    n = int(input())
    if n==0: break
    d = dict()
    s = set()
    c = 0
    for _ in range(n):
        id_,p,q = map(int,input().split())
        if id_ in s:
            d[id_] += p*q
        else:
            s.add(id_)
            d[id_] = p*q
    for i in s:
        if d[i] >= 1000000:
            print(i)
            c+=1
    if c == 0: print("NA")

### FIXED CODE ###

while(True):
    n = int(input())
    if n==0: break
    d = {}
    c = 0
    l = list()
    for _ in range(n):
        id_,p,q = map(int,input().split())
        if id_ in d:
            d[id_] += p*q
        else:
            d[id_] = p*q
            l.append(id_)
    for i in l:
        if d[i] >= 1000000:
            print(i)
            c += 1
    if c == 0:
        print('NA')
import sys
input=sys.stdin.readline

h,w,m=map(int,input().split())
hw=[[0]*w for i in range(h)]
for i in range(m):
    hi,wi=map(int,input().split())
    hw[hi-1][wi-1]=1    

ws=[0]*h
for i in range(h):
    ws[i]=0
    for j in range(w):
        ws[i]+=hw[i][j]
hs=[0]*w
for j in range(w):
    hs[j]=0
    for i in range(h):
        hs[j]+=hw[i][j]
        
hwmax=0
for i in range(h):
    for j in range(w):
        if hw[i][j]==1:
            x=ws[i]+hs[j]-1
        else:
            x=ws[i]+hs[j]
#        print(i,j,x)
        hwmax=max(hwmax,x)
        
print(hwmax)
            


### FIXED CODE ###


import sys
input=sys.stdin.readline

h,w,m=map(int,input().split())
hs=dict()
ws=dict()
hw=set()
for i in range(m):
    hi,wi=map(int,input().split())
    if hi-1 in ws:
        ws[hi-1]+=1
    else:
        ws[hi-1]=1
    if wi-1 in hs:
        hs[wi-1]+=1
    else:
        hs[wi-1]=1
    hw.add((hi-1,wi-1))    

wmax=max(list(ws.values()))
hh=[]
for ik,wv in ws.items():
    if wv==wmax:
        hh.append(ik)
hmax=max(list(hs.values()))
ww=[]
for jk,hv in hs.items():
    if hv==hmax:
        ww.append(jk)
        
for hi in hh:
    for wi in ww:
        if  not ((hi,wi) in hw):
#            print(hi,wi)
            print(wmax+hmax) 
            sys.exit()
print(wmax+hmax-1)
n = int(input())
a = list(map(int,input().split()))
g = []
ans = 0
for j in range(60):
    d = 0
    for i in range(n):
        d += a[i]&1
        a[i] >>= 1
    g.append(d)
for i in range(60):
    ans += g[i]*(n-g[i])*(pow(2,i,1000000007))
    ans = ans % (1000000007)
print(ans%(1000000007))

### FIXED CODE ###

a1,a2,a3 = map(int,input().split())
if a1+a2+a3 > 21:
    print('bust')
else:
    print('win')
At = int(input())
Ba = int(input())
K = int(input())

for i in range(K):
    if At >= 1:
        At -= 1
    elif Ba >= 1:
        Ba -= 1
    
print(At)
print(Ba)
    

### FIXED CODE ###

At,Ba,K = (int(x) for x in input().split())

if K <= At:
    print(At - K)
    print(Ba)
elif K <= At + Ba:
    print(0)
    print(Ba - (K - At))
else :
    print(0)
    print(0)
a,b=map(int,input().split())
print(["Possible","Impossible"][a%3==b%3 and (a%3==1 or a%3==2)]

### FIXED CODE ###

a,b=map(int,input().split())
print(["Possible","Impossible"][a%3==b%3 and (a%3==1 or a%3==2)])
def possible(b):
    print('POSSIBLE' if b else 'IMPOSSIIBLE')

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

if k in A:
    possible(True)
    exit()

if n == 1:
    possible(False)
    exit()
A = set(A)
A = list(A)

A.sort()
D = [A[i + 1] - A[i] for i in range(n - 1)]
from fractions import *
g = D[0]
for d in D:
    g = gcd(g, d)

print('POSSIBLE' if k % g == 0 and k <= A[-1] else 'IMPOSSIBLE')


### FIXED CODE ###

def possible(b):
    print('POSSIBLE' if b else 'IMPOSSIBLE')
    exit()

n, k = map(int, input().split())
A = list(set(map(int, input().split())))
n = len(A)

if k in A:
    possible(True)

if k > max(A):
    possible(False)

if n == 1:
    possible(False)

A.sort()
D = [A[i + 1] - A[i] for i in range(n - 1)]
from fractions import *
g = D[0]
for d in D:
    g = gcd(g, d)

possible(k % g == 0)
import string

count = {x: 0 for x in string.ascii_lowercase}

s = input().lower()

for c in s:
    if 'a' <= c <= 'z':
        count[c] += 1

for key, num in count:
    print("{0} : {1}".format(key, num))

### FIXED CODE ###

import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break

for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))
N,L = [int(x) for x in input().split()]
A = list(range(L,L+N))
Min = 100
for i in A:
    if Min > abs(i):
        youso = i
        Min = abs(i)

A.remove(youso)
print(sum(A))

### FIXED CODE ###

N,L = [int(x) for x in input().split()]
A = list(range(L,L+N))
Min = 100
for i in A:
    if Min >= abs(i):
        youso = i
        Min = abs(i)
A.remove(youso)
print(sum(A))
S = list(input())
T = list(input())
dics ={}
dic ={}
for i in range(len(S)):
  if S[i] in dics:
  	dics[S[i]].append(i)
  else :
    dics[S[i]]=i
  if T[i] in dic:
  	dic[T[i]].append(i)
  else:
    dic[T[i]]=i
for i in range(len(S)):
  if dics[S[i]]!=dic[T[i]] and (T[i] in dics and dics[T[i]]!=dic[S[i]]):
    print("No")
    exit()
print("Yes")

  

### FIXED CODE ###

S=input()
T=input()
convert = {}
flag=1
for s,t in zip(S,T):
  if s in convert and convert[s]!=t:
    flag=0
    break
  convert[s] = t
after = convert.values()
if len(after)!= len(set(after)):
  flag = 0

print("Yes" if flag else "No")
s=list(input())
num=0
if n<3:
    exit()
for i in range(n):
    if (s[i]=="A") and (s[i+1]=="B") and (s[i+2]=="C"):
        num+=1
print(num)


### FIXED CODE ###

n=int(input())
s=list(input())
num=0
if n<3:
    exit()
for i in range(n-2):
    if (s[i]=="A") and (s[i+1]=="B") and (s[i+2]=="C"):
        num+=1
print(num)
from collections import deque
h, w = map(int ,input().split())
ch, cw = map(int, input().split())
dh, dw = map(int, input().split())
ch -= 1
cw -= 1
dh -= 1
dw -= 1

s = []
for i in range(h):
  t = input()
  s.append(t)

dx = [1,0,-1,0]
dy = [0,1,0,-1]

queue = deque([[ch,cw]])
visited = [[False for i in range(w)] for j in range(h)]
magic = [[-1 for i in range(w)] for j in range(h)]
visited[ch][cw] = True
magic[ch][cw] = 0
while queue:
  l,m = queue.popleft()
  for k in range(4):
    x = l + dx[k]
    y = m + dy[k]
    if x < 0 or y < 0 or x >= h or y >= w or visited[x][y] or s[x][y] == "#":
      continue
    #visited[x][y] = visited[l][m] + 1
    visited[x][y] = True
    magic[x][y] = magic[l][m]
    queue.append([x,y])
  if len(queue) == 0:
    for i in range(-2,3):
      for j in range(-2,3):
        if (i== 1 and j == 0)or(i==-1 and j == 0)or(i==0 and j == 1)or(i==0 and j==-1)or(i==0 and j==0):
          continue
        x = l + i
        y = m + j
        if x < 0 or y < 0 or x >= h or y >= w or visited[x][y] or s[x][y] == "#":
          continue
        visited[x][y] = True
        magic[x][y] = magic[l][m] + 1
        queue.append([x,y])
        cnt += 1
print (magic[dh][dw])

### FIXED CODE ###

from collections import deque
h, w = map(int ,input().split())
ch, cw = map(int, input().split())
dh, dw = map(int, input().split())
ch -= 1
cw -= 1
dh -= 1
dw -= 1

s = []
for i in range(h):
  t = input()
  s.append(t)

dx = [1,0,-1,0]
dy = [0,1,0,-1]

queue = deque([[ch,cw]])
visited = [[1000000 for i in range(w)] for j in range(h)]
visited[ch][cw] = 0
while queue:
  l,m = queue.popleft()
  d = visited[l][m]
  for k in range(4):
    x = l + dx[k]
    y = m + dy[k]
    if x < 0 or y < 0 or x >= h or y >= w or visited[x][y] <= d or s[x][y] == "#":
      continue
    visited[x][y] = d
    queue.appendleft([x,y])
  for i in range(-2,3):
    for j in range(-2,3):
      if (i== 1 and j == 0)or(i==-1 and j == 0)or(i==0 and j == 1)or(i==0 and j==-1)or(i==0 and j==0):
        continue
      x = l + i
      y = m + j
      if x < 0 or y < 0 or x >= h or y >= w or visited[x][y] <= d+1 or s[x][y] == "#":
        continue
      visited[x][y] = d + 1
      queue.append([x,y])
  #print (queue)
if visited[dh][dw] == 1000000:
  print (-1)
else:
  print (visited[dh][dw])
a, b, c = map(int,raw_input().split())
if a < b:
    a = tmp
    a = b
    b =tmp
elif b < c:
    b = tmp
    b = c
    c =tmp
elif a < c:
    a = tmp
    a = c
    c = tmp
print a b c

### FIXED CODE ###

a = map(int,raw_input().split())
a.sort()
for i in xrange(3):
          print a[i],
if x < a:
  print(0)
elif x > a:
  print(10)

### FIXED CODE ###

x, a = [int(x) for x in input().split()]
if x < a:
  print(0)
elif x >= a:
  print(10)