Harryxun/stf_run huggingface dataset:
n=int(input())
h=[int(i) for i in input().split()]
ans=0
ans1=[]
a=1
for i in range(a,n-1):
  for k in range(i,n-1):
    if h[k]>=h[k+1]:
      ans+=1
      a+=1
    else:
      ans1.append(ans)
      ans=0
      break
print(max(ans1))


### FIXED CODE ###

n=int(input())
h=[int(i) for i in input().split()]
ans=0
ans1=[]
a=0
while 1:
    for k in range(a,n-1):
        if h[k]>=h[k+1] :
            ans+=1
            a+=1
        else:
            ans1.append(ans)
            ans=0
            a+=1
            break
    if a>=n-1:
        ans1.append(ans)
        break
print(max(ans1))
import numpy as np
h,w = map(int,input().split())
ans = [[0]*(w+2) for _ in range(h+2)]
grid = []
grid.append(['#']*(w+2))
for _ in range(h):
    s = list(input())
    grid.append(['#'] + s + ['#'])
grid.append(['#']*(w+2))
for i in range(1,h+1):
    for j in range(0,w+2):
        if grid[i][j] == '#':
            if j >= 1:
                for k in range(j-start):
                    ans[i][start+k] += j-start
            start = j + 1
for j in range(1,w+1):
    for i in range(0,h+2):
        if grid[i][j] == '#':
            if i >= 1:
                for k in range(i-start):
                    ans[start+k][j] += i-start
            start = i + 1
print(np.amax(ans)-1)


### FIXED CODE ###

h,w = map(int,input().split())
ans = [[0]*(w+2) for _ in range(h+2)]
grid = []
grid.append(['#']*(w+2))
for _ in range(h):
    s = list(input())
    grid.append(['#'] + s + ['#'])
grid.append(['#']*(w+2))
for i in range(1,h+1):
    for j in range(0,w+2):
        if grid[i][j] == '#':
            if j >= 1:
                for k in range(j-start):
                    ans[i][start+k] += j-start
            start = j + 1
for j in range(1,w+1):
    for i in range(0,h+2):
        if grid[i][j] == '#':
            if i >= 1:
                for k in range(i-start):
                    ans[start+k][j] += i-start
            start = i + 1
print(max(list(map(lambda x:max(x),ans)))-1)
S = str(input())
T = str(input())
slist = list(S)
tlist = list(T)
Slen = len(slist)
Tlen = len(tlist)
ANSlist = []
Flag = 0
for i in range(Slen-Tlen+1):
    flag = 0
    for j in range(Tlen):
        if slist[i+j] == "?" or slist[i+j] == tlist[j]:
            pass
        else:
            flag = 1
            break
    if flag == 0:
        Skari = ""
        k = 0
        for k in range(i):
            if slist[k] == "?":
                Skari+="a"
            else:
                Skari+=slist[k]
        l = 0
        for l in range(Tlen):
            Skari+=tlist[l]
        m = 0
        Skarilen = len(Skari)
        for m in range(Slen-Skarilen):
            M = m+Slen
            if slist[M] == "?":
                Skari+="a"
            else:
                Skari+=slist[M]
        ANSlist.append(Skari)
        Flag+=1
    else:
        pass
if Flag >= 1:
    print(min(ANSlist))
else:
    print("UNRESTORABLE")

### FIXED CODE ###

S = str(input())
T = str(input())
slist = list(S)
tlist = list(T)
Slen = len(slist)
Tlen = len(tlist)
ANSlist = []
Flag = 0
if Slen < Tlen:
    Flag = 0
else:
    for i in range(Slen-Tlen+1):
        flag = 0
        for j in range(Tlen):
            if slist[i+j] == "?" or slist[i+j] == tlist[j]:
                pass
            else:
                flag = 1
                break
        if flag == 0:
            Skari = ""
            k = 0
            for k in range(i):
                if slist[k] == "?":
                    Skari+="a"
                else:
                    Skari+=slist[k]
            l = 0
            for l in range(Tlen):
                Skari+=tlist[l]
            m = 0
            Skarilen = len(Skari)
            for m in range(Slen-Skarilen):
                M = m+Skarilen
                if slist[M] == "?":
                    Skari+="a"
                else:
                    Skari+=slist[M]
            ANSlist.append(Skari)
            Flag+=1
        else:
            pass
