Harryxun/stf_run huggingface dataset:
import copy
import sys
sys.setrecursionlimit(10**6)

H, W = map(int, input().split())
S = []
for _ in range(H):
    S.append(input())

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

walker=[]
for row in range(H):
    walker.append([None]*W)
waiting=[]
def func(xy, walker):
    x, y = xy
    for i in range(4):
        if 0 <= x+dx[i] < W and 0 <= y+dy[i] <H:
            if walker[y+dy[i]][x+dx[i]] == None and S[y+dy[i]][x+dx[i]] == '.':
                walker[y+dy[i]][x+dx[i]] = walker[y][x]+1
                waiting.append((x+dx[i], y+dy[i]))
    if waiting:
        func(waiting.pop(0),walker)
    else:
        return None


candicate=[]
for sx in range(W):
    for sy in range(H):
        if S[sy][sx] == '.':
            temp_walker=copy.deepcopy(walker)
            temp_walker[sy][sx]=0
            func((sx,sy), temp_walker)
        far=0
        for gx in range(W):
            for gy in range(H):
                if S[gy][gx]=='.':
                    if far <= temp_walker[gy][gx]:
                        far = temp_walker[gy][gx]

        #print(sx, sy, temp_walker, far)
        candicate.append(far)
print(max(candicate))




### FIXED CODE ###

import copy
import sys
sys.setrecursionlimit(10**6)

H, W = map(int, input().split())
S = []
for _ in range(H):
    S.append(input())

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

walker=[]
for row in range(H):
    walker.append([None]*W)
waiting=[]
def func(xy, walker):
    x, y = xy
    for i in range(4):
        if 0 <= x+dx[i] < W and 0 <= y+dy[i] <H:
            if walker[y+dy[i]][x+dx[i]] == None and S[y+dy[i]][x+dx[i]] == '.':
                walker[y+dy[i]][x+dx[i]] = walker[y][x]+1
                waiting.append((x+dx[i], y+dy[i]))
    if waiting:
        func(waiting.pop(0) ,walker)
    else:
        return None


candicate = []
for sx in range(W):
    for sy in range(H):
        if S[sy][sx] == '.':
            temp_walker=copy.deepcopy(walker)
            temp_walker[sy][sx]=0
            func((sx,sy), temp_walker)
            far=0

            for gx in range(W):
                for gy in range(H):
                    if S[gy][gx]=='.':
                        if far < temp_walker[gy][gx]:
                            far = temp_walker[gy][gx]

            #print(sx, sy, temp_walker, far)
            candicate.append(far)
print(max(candicate))
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 = int(input())
L0 = 2
L1 = 1

for i in range(1,N):
    res = L0 + L1
    L0 = L1
    L1 = res

print(res)

### FIXED CODE ###

N = int(input())
L0 = 2
L1 = 1
if N == 1:
    print(L1)
    exit()

for i in range(1,N):
    res = L0 + L1
    L0 = L1
    L1 = res

print(res)
def main():
    H, W, K = [int(c) for c in input().split()]
    cake = [list(input()) for _ in range(H)]
    ichigo = [0]*H
    result = [[] for _ in range(H)]
    last_one = -1
    for i in range(H):
        for j in range(W):
            if cake[i][j] == "#":
                ichigo[i]+=1
    ichigo_no = 0
    for i in range(H):
        if ichigo[i] == 0:
            continue
        ichigo_no+=1
        for j in range(W):
            if cake[i][j] == ".":
                result[i].append(ichigo_no)
            else:
                result[i].append(ichigo_no)
                ichigo[i] -= 1
                if ichigo[i] != 0:
                    ichigo_no += 1

    for i in range(H-1):
        if len(result[i]) == 0 and len(result[i+1]) != 0:
            result[i] = result[i+1]
    for i in reversed(range(1,H)):
        if len(result[i]) == 0 and len(result[i-1]) != 0:
            result[i] = result[i-1]
    for i in range(H):
        for j in range(W-1):
            print(result[i][j], end=" ")
        print(result[i][-1])

main()


### FIXED CODE ###