if Flag >= 1:
    print(min(ANSlist))
else:
    print("UNRESTORABLE")
n,k = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
a = []
for i in range(len(p)-k):
  mx = p[i+k] - p[i]
  a.append(mx)
max_a = max(a)
ans = (max_a + k)/2
print(ans)



### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    N, K = map(int, input().split())
    P = list(map(int, input().split()))

    tmp_max = sum(P[:K])
    tmp = sum(P[:K])
    for i in range(N-K):
        tmp += P[i+K]
        tmp -= P[i]

        if tmp > tmp_max:
            tmp_max = tmp

    print((tmp_max + K) / 2)

main()
import sys                                                   
l1 = list(map(int, input().split()))                         
N = l1[0]                                                    
M = l1[1]                                                    
                                                             
dat = []                                                     
                                                             
per_dis = [ [] for n in range(N+1)]                          
                                                             
for n in range(M):                                           
    x = list(map(int, input().split()))                      
    dat.append(x)                                            
    per_dis[x[0]].append((x[1],x[2]))                        
    per_dis[x[1]].append((x[0],-x[2]))                       
                                                             
per_point = [ None for n in range(N+1)]                      
                                                             
if M != 0:                                                   
    visited = []                                             
    unvisited = [(dat[0][0], 0)]                             
    while unvisited:                                         
        now = unvisited[0]                                   
        unvisited = unvisited[1:]                            
        for next in per_dis[now[0]]:                         
            if next[0] not in visited:                       
                per_point[next[0]] = now[1] + next[1]        
                unvisited.append((next[0], now[1] + next[1]))
                visited.append(next[0])                      
                                                             
for x in dat:                                                
    if per_point[x[1]] - per_point[x[0]] != x[2]:            
        print("No")                                          
        sys.exit(0)                                          
print("Yes")                                                 

### FIXED CODE ###

from collections import deque

def bfs(x, graph, people):
    if people[x] is not None:
        return
    unvisited = deque([x])
    people[x] = 0
    while unvisited:
        now = unvisited.popleft()
        for next, d in graph[now]:
            if people[next] is None:
                people[next] =  people[now] + d
                unvisited.append(next)

def main():
    N, M = list(map(int, input().split()))

    graph = [ [] for n in range(N+1)]
    people = [None] * (N+1)

    for n in range(M):
        L, R, D = list(map(int, input().split()))
        graph[L].append((R, D))
        graph[R].append((L, -D))
    for i in range(1, N+1):
        bfs(i, graph, people)

    for i in range(1, N+1):
        for j, d in graph[i]:
            if people[j] - people[i] != d:
                print("No")
                exit()
    else:
        print("Yes")


if __name__ == "__main__":
    main()
import sys

nm = list(input().split(" "))
N = int(nm[0])
M = int(nm[1])
A = list(input().split(" "))
A.sort()
A.reverse()

ans = 0

start ,counter  = 0 , 0
flag1 = 0
flag2 = 0 # repete
flag3 = 0 # next step
for i in range(0,M):
    if flag1 == 0:
        ans += int(A[start]) + int(A[counter])
        counter += 1
        flag1 = 1
    elif flag2 == 0:
        ans += int(A[start]) + int(A[counter])
        flag2 = 1
    else:
        ans += int(A[start]) + int(A[counter])
        flag2 = 0
        if flag3 == 0:
            counter += 1
            if counter == N-1:
                flag3 = 1
        else:
            flag1 = 0
            flag3 = 0
            start += 1
            counter = start

print(ans)

    
    
    


### FIXED CODE ###

import sys

nk = list(input().split(" "))
n = int(nk[0])
k = int(nk[1])
rsp = list(input().split(" "))
r = int(rsp[0])
s = int(rsp[1])
p = int(rsp[2])
T = str(input())

my_choice = [""] * n
ans = 0

for i in range(0,k):
    if T[i] == "r":
        my_choice[i] = "p"
        ans += p
    elif T[i] == "s":
        my_choice[i] = "r"
        ans += r
    else:
        my_choice[i] = "s"
        ans += s

if k == n:
    print(ans)
    sys.exit()