def main():
    H, W, K = [int(c) for c in input().split()]
    cake = [list(input()) for _ in range(H)]
    ichigo = [0]*H
    result = [[] for _ in range(H)]
    last_one = -1
    for i in range(H):
        for j in range(W):
            if cake[i][j] == "#":
                ichigo[i]+=1
    ichigo_no = 0
    for i in range(H):
        if ichigo[i] == 0:
            continue
        ichigo_no+=1
        for j in range(W):
            if cake[i][j] == ".":
                result[i].append(ichigo_no)
            else:
                result[i].append(ichigo_no)
                ichigo[i] -= 1
                if ichigo[i] != 0:
                    ichigo_no += 1

    for i in range(1,H):
        if len(result[i]) == 0 and len(result[i-1]) != 0:
            result[i] = result[i-1]
    for i in reversed(range(H-1)):
        if len(result[i]) == 0 and len(result[i+1]) != 0:
            result[i] = result[i+1]
    for i in range(H):
        for j in range(W-1):
            print(result[i][j], end=" ")
        print(result[i][-1])

main()
n,y=map(int,input().split())
x=[-1,-1,-1]
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
      x=[i,j,n-i-j]
      break
for _ in range(3):
  print(x[i])

### FIXED CODE ###

n,y=map(int,input().split())
x=[-1,-1,-1]
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
      x=[i,j,n-i-j]
      break
for _ in range(3):
  print(x[_])
import numpy as np
import math
import sys

a, b, n = map(int, input().split())
array = np.arange(1, n+1, math.ceil(1/10**5))
ans = -sys.maxsize-1

for x in array:
    val = int((a*x)/b) - a*int(x/b)
    if val > ans:
        ans = val

print(ans)


### FIXED CODE ###

a, b, n = map(int, input().split())
x = min(b-1, n)
ans = int((a*x)/b) - a*int(x/b)
print(ans)
from sys import stdin
a=  stdin.readline().strip()
a= list(a)
a.reverse()
ans= 0
cur =0
for i in a:
 if i=='W':
  cur+=1
 else:
  ans+= 1
print ansa

### FIXED CODE ###

from sys import stdin
a=  stdin.readline().strip()
a= list(a)
a.reverse()
ans= 0
cur =0
for i in a:
 if i=='W':
  cur+=1
 else:
  ans+= cur
print ans
n,a,b,c,d = (int(i) for i in input().split())  
s = input()
if c<d:
  if s[a:c+1].count("##")>0 and s[b:d+1].count("##")>0:
    print("No")
  else:
    print("Yes")
else:
  if s[a:c+1].count("##")==0 and s[b:d+1].count("##")==0 and (s[b-1:d+1].count("...")>0 or s[b-1:B+2].count("...")>0):
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

n,a,b,c,d = (int(i) for i in input().split())  
s = input()
e = 0
if c<d:
  if s[a:c-1].count("##")==0 and s[b:d-1].count("##")==0:
    print("Yes")
  else:
    print("No")
else:
  if s[a:c-1].count("##")==0 and s[b:d-1].count("##")==0:
    for i in range(b-1,d):
      if s[i-1:i+2]=="..." :
        e = 1 
    if e == 1:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
import collections
n = int(input())
v = list(map(int,input().split()))
ve = [v[2*i] for i in range(n//2)]
vo = [v[2*i + 1] for i in range(n//2)]
Cve = collections.Counter(ve)
Cvo = collections.Counter(vo)
Cve1 = Cve.most_common()[0]
Cvo1 = Cvo.most_common()[0]
if len(Cve) == 1 and len(Cvo) == 1:
    if Cve1[0] == Cvo1[0]: ans = n//2
    else: ans = 0
elif len(Cve) == 1 and len(Cvo) != 1:
    Cvo2 = Cvo.most_common()[1]
    if Cve1[0] == Cvo1[0]: ans = n//2 - Cvo2[1]
    else: ans = n//2 - Cvo1[1]
elif len(Cve) != 1 and len(Cvo) == 1:
    Cve2 = Cve.most_common()[1]
    if Cve1[0] == Cvo1[0]: ans = n//2 - Cve2[1]
    else: ans = n//2 - Cve1[2]
else:
    Cve2 = Cve.most_common()[1]
    Cvo2 = Cvo.most_common()[1]
    if Cve1[0] != Cvo1[0]: ans = n - Cve1[1] - Cvo1[1] 
    if Cve1[0] == Cvo1[0]:
        if Cve1[1] > Cvo1[1]: ans = n - Cve1[1] - Cvo2[1]
        else: ans = n - Cve2[1] - Cvo1[1]
print(ans)

### FIXED CODE ###

import collections
n = int(input())
v = list(map(int,input().split()))
ve = [v[2*i] for i in range(n//2)]
vo = [v[2*i + 1] for i in range(n//2)]
Cve = collections.Counter(ve)
Cvo = collections.Counter(vo)
Cve1 = Cve.most_common()[0]
Cvo1 = Cvo.most_common()[0]
if len(Cve) == 1 and len(Cvo) == 1: #eo両方1種類
    if Cve1[0] == Cvo1[0]: ans = n//2 #eo top同じ
    else: ans = 0 #eo異なる
elif len(Cve) == 1 and len(Cvo) > 1: #eのみ1種類
    Cvo2 = Cvo.most_common()[1]
    if Cve1[0] == Cvo1[0]: ans = n//2 - Cvo2[1] #eo top同じ
    else: ans = n//2 - Cvo1[1] #eo top異なる
elif len(Cve) > 1 and len(Cvo) == 1: #oのみ1種類
    Cve2 = Cve.most_common()[1]
    if Cve1[0] == Cvo1[0]: ans = n//2 - Cve2[1] #eo top同じ
    else: ans = n//2 - Cve1[1] #eo top異なる
else:
    Cve2 = Cve.most_common()[1]
    Cvo2 = Cvo.most_common()[1]
    if Cve1[0] != Cvo1[0]: ans = n - Cve1[1] - Cvo1[1] #top異なる
    if Cve1[0] == Cvo1[0]:
        if Cve1[1] < Cvo1[1]: ans = n - Cve2[1] - Cvo1[1]
        elif Cve2[1] > Cvo2[1] : ans = n - Cve2[1] - Cvo1[1]
        else: ans = n - Cve1[1] - Cvo2[1]
print(ans)
N = int(input())

info = []
for i in range(N):
    info.append(list(map(int,input().split())))

ans = []
ans_c = 0
for i in range(101):
    for j in range(101):
        H = -1
        judge = True
        for k in range(N):
            if info[k][2] == 0:
                continue
            dis = abs(i - info[k][0]) + abs(j - info[k][1])
            if H == -1:
                H = info[k][2] + dis
            else:
                if H != (info[k][2] + dis):
                    judge = False
        if judge == True:
            ans_c += 1
            add_data = [i,j,H]
            ans.append(add_data)


for i in range(ans_c):
    judge = True
    for k in range(N):
        judge = True
        if info[k][2] == 0:
            h = max(abs(ans[i][0] - info[k][0]) + abs(ans[j][1] - info[k][1]),0)
            if h != 0:
                judge = False
    if judge == True:
        ans[0][0] = ans[i][0]
        ans[0][1] = ans[i][1]
        ans[0][2] = ans[i][2]
print("{} {} {}".format(ans[0][0],ans[0][1],ans[0][2]))






### FIXED CODE ###

N = int(input())

info = []
for i in range(N):
    info.append(list(map(int,input().split())))

ans = []
ans_c = 0
for i in range(101):
    for j in range(101):
        H = -1
        judge = True
        for k in range(N):
            if info[k][2] == 0:
                continue
            dis = abs(i - info[k][0]) + abs(j - info[k][1])
            if H == -1:
                H = info[k][2] + dis
            else:
                if H != (info[k][2] + dis):
                    judge = False
        if judge == True:
            for k in range(N):
                if info[k][2] == 0:
                    h = max(H - (abs(i - info[k][0]) + abs(j - info[k][1])), 0)
                    if h != 0:
                        judge = False
        if judge == True:
            print("{} {} {}".format(i,j,H))
            exit()
d,n = map(int, input().split())
if d == 0:
    l = [i for i in range(0,100)]
elif d == 1:
    l = [i for i in range(100, 10000, 100)]
else:
    l = [i for i in range(10000, 1000000, 10000)]
print(l[n])


### FIXED CODE ###

d,n = map(int, input().split())
r = 100 ** d
l = [i for i in range(0, r*100, r)]
if n == 100:
    print(100 ** (d + 1) + 100 ** d)
else:
    print(l[n])
S = input()
chars = "abcdefghijklmnopqrstuvwxyz"
if len(S) < 26:
    for c in chars:
        if c not in S:
            Ans = S+c
            break
else:
    if S == chars[::-1]:
        Ans = -1
    else:
        for i in range(26):
            if S[i] != chars[i]:
                Ans = S[0:i-1] + chars[i]
                break
print(Ans)

### FIXED CODE ###

S = input()
chars = "abcdefghijklmnopqrstuvwxyz"
if len(S) < 26:
    for c in chars:
        if c not in S:
            Ans = S+c
            break
else:
    if S == chars[::-1]:
        Ans = -1
    else:
        for i in range(25):
            if S[25-i] > S[25-i-1]:
                break
        for j in range(25): # index out of rangeにならない？大丈夫？
            if chr(ord(S[25-i-1])+1+j) not in S[0:25-i-1]:
                break
        Ans = S[0:25-i-1]+chr(ord(S[25-i-1])+1+j)
print(Ans)
A, B, C, K = map(int, input().split())
count = 0
if A == K:
    print(A)
    quit()
D = K-A
if (D - B) <= 0:
    print(A)
elif (D-B) > 0:
    E = (D-B)-C
    print(E)


### FIXED CODE ###

S = str(input())
T = str(input())
print('Yes' if T[:-1] == S else 'No')
n = int (input())
h = list(map(int,input().split()))
count_list = []
count=0
for i in range(n):
   if i == n-1:
      break
   if h[i] >= h[i+1]:
      if count !=0:
         count +=1
      else:
         count = 1
   else:
      count = 0
   count_list.append(count)
print(max(count_list))

### FIXED CODE ###

n = int (input())
h = list(map(int,input().split()))
count_list = []
count=0
for i in range(n):
   if i == n-1:
      break
   if h[i] >= h[i+1]:
      if count !=0:
         count +=1
      else:
         count = 1
   else:
      count = 0
   count_list.append(count)
if not count_list:
   count_list.append(0)
print(max(count_list))
N = int(input())
list = []
for n in range(0, N):
  input = input()
  if n == 0:
    list.append(input)
  else:
    if input in list:
      print('No')
      break
    else:
      list.append(input)
  if n == N-1:
    print('Yes')


### FIXED CODE ###

N = int(input())
ls = []
flag = True
bChar = ""
for n in range(0, N):
  ch = input()
  if n == 0:
    ls.append(ch)
  else:
    if (ch in ls) or (bChar[-1:] != ch[0:1]):
      flag = False
  ls.append(ch)
  bChar = ch
if flag == True:
  print('Yes')
else:
  print('No')
S=input()
S=int(S)
h=S/3600
h=int(h)
m=(S-3600*h)/60
m=int(m)
s=S-h*3600-m*60
print(h:m:s)

### FIXED CODE ###

S=input()
S=int(S)
h=S/3600
h=int(h)
m=(S-3600*h)/60
m=int(m)
s=S-h*3600-m*60
s=int(s)
h=str(h)
m=str(m)
s=str(s)
print(h+':'+m+':'+s)
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

if sum(a) + sum(b) <= k:
    print(n + m)
    exit()

lena = len(a)
lenb = len(b)

timecnt = 0
cnt = 0
while timecnt <= k:
    inda = len(a) - lena
    indb = len(b) - lenb
    if inda < 0 and indb < 0:
        break
    elif inda < 0 and indb >= 0:
        timecnt += b[indb]
        lenb -= 1
        cnt += 1
    elif inda >= 0 and indb < 0:
        timecnt += a[inda]
        lena -= 1
        cnt += 1
    elif a[inda] <= b[indb]:
        timecnt += a[inda]
        lena -= 1
        cnt += 1
    else:
        timecnt += b[indb]
        lenb -= 1
        cnt += 1

print(cnt - 1)

### FIXED CODE ###

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

a, b = [0], [0]
for i in range(n):
    a.append(a[i] + A[i])
for i in range(m):
    b.append(b[i] + B[i])

ans, j = 0, m
for i in range(n + 1):
    if a[i] > k:
        break
    while b[j] > k - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
alfa=int(input())
L=[int(input()) for i in range(N)]

N=alfa[0]
X=alfa[2]

print(N,X,L)
D=0
count=0
for i in range(N):
    count+=1
    D+=L[i]
    if D>X:
        print(count)
        break


### FIXED CODE ###

alfa=input().split()
N=int(alfa[0])
X=int(alfa[1])
#L=[int(input().split()) for i in range(N)]
L=input().split()

#print(N,X,L)
D=0
count=1
for i in range(N):
    D+=int(L[i])
    if D>X:
        print(count)
        break
    else:
        count+=1

if D<=X:
    print(count)
a, b = map(int, input())

print(a*b, 2*a+2*b)


### FIXED CODE ###

a, b = map(int,input().split())
print("%d %d" %(a*b, 2*(a+b) ) )
import collections
import itertools
import math


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


n, m = map(int, input().split())
m2 = math.ceil(math.sqrt(m))
sieve = eratosthenes(m2)
counter = collections.Counter()

mm = m
for k in range(2, m2):
    if sieve[k] and m % k == 0:
        while mm % k == 0:
            mm //= k
            counter[k] += 1
if mm > 1:
    counter[mm] += 1

es = [range(k + 1) for k in counter.values()]
res = 1
for ks in itertools.product(*es):
    x = 1
    for p, k in zip(counter.keys(), ks):
        x *= p**k
    if x <= m // n:
        res = max(res, x)
print(res)

### FIXED CODE ###

import collections
import itertools
import math


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


n, m = map(int, input().split())
m2 = math.ceil(math.sqrt(m)) + 1
sieve = eratosthenes(m2)
counter = collections.Counter()

mm = m
for k in range(2, m2):
    if sieve[k] and m % k == 0:
        while mm % k == 0:
            mm //= k
            counter[k] += 1
if mm > 1:
    counter[mm] += 1

es = [range(k + 1) for k in counter.values()]
res = 1
for ks in itertools.product(*es):
    x = 1
    for p, k in zip(counter.keys(), ks):
        x *= p**k
    if x <= m // n:
        res = max(res, x)
print(res)
import matplotlib
import matplotlib.pyplot as plt
import numpy as np

N = input()
B = False
kaisu = 0
array = map(int,input().split())

def calc(n):
  return int(n) / 2
  
  
while not B:
  for i in range(N):
    if array[i]/2 == 1:
      B = True
  if not B:
    array = map(calc, array)
    kaisu += 1
  else:
    break
        
print(kaisu)

### FIXED CODE ###

N = int(input())
B = False
kaisu = 0
array = list(map(int,input().split()))

def calc(n):
  return int(n) / 2
  
  
while not B:
  for i in range(N):
    if array[i] % 2 == 1:
      B = True
  if not B:
    array = list(map(calc, array))
    kaisu += 1
  else:
    break
        
print(kaisu)
a=int(input())
b=int(input())
c=int(input())
if a==b==c:
  print(1)
elif a==b or b==c or c==a:
  print(2)
else:print(3)
print(a,b,c)

### FIXED CODE ###

a,b,c = list(map(int,input().split()))
if a==b==c:print('1')
elif (a==b and c!=a) or (b==c and a!=b) or (c==a and b!=c):print('2')
else:print('3')
import math

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

A_min = int(math.ceil(A/0.08))
A_max = int(math.floor((A+1)/0.08)

B_min = int(math.ceil(B/0.1))
B_max = int(math.floor((B+1)/0.1)


A_list = list(range(A_min,A_max+1))
B_list = list(range(B_min,B_max+1))

ans_list = list(set(A_list) & set(B_list))

if len(ans_list) > 1:
  print(min(ans_list))
elif len(ans_list) == 0:
  print(-1)
else:
  print(min(ans_list))


### FIXED CODE ###

S = input()

if S.count('A') > 0 and S.count('B') > 0:
    print('Yes')
else:
    print('No')
a1=input()
a2=input()
print(6-a1-a2)

### FIXED CODE ###

a1=int(input())
a2=int(input())
print(6-a1-a2)
# Acceptance of input

import sys

f_i = sys.stdin

n = int(f_i.readline())

edges = [[] for i in range(n)]

for l_i in f_i:
    s, t, w = map(int, l_i.split())
    edges[s].append([t, w])
    edges[t].append([s, w])

# Tree Walk and Output

distance = [0] * n

sys.setrecursionlimit(100000)

def tree_walk(u, d, p):
    for v, w in edges[u]:
        if v != p:
            c_d = d + w
            distance[v] = c_d
            tree_walk(v, c_d, u)

tree_walk(0, 0, None)

end_point = distance.index(max(distance))

tree_walk(end_point, 0, None)

print(max(distance))

### FIXED CODE ###

# Acceptance of input

import sys

f_i = sys.stdin

n = int(f_i.readline())

edges = [[] for i in range(n)]

for l_i in f_i:
    s, t, w = map(int, l_i.split())
    edges[s].append((t, w))
    edges[t].append((s, w))

# Tree Walk function

import collections

def tree_walk(start, switch = 0):
    path = collections.deque()
    path.append(start)

    weight = collections.deque()
    weight.append(0)
    
    unvisited = [True] * n
    unvisited[start] = False
    
    rest = n - 1
    end_point = start
    diameter = 0
    
    while True:
        u = path[-1]
        for v, w in edges[u]:
            if unvisited[v]:
                path.append(v)
                unvisited[v] = False
                rest -= 1
                weight.append(w)
                break

        if u == path[-1]:
            distance = sum(weight)
            if diameter < distance:
                diameter = distance
                end_point = u
            if rest == 0:
                break
            path.pop()
            weight.pop()

    if switch:
        print(diameter)
    else:
        return end_point

# Output

tree_walk(tree_walk(0), 1)
a,b,c,d=map(int,input().split())
print(max(ab,cd))

### FIXED CODE ###

a,b,c,d=map(int,input().split())
print(max(a*b,c*d))
from bisect import bisect_left
N = int(input())
L = list(map(int, input().split()))
L = L.sort()
res = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        idx = bisect_left(L[j+1:], L[i]+L[j])
        res += idx
print(res)

### FIXED CODE ###

from bisect import bisect_left
N = int(input())
L = list(map(int, input().split()))
L.sort()
res = 0
for i in range(N):
    for j in range(i+1, N):
        idx = bisect_left(L, L[i]+L[j])
        res += max(0,idx-(j+1))
print(res)
N=int(input())
H=list(map(int,input().split()))

HH=[0]
M=0
K=[]
if N==1:
    print(0)
elif N==2:
    if H[0]>=H[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(1,N-1):
        HH.append(H[i+1]-H[i])
    for i in range(len(HH)):
        if HH[i]<=0:
            M+=1
        else:
            K.append(M)
            M=0
K.append(M)
del K[0]
print(max(K))

### FIXED CODE ###

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


M=0
K=[]
if N==1:
    print(0)
elif N==2:
    if H[0]>=H[1]:
        print(1)
    else:
        print(0)
else:
    HH=[H[1]-H[0]]
    for i in range(1,N-1):
        HH.append(H[i+1]-H[i])
    for i in range(len(HH)):
        if HH[i]<=0:
            M+=1
        else:
            K.append(M)
            M=0
    K.append(M)
    print(max(K))
s=list(input())
t=list(input())

x=len(s)

ch1=0
ch=0

for i in range(x):
  if s[i]=t[x-1-i]:
    ch+=1

for j in range(x):
  if s[j]=t[j]:
    ch1+=1
    
print('Yes' if ch==x or ch1==x :'No' else)
  


### FIXED CODE ###

s=list(input())
t=list(input())

S=s+s
c=0

for i in range(len(s)):
  ch=0
  for j in range(len(s)):
    if S[i+j]==t[j]:
      ch+=1
  if ch==len(s):
    c+=1

if c>0:
  print('Yes')
  
else:
  print('No')