for i in range(k,n):
    if T[i] == "r" and my_choice[i - k] != "p":
        my_choice[i] = "p"
        ans += p
    elif T[i] == "s" and my_choice[i - k] != "r":
        my_choice[i] = "r"
        ans += r
    elif T[i] == "p" and my_choice[i - k] != "s":
        my_choice[i] = "s"
        ans += s


print(ans)
from numba import njit
s = input()

@njit
def test(c):
    # current point can be seen as xth smallest val, where x can be any value in [a, b] (subset of [0, c])
    # a <= b
    a, b = 0, c
    ok = True
    discrete = False # when True x = a, a+2, ..., b-2, b
    for si in s:
        if si == '1':
            if a == b == c:
                return False
            a += 1
            b += 1
            if b > c:
                b = c - 1 if discrete else c
        elif si == '0':
            if a == b == 0:
                return False
            a -= 1
            b -= 1
            if a < 0:
                a = 1 if discrete else 0
        else:
            if a == b == 0:
                a = b = 1
            elif a == b == c:
                a = b = c - 1
            elif a == b:
                discrete = True
                a -= 1
                b += 1
            else:
                a -= 1
                b += 1
                if a < 0:
                    a = 1 if discrete else 0
                if b > c:
                    b = c - 1 if discrete else c
    return True


l, r = 0, len(s)
while r - l > 1:
    c = (l + r) // 2
    if test(c):
        r = c
    else:
        l = c
print(r)


### FIXED CODE ###

from numba import njit
import numpy as np
s = np.array(list(map(lambda x: -1 if x == '?' else int(x), input())))
@njit
def test(c):
    # current point can be seen as xth smallest val, where x can be any value in [a, b] (subset of [0, c])
    # a <= b
    a, b = 0, c
    ok = True
    discrete = False # when True x = a, a+2, ..., b-2, b
    for si in s:
        if si == 1:
            if a == b == c:
                return False
            a += 1
            b += 1
            if b > c:
                b = c - 1 if discrete else c
        elif si == 0:
            if a == b == 0:
                return False
            a -= 1
            b -= 1
            if a < 0:
                a = 1 if discrete else 0
        else:
            if a == b == 0:
                a = b = 1
            elif a == b == c:
                a = b = c - 1
            elif a == b:
                discrete = True
                a -= 1
                b += 1
            else:
                a -= 1
                b += 1
                if a < 0:
                    a = 1 if discrete else 0
                if b > c:
                    b = c - 1 if discrete else c
    return True

l, r = 0, s.size
while r - l > 1:
    c = (l + r) // 2
    if test(c):
        r = c
    else:
        l = c
print(r)
c=int(input())
if c == a :
    print("b")
elif c == b :
    print("c")
elif c == c :
    print("d")
elif c == d :
    print("e")
elif c == e :
    print ("f")
elif c == f :
    print("g")
elif c == g :
    print("h")
elif c == h :
    print("i")
elif c == i :
    print("j")
elif c == j :
    print("k")
elif c == k :
    print("l")
elif c == l :
    print("m")
elif c == m :
    print("n")
elif c == n :
    print("o")
elif c == o :
    print("p")
elif c == p :
    print("q")
elif c == q :
    print("r")
elif c== r :
    print("s")
elif c == s :
    print("t")
elif c == t :
    print("u")
elif c == u :
    print("v")
elif c == v :
    print("w")
elif c == w :
    print("x")
elif c == x :
    print("y")
elif c == y :
    print("z")


### FIXED CODE ###

c=str(input())
if c == 'a' :
    print("b")
elif c == 'b' :
    print("c")
elif c == 'c' :
    print("d")
elif c == 'd' :
    print("e")
elif c == 'e' :
    print ("f")
elif c == 'f' :
    print("g")
elif c == 'g' :
    print("h")
elif c == 'h' :
    print("i")
elif c == 'i' :
    print("j")
elif c == 'j' :
    print("k")
elif c == 'k' :
    print("l")
elif c == 'l' :
    print("m")
elif c == 'm' :
    print("n")
elif c == 'n' :
    print("o")
elif c == 'o' :
    print("p")
elif c == 'p' :
    print("q")
elif c == 'q' :
    print("r")
elif c == 'r' :
    print("s")
elif c == 's' :
    print("t")
elif c == 't' :
    print("u")
elif c == 'u' :
    print("v")
elif c == 'v' :
    print("w")
elif c == 'w' :
    print("x")
elif c == 'x' :
    print("y")
elif c == 'y' :
    print("z")
n=int(input())
V=list(map(int, input().split(" ")))
d1=[0 for i in range(10000)]
for i in V[::2]:
    d1[i]+=1
d2=[0 for i in range(10000)]
for i in V[1::2]:
    d2[i]+=1


if d1.index(max(d1)) == d2.index(max(d2)):
    if max(d1)>max(d2):
        d2[d2.index(max(d2))]=0
    else:
        d1[d1.index(max(d1))]=0

#print(d1[:5])
#print(d2[:5])
tmp1=n/2-max(d1)
tmp2=n/2-max(d2)
print(int(tmp1+tmp2))

### FIXED CODE ###

import copy
n=int(input())
V=list(map(int, input().split(" ")))
d1=[0 for i in range(100000)]
for i in V[::2]:
    d1[i-1]+=1
d2=[0 for i in range(100000)]
for i in V[1::2]:
    d2[i-1]+=1

m1=max(d1)
m2=max(d2)
maxind1 = [i for i, x in enumerate(d1) if x == m1]
maxind2 = [i for i, x in enumerate(d2) if x == m2]

#in1=d1.index(max(d1))
#in2=d2.index(max(d2))



if (maxind1[0] == maxind2[0]) and (len(maxind1) == 1) and (len(maxind2) == 1):
    #if m1>m2:
    #d2[maxind2[0]]=0
    tmp=copy.copy(d2)
    tmp[maxind2[0]]=0
    result1=n-max(d1)-max(tmp)

    #else:
    #d1[maxind1[0]]=0
    tmp=copy.copy(d1)
    tmp[maxind1[0]]=0
    result2=n-max(tmp)-max(d2)
    print(int(min(result1,result2)))
else:
#print(d1[:5])
#print(d2[:5])
    tmp1=n/2-max(d1)
    tmp2=n/2-max(d2)
    print(int(tmp1+tmp2))
import fractions

input()
A=set([int(i) for i in input().split()])

ans=1
if len(A)<=2:
    ans=max(A)
else:  
    for a in A:
        A2=A-{a}
        ans=max(ans,fractions.gcd(*A2))

print(ans)

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

import fractions
from functools import reduce

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

def mygcd(a,b):
    if a==0:
        return b
    elif b==0:
        return a
    else:
        return fractions.gcd(a,b)

L=[0]*N
for i in range(1,N):
    L[i]=mygcd(L[i-1],A[i-1])

R=[0]*N
for i in range(N-2,-1,-1):
    R[i]=mygcd(R[i+1],A[i+1])

ans=1
for i in range(N):
    c=mygcd(L[i],R[i])
    ans=max(ans,c)

print(ans)
def main():
	n,m = map(int,input().split())
	h = list(map(int,input().split()))
	l = [list(map(int, input().split())) for i in range(m)]

	ans = int(n)
	del_list = set()
	for i in range(m):
		print("i is {}".format(i), "and then del_list is {}".format(del_list))
		if h[l[i][0]-1] > h[l[i][1]-1] and l[i][1] not in del_list:
			ans -= 1
			del_list.add(l[i][1])
		elif h[l[i][0]-1] < h[l[i][1]-1] and l[i][0] not in del_list:
			ans -= 1
			del_list.add(l[i][0])
		elif h[l[i][0]-1] == h[l[i][1]-1]:
			if l[i][0] not in del_list and l[i][1] not in del_list:
				ans -= 2
				del_list.add(l[i][0])
				del_list.add(l[i][1])
			elif l[i][0] not in del_list:
				ans -= 1
				del_list.add(l[i][0])
			elif l[i][1] not in del_list:
				ans -= 1
				del_list.add(l[i][1])
			else:
				ans += 0
		else:
			ans += 0

	print(ans)





if __name__ == '__main__':
	main()

### FIXED CODE ###

def main():
	n,m = map(int,input().split())
	h = list(map(int,input().split()))
	l = [list(map(int, input().split())) for i in range(m)]

	ans = int(n)
	del_list = set()
	for i in range(m):
		if h[l[i][0]-1] > h[l[i][1]-1] and l[i][1] not in del_list:
			ans -= 1
			del_list.add(l[i][1])
		elif h[l[i][0]-1] < h[l[i][1]-1] and l[i][0] not in del_list:
			ans -= 1
			del_list.add(l[i][0])
		elif h[l[i][0]-1] == h[l[i][1]-1]:
			if l[i][0] not in del_list and l[i][1] not in del_list:
				ans -= 2
				del_list.add(l[i][0])
				del_list.add(l[i][1])
			elif l[i][0] not in del_list:
				ans -= 1
				del_list.add(l[i][0])
			elif l[i][1] not in del_list:
				ans -= 1
				del_list.add(l[i][1])
			else:
				ans += 0
		else:
			ans += 0

	print(ans)





if __name__ == '__main__':
	main()
#H = int(input())
H,N = list(map(int,input().split()))
#H = sorted(list(map(int,input().split())))
AB = [list(map(int,input().split())) for i in range(N)]
dp = [[float('inf') for i in range(H)] for j in range(N)]
for i in range(N):
    dp[i][0] = 0
for i in range(N):
    for j in range(H):
        if j-AB[i][0] >= 0:
            dp[i][j] = min(dp[i][j],dp[i][j-AB[i][0]]+AB[i][1])
for i in range(1,N):
    for j in range(H):
        if j-AB[i-1][0] >= 0:
            dp[i][j] = min(dp[i-1][j],dp[i][j],dp[i-1][j-AB[i-1][0]]+AB[i-1][1])
        if j-AB[i][0] >= 0:
            dp[i][j] = min(dp[i-1][j],dp[i][j],dp[i][j-AB[i][0]]+AB[i][1])

ans = float('inf')
for i in range(N):
    for j in range(H-AB[i][0],H):
        if dp[i][j] != float('inf'):
            ans = min(ans,dp[i][j]+AB[i][1])
print(ans)

### FIXED CODE ###

#H = int(input())
H,N = list(map(int,input().split()))
#H = sorted(list(map(int,input().split())))
AB = sorted([list(map(int,input().split())) for i in range(N)])
dp = [float('inf') for i in range(H)]
dp[0] = 0
for i in range(N):
    for j in range(H):
        if j-AB[i][0] >= 0:
            dp[j] = min(dp[j],dp[j-AB[i][0]]+AB[i][1])
ans = float('inf')
for i in range(N):
    for j in range(max(0,H-AB[i][0]),H):
        if dp[j] != float('inf') and j+AB[i][0] >= H:
            ans = min(ans,dp[j]+AB[i][1])
print(ans)
N = input()
ans = 1
while a < N:
  ans *= 2
print(ans)

### FIXED CODE ###

a = 0
ans = 0
N = int(input())
for i in range(1, N+1) :
  p = 0
  x = i
  while x % 2 == 0 :
    x //= 2
    p += 1
  if a <= p :
    a = p
    ans = i
print(ans)
print('Yes' if len(set(input()[:3]))==1 or len(set(input()[1:]))==1 else 'No')

### FIXED CODE ###

a = input()
if len(set(a[:3]))==1 or len(set(a[1:]))==1:
  print('Yes')
else:
  print('No')
S = list(int(input()))

if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  print("Bad")
else:
  print("Good")


### FIXED CODE ###

S = list(input())
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  print("Bad")
else:
  print("Good")
N, X, M = map(int, input().split())
check = [0]*(M+1)
check[X] += 1
A = X
last_count = 0
while True:
    A = (A**2)%M
    if check[A] != 0:
        last_count = sum(check)
        target_value = A
        break
    check[A] += 1
A2 = X
first_count = 0
while True:
    first_count += 1
    A2 = (A2**2)%M
    if A2 == target_value:
        break

roop_count = last_count-first_count
A3 = target_value
mass = A3
for i in range(roop_count-1):
    A3 = (A3**2)%M
    mass += A3


ans = X
A = X
for i in range(min(N,first_count)-1):
    A = (A**2)%M
    ans += A
if N > first_count:
    ans += ((N-first_count)//roop_count)*mass
    A4 = target_value
    if (N-first_count)%roop_count >= 1:
        ans += A4
    for i in range(((N-first_count)%roop_count)-1):
        A4 = (A4**2)%M
        ans += A4

print(ans)

### FIXED CODE ###

N, X, M = map(int, input().split())
if X <= 1:
    print(X*N)
    exit()
check = [0]*(M+1)
check[X] += 1
A = X
last_count = 0
while True:
    A = (A**2)%M
    if check[A] != 0:
        last_count = sum(check)
        target_value = A
        break
    check[A] += 1
A2 = X
first_count = 0
while A2 != target_value:
    first_count += 1
    A2 = (A2**2)%M

roop_count = last_count-first_count

A3 = target_value
mass = A3
for i in range(roop_count-1):
    A3 = (A3**2)%M
    mass += A3
if roop_count == 0:
    print(N*X)
    exit()
if first_count != 0:
    ans = X
    A = X
    for i in range(min(N,first_count)-1):
        A = (A**2)%M
        ans += A
else:
    ans = 0
if N > first_count:
    ans += ((N-first_count)//roop_count)*mass
    A4 = target_value
    if (N-first_count)%roop_count >= 1:
        ans += A4
    for i in range(((N-first_count)%roop_count)-1):
        A4 = (A4**2)%M
        ans += A4
print(ans)
n, q = map(int, input().split())
ab = [map(int, input().split()) for _ in range(n-1)]
px = [map(int, input().split()) for _ in range(q)]

cnt = [0 for _ in range(n)]
for p, x in px:
    cnt[p-1] += x

edge = [[] for _ in range(n)]
for a, b in ab:
    edge[a-1].append(b)
    edge[b-1].append(a)


def dfs(now, bef):
    for nxt in edge[now-1]:
        if nxt != bef:
            cnt[nxt-1] += cnt[now-1]
            dfs(nxt, now)


dfs(1, 0)
print(*cnt)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)


def input(): return sys.stdin.readline()


N, Q = map(int, input().split())
ab = [[] for _ in range(N)]
for i in range(N-1):
  a, b = map(int, input().split())
  ab[a-1].append(b)
  ab[b-1].append(a)

P = [0 for _ in range(N)]
for i in range(Q):
  p, x = map(int, input().split())
  P[p-1] += x


def dfs(p, par):
  for i in ab[p-1]:
    if i != par:
      P[i-1] += P[p-1]
      dfs(i, p)


dfs(1, -12345)
print(" ".join(map(str, P)))
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

import math

a, b = map(int, input().split())
c=math.gcd(a, b)
d=prime_factorize(c)
count=0
before=0
for i in range(len(d)):
    if d[i]!=before:
        count+=1
    before=d[i]

print(count+1)

### FIXED CODE ###

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

import math

a, b = map(int, input().split())
c=gcd(a, b)
d=prime_factorize(c)
count=0
before=0
for i in range(len(d)):
    if d[i]!=before:
        count+=1
    before=d[i]

print(count+1)
while True:
	n,x = map(int,raw_input().split())
	if n==x==0:
		break
	count=0
	for i in xrange(1,n):
		for j in xrange(i,n)
			for k in xrange(j,n):
				if i+j+k==x:
					count+=1
	print count

### FIXED CODE ###

while True:
	n,x = map(int,raw_input().split())
	if n==x==0:
		break
	ans=0
	for i in xrange(1,n+1):
		for j in xrange(i+1,n+1):
			for k in xrange(j+1,n+1):
				if i+j+k==x:
					ans+=1
	print ans
"""
author : halo2halo
date : 25,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline().rstrip())
T, a = map(int, readline().rstrip().split())
lis = list(map(int, readline().rstrip().split()))
cnt = 100000
for num, area in enumerate(lis):
    res = abs(T * 1000 - area * 6 - a * 1000)
    if res <= cnt:
        cnt = res
        ans = num


print(ans+1)


### FIXED CODE ###

"""
author : halo2halo
date : 16, Jan, 2020
"""

import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
T, A = map(int, readline().split())
H = np.array([int(x) for x in readline().split()])
# print(H)
H = 1000 * T - H * 6
# print(H)
H = abs(H - A*1000)
# print(H)

ans = 0
tmp = 10000000
for num, i in enumerate(H):
    if tmp >= i:
        ans = num
        tmp = i
print(ans + 1)
while 1:
    m=input().split()
    h=int(m[0])
    w=int(m[1])
    if a==0 & b==0:
      break
    for i in range(h):
       for j in range(w):
         print("#"*w)
      print()
    print()
    
    


### FIXED CODE ###

while True:
    v=input().split()
    a=int(v[0])
    b=int(v[1])
    if a==0 and b==0:
       break
    for i in range (a):
        print('#'*b)
    print()