Harryxun/stf_run huggingface dataset:
def d_snuke_numbers(K):
    candidate = []
    for k in range(16):
        for l in range(1, 10):
            candidate.append(str(l)+str(9)*k)
    ans = []
    for k in range(K):
        ans.append(candidate[k])
    ans = '\n'.join(ans)
    return ans

K = int(input())
print(d_snuke_numbers(K))

### FIXED CODE ###

def d_snuke_numbers(K):
    import math

    def ns(n):  # n/S(n)の計算
        return n / sum(map(int, list(str(n))))

    def f(n):  # n<=xの中で ns(x) を最小にするような最小の値xを求める
        digit = len(str(n))
        # n自身も候補の1つである
        min_ns = ns(n)
        ret = n
        for d in range(digit + 1):
            x = (10**(d+1)) * math.floor(n / (10**(d+1)) + 1) - 1
            s = ns(x)
            if min_ns > s:
                min_ns = s
                ret = x
        return ret

    n = 0
    candidate = []
    for _ in range(K):
        n = f(n + 1)
        candidate.append(n)
    ans = '\n'.join(map(str, candidate))
    return ans

K = int(input())
print(d_snuke_numbers(K))
import math
a,b,c = map(int,input().split())

x = math.sqrt(a)
y = math.sqrt(b)
z = math.sqrt(c)

x += y

if x < z:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

arr = [1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51]
k=int(input())

k -= 1
print(arr[k])
INF = float("inf") #const
MOD = 10**9+7 #const
MAX = 510000 #const

def repeat(n,p):
    if p == 0:
        return 1
    if p%2==0:
        t = repeat(n,p//2)
        return t * t % MOD
    return n * repeat(n,p-1) % MOD


def com(n,r):
    if n < r or n < 0:
        return 0
    if n == 0 and r == 0:
        return 1
    fact = [0] * (n+1)
    fact[0] = 1
    for i in range(n):
        fact[i+1] = fact[i] * (i+1) % MOD #階乗計算
    f_inv = repeat(fact[r],MOD-2)
    f = repeat(fact[n-r],MOD-2)

    return fact[n] * f_inv * f % MOD


def main():
    x,y = map(int,input().split())
    if (x+y)%3 != 0:
        print(0)
        return
    n = (2*y - x)//3
    m = (2*x - y)//3
    print(com(n+m,n))


if __name__ == "__main__":
    main()


### FIXED CODE ###

INF = float("inf") #const
MOD = 10**9+7 #const
MAX = 510000 #const

def repeat(n,p):
    if p == 0:
        return 1
    if p%2==0:
        t = repeat(n,p//2)
        return t * t % MOD
    return n * repeat(n,p-1) % MOD


def com(n,r):
    if n < r or n < 0:
        return 0
    if n == 0 and r == 0:
        return 1
    fact = [0] * (10**6+1)
    fact[0] = 1
    for i in range(n):
        fact[i+1] = fact[i] * (i+1) % MOD #階乗計算
    f_inv = repeat(fact[r],MOD-2)
    f = repeat(fact[n-r],MOD-2)
    return fact[n] * f_inv * f % MOD


def main():
    x,y = map(int,input().split())
    if (x+y)%3 != 0:
        print(0)
        return
    n = (2*y - x)//3
    m = (2*x - y)//3
    print(com(n+m,n))


if __name__ == "__main__":
    main()
n, a, b, c, d = list(map(int, input().split()))
s = input()
if d > c:
    for i in range(a, d-1):
        if (s[i-1] == "#") & (s[i] == "#"):
            print("No")
            break
    else:
        print("Yes")
else:
    for i in range(a, d):
        if (s[i-1] == "#") & (s[i] == "#"):
            print("No")
            break
    else:
        for j in range(b-1, min(c, n-2)):
            if (s[b-2] == ".") & (s[b] == "."):
                print("Yes")
                break
            if (s[c-2] == ".") & (s[c] == "."):
                print("Yes")
                break
          
            if (s[j-1] == ".") & (s[j] == ".") & (s[j+1] == "."):
                print("Yes")
                break
        else:
            print("No")

### FIXED CODE ###

n, a, b, c, d = list(map(int, input().split()))
s = input()
if d > c:
    for i in range(a, d-1):
        if (s[i-1] == "#") & (s[i] == "#"):
            print("No")
            break
    else:
        print("Yes")
else:
    for i in range(a, d):
        if (s[i-1] == "#") & (s[i] == "#"):
            print("No")
            break
    else:
        for j in range(b-1, d):
            if (s[j-1] == ".") & (s[j] == ".") & (s[j+1] == "."):
                print("Yes")
                break
        else:
            print("No")
A, B = [int(x)-1 for x in sys.stdin.readline().split()]

ans = 0
if B == 1:
    print(0)
else:
    while True:
        ans += 1
        if 1 + ans * A - ans >= B:
            print(ans)
            exit()

### FIXED CODE ###

import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools, os, pdb
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def perr(s): return print(s, file=sys.stderr)

A, B = LI()

ans = 0
current = 1
while current < B:
    current -= 1
    current += A
    ans += 1
print(ans)
import math
x=int(input())
x=180-x

ans=360//math.gcd(360,x)

if(ans>=8):
    print(1//0)
else:
    print(ans)

#for i in range(1,180):
#    if(360//math.gcd(360,i)<10):
#        print(i,360//math.gcd(360,i))
#    if(i==x):
#        print("問題の箇所",x,ans)

### FIXED CODE ###

import math
x=int(input())
x=180-x

ans=360//math.gcd(360,x)

ex=[60,120]

if(x in ex):
    x=180-x
    ans=360//math.gcd(360,x)
print(ans)
#for i in range(1,180):
#    if(360//math.gcd(360,i)==6):
#        print(i,360//math.gcd(360,i))
#    if(i==x):
        #print("問題の箇所",x,ans)
N, K, S = map(int, input().split())
A = [10**10]*N

for i in range(K+1):
    if i % 2 == 0:
        A[i] = S - 1
    else:
        A[i] = 1
A = [str(i) for i in A]
print(' '.join(A))


### FIXED CODE ###

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

A = []
A += [S]*K
if S == pow(10, 9):
    A += [1]*(N-K)
else:
    A += [S+1]*(N-K)


A = [str(i) for i in A]
print(' '.join(A))
N, X = map(int, input().split())
LIST = list(map(int, input().split()))
 
d = 0
i = 0
 
while d <= X:
    d = d + LIST[i]
    i = i + 1
    
print(i)

### FIXED CODE ###

N, X = map(int, input().split())
LIST = list(map(int,input().split()))

RES = []
ichi = 0
RES.append(ichi)
for i in LIST:
    ichi = ichi + i
    RES.append(ichi)

cnt = 0
for i in RES:
    if i <= X:
        cnt = cnt + 1

print(cnt)
from math import gcd
n, X = map(int, input().split())
x = list(map(int, input().split()))

ans = abs(x[0]-X)
for xi in x:
    ans = gcd(ans, abs(xi-X))
    
print(ans)

### FIXED CODE ###

# from math import gcd # ダメ
def gcd(a,b): 
    while b!=0:
        a,b=b,a%b
    return a

n, X = map(int, input().split())
x = list(map(int, input().split()))

ans = abs(x[0]-X)
for xi in x:
    ans = gcd(ans, abs(xi-X))
    
print(ans)
n. y = map(int, input().split())
ans = 0
for i in range(n+1):
    for j in range(n+1-i):
        for k in range(n+1-i-j):
            if y == 10000*i + 5000*j + 1000*k:
                print(i j k)
                ans += 1
if ans == 0:
    print("-1 -1 -1")

### FIXED CODE ###

n, y = map(int, input().split())
ans = 0
for i in range(n+1):
    for j in range(n+1-i):
        if y == 10000*i + 5000*j + 1000*(n-i-j):
            print(i, j, n-i-j)
            ans += 1
            exit()
if ans == 0:
    print("-1 -1 -1")
N = int(input())
import math
n = math.floor(N**0.5)
s = N + 1
for i in range(1,n):
    if N % i == 0:
        a = i + (N/i)
        if s >= a:
            s = a
print(int(a-2))

### FIXED CODE ###

N = int(input())
import math
n = math.floor(N**0.5)
s = N + 1
for i in range(1,n + 1):
    if N % i == 0:
        a = i + (N/i)
        s = a
print(int(s-2))
N, A ,B = map(int, input().split())
res = 0

for n in range(N+1):
  if A <= int(s) <= B for s in str(n):
    res += n
    
print(res)

### FIXED CODE ###

N, A, B = map(int, input().split())
res = 0
for i in range(N+1):
    if A <= sum([int(s) for s in str(i)]) <= B:
        res += i
print(res)
import math
a=int(input())
A=list(map(int,input().split()))
x=0
for i in range(a):
    x=math.gcd(x,A[i])
print(x)

### FIXED CODE ###

import fractions
a=int(input())
A=list(map(int,input().split()))
x=0
for i in range(a):
    x=fractions.gcd(x,A[i])
print(x)
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))

lin = [0 for i in range(10**5)]
n = int(input())
a = list(map(int, input().split()))
ans = 0
for x in a:
    ans += x
    lin[x] += 1
q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    ans += (c - b)*lin[b]
    print(ans)
    lin[c] += lin[b]
    lin[b] = 0

### FIXED CODE ###

import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))

lin = [0 for i in range(10**5+1)]
n = int(input())
a = list(map(int, input().split()))
ans = 0
for x in a:
    ans += x
    lin[x] += 1
q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    ans += (c - b)*lin[b]
    lin[c] += lin[b]
    lin[b] = 0
    print(ans)
a, b = [int(i) for i in input(),split()]


d = a // b
r = a % b
f = a / b


print("{0} {1} {2:.5f}".format(d, r, f))

### FIXED CODE ###

import sys
        
while True:
    (x, y) = [int(i) for i in sys.stdin.readline().split(' ')]
        
    if x == 0 and y == 0:
        break
        
    if x > y:
        z = x
        x = y
        y = z
        
    print(x, y)
n,k = map(int,input().split())
alist = list(map(int,input().split()))
memo = []
p = 1
vis = ['.']*n
while vis[p-1] == '.':
    memo.append(p)
    vis[p-1] = 'v'
    p = alist[p-1]

loop = memo.index(p)
if k < len(alist):
    print(memo[k])
else:
    print(memo[loop+(k-loop)%(len(memo)-loop)])


### FIXED CODE ###

n,k = map(int,input().split())
alist = list(map(int,input().split()))
memo = []
p = 1
vis = ['.']*n
while vis[p-1] == '.':
    memo.append(p)
    vis[p-1] = 'v'
    p = alist[p-1]

loop = memo.index(p)
if k < len(memo):
    print(memo[k])
else:
    print(memo[loop+(k-loop)%(len(memo)-loop)])
n, a, b, ans = map(int, raw_input().split()), 0
for _ in range(n + 1):
    if a <= sum(map(int, list(str(i)))) <= b:
        ans += i
print ans

### FIXED CODE ###

n, a, b = map(int, raw_input().split())
ans = 0
for _ in range(n + 1):
    if a <= sum(map(int, list(str(_)))) <= b:
        ans += _
print ans
N = int(input())
l = list(map(int,input().split()))
count = 1
max = l[0]
for i in range(N):
  if l[i] >= max:
   	count += 1
    max = l[i]
    
print(count)

### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
max = l[0]
count = 0
for i in range(n):
  if l[i] >= max:
    count += 1
    max = l[i]
    
print(count)
def solve(items, n, w):
    f = [[0] * (w + 1) for _ in range(n + 1)]
    for i in range(1, n + 1):
        wi, vi = items[i-1]
        for j in range(w + 1):
            f[i][j] = f[i-1][j]
            if j >= wi:
                f[i][j] = max(f[i][j], f[i-1][j-wi] + vi)
    return f[n][w]


def main():
    inp = lambda: [int(x) for x in input().split()]
    n, w = inp()
    items = [inp() for _ in range(n)]
    print(solve(items, n, w))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def solve(items, n, W):
    V = sum([v for _, v in items])
    dp = [float('inf')] * (V + 1)
    dp[0] = 0

    for w, v in items:
        for i in range(V, v-1, -1):
            dp[i] = min(dp[i], dp[i-v] + w)
    
    for i in range(V, -1, -1):
        if dp[i] <= W:
            return i

    return 0


def main():
    inp = lambda: [int(x) for x in input().split()]
    n, w = inp()
    items = [inp() for _ in range(n)]
    print(solve(items, n, w))


if __name__ == '__main__':
    main()
N=int(input())
c=list(input())
c1=c[::-1]
ans=0

w_index=[i for i, x in enumerate(c) if x=="W"]
r_index=[i for i, x in enumerate(c1) if x=="R"]

for i in range(len(r_index)):
    r_index[i]=N-1-r_index[i]


if "R" in c and "W" in c:
    while True:
        w=int(w_index[ans])
        r=int(r_index[ans])
        if w-r==1:
             break
        ans+=1

print(ans)

### FIXED CODE ###

N=int(input())
c=list(input())
c1=c[::-1]
ans=0

w_index=[i for i, x in enumerate(c) if x=="W"]
r_index=[i for i, x in enumerate(c1) if x=="R"]

for i in range(len(r_index)):
    r_index[i]=N-1-r_index[i]


if "R" in c and "W" in c:
    for i in range(min(len(r_index),len(w_index))):
        w=w_index[ans]
        r=r_index[ans]
        if w-r>0:
             break
        ans+=1

print(ans)
S = str(input())
T = str(input())

count = 0
for i in range(i, len(S)):
  if S[i] != T[i]:
    count+=1
    
print(count)

### FIXED CODE ###

S = str(input())
T = str(input())
 
count = 0
for i in range(0, len(S)):
  if S[i] != T[i]:
    count+=1
    
print(count)
a, b, c = map(int, intput().split())
array = []
for i in range(c):
	array.append(input())

point = [b] * a

for i in range(c):
	for j in range(a):
		if j+1 != int(array[c]):
			point[j] = point[j] -1
            
for i in range(a):
	if point[i] > 0:
		print('Yes')
	else:
		print('No')
          

### FIXED CODE ###

a, b, c = map(int, input().split())
array = []
for i in range(c):
	array.append(int(input()))

point = [b] * a
 
for i in range(c):
	point[array[i]-1] = point[array[i]-1] + 1
            
for i in range(len(point)):
	if (point[i]-c) > 0 :
		print('Yes')
	else:
		print('No')
a=1
for i in[*open(0)][1].split():a*=int(i);a=[-1,a][-1<a<1e18]
print(a)1

### FIXED CODE ###

input()
a=1
d=1000000000000000000
for i in input().split():
  a=min(a*int(i), d+1)
print([a,-1][a>d])
n, m = map(int, input().split())
ac = [0 for _ in range(n)]
pen = [0 for _ in range(n)]

for _ in range(m):
  p, s = input().split()
  p = int(p) - 1
  if s == 'WA':
    if ac[p] == 0:
      pen[p] += 1
  else:
    ac[p] = 1

for p in range(m):
  if ac[p] == 0:
    pen[p] = 0
print(str(sum(ac)) + ' ' + str(sum(pen)))

### FIXED CODE ###

n, m = map(int, input().split())
ac = [0 for _ in range(n)]
pen = [0 for _ in range(n)]

for _ in range(m):
  p, s = input().split()
  p = int(p) - 1
  if s == 'WA':
    if ac[p] == 0:
      pen[p] += 1
  else:
    ac[p] = 1

for p in range(n):
  if ac[p] == 0:
    pen[p] = 0
print(str(sum(ac)) + ' ' + str(sum(pen)))
import itertools

N= int(input())
P=list(map(int, input().split()))
Q=list(map(int, input().split()))
p = list(itertools.permutations(range(1, N + 1)))
a = p.index(P)
b = p.index(Q)
print(abs(a - b))

### FIXED CODE ###

import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
U = list(itertools.permutations(range(1, N+1)))
a = U.index(P)
b = U.index(Q)
print(abs(a-b))
N = input()

try:
	if 0 <= int(N) <= 999:
      if N[-1] is 2 or 4 or 5 or 7 or 9:
        print('hon')
      elif N[-1] is 0 or 1 or 6 or 8:
        print('pon')
      elif N[-1] is 3:
        print('bon')
except ValueError:
  exit()

### FIXED CODE ###

N = input()

try:
  if 0 <= int(N) <= 999:
    if N[-1] == '2' or N[-1] == '4' or N[-1] == '5' or N[-1] == '7' or N[-1] == '9':
      print('hon')
    elif N[-1] == '0' or N[-1] =='1' or N[-1] =='6' or N[-1] =='8':
      print('pon')
    elif N[-1] == '3':
      print('bon')
except ValueError:
  exit()
from itertools import combinations
INFTY = 10**4
epsilon = 1e-12
def dist(x,y):
    return ((x[0]-y[0])**2+(x[1]-y[1])**2)**0.5
def cross(x,y):
    return x[0]*y[1]-x[1]*y[0]
N = int(input())
X = [list(map(int,input().split())) for _ in range(N)]
rmin = INFTY
for z in combinations(range(N),3):
    i,j,k = z
    x0,y0 = X[i]
    x1,y1 = X[j]
    x2,y2 = X[k]
    a = cross([x1-x0,y1-y0],[x2-x0,y2-y0])
    if a==0:continue
    s = ((x1-x0)**2+(y1-y0)**2-(x0+x1-2*x2)**2-(y0+y1-2*y2)**2)/8
    s = s/(x0*y1-x1*y0-x2*y1+x2*y0-x0*y2+x1*y2)
    x = (x0+x1)/2+s*(y1-y0)
    y = (y0+y1)/2+s*(x0-x1)
    r = dist([x,y],[x0,y0])
    flag = 0
    for m in range(N):
        if dist([x,y],X[m])<=r:
            continue
        else:
            flag = 1
            break
    if flag==0:
        rmin = min(rmin,r)
if rmin==INFTY:
    rmin = 0
    for i in range(N-1):
        for j in range(i+1,N):
            rmin = max(rmin,dist(X[i],X[j]))
    print(rmin/2)
else:
    print(rmin

### FIXED CODE ###

from itertools import combinations
INFTY = 10**4
epsilon = 1e-10
def dist(x,y):
    return ((x[0]-y[0])**2+(x[1]-y[1])**2)**0.5
def cross(x,y):
    return x[0]*y[1]-x[1]*y[0]
def dot(x,y):
    return x[0]*y[0]+x[1]*y[1]
N = int(input())
X = [list(map(int,input().split())) for _ in range(N)]
rmin = INFTY
for z in combinations(range(N),3):
    i,j,k = z
    x0,y0 = X[i]
    x1,y1 = X[j]
    x2,y2 = X[k]
    r = max(dist(X[i],X[j]),dist(X[j],X[k]),dist(X[k],X[i]))/2
    if r==dist(X[i],X[j])/2:
        x = (x0+x1)/2
        y = (y0+y1)/2
    elif r==dist(X[j],X[k])/2:
        x = (x1+x2)/2
        y = (y1+y2)/2
    else:
        x = (x2+x0)/2
        y = (y2+y0)/2
    a = cross([x1-x0,y1-y0],[x2-x0,y2-y0])
    if a==0:continue
    if dot([x1-x0,y1-y0],[x2-x0,y2-y0])>=0 and dot([x0-x1,y0-y1],[x2-x1,y2-y1])>=0 and dot([x1-x2,y1-y2],[x0-x2,y0-y2])>=0:
        s = ((x1-x0)**2+(y1-y0)**2-(x0+x1-2*x2)**2-(y0+y1-2*y2)**2)/8
        s = s/(x0*y1-x1*y0-x2*y1+x2*y0-x0*y2+x1*y2)
        x = (x0+x1)/2+s*(y1-y0)
        y = (y0+y1)/2+s*(x0-x1)
        r = dist([x,y],[x0,y0])
    flag = 0
    for i in range(N):
        if dist([x,y],X[i])<=r+epsilon:
            continue
        else:
            flag = 1
            break
    if flag==0:
        rmin = min(rmin,r)
if rmin==INFTY:
    rmin = 0
    for i in range(N-1):
        for j in range(i+1,N):
            rmin = max(rmin,dist(X[i],X[j]))
    print(rmin/2)
else:
    print(rmin)
s,t = map(int,input().split())
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1

### FIXED CODE ###

s,t = input().split()
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1
print('{0} {1}'.format(a,b))
N = int(input())

A = [int(x) for x in input().split()]
A = sorted(A)

if A[0] == A[1]:
    cnt = 0
else:
    cnt = 1
    
for i in range(1,N):
    flag = True
    for j in range(i):
        if A[i]%A[j] == 0:
            flag = False
            break

    
    if i != N-1:
        if A[i] == A[i+1]:
            flag = False
    
    if flag == True:
        cnt += 1
print(cnt)

### FIXED CODE ###

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

l=[0]*(10**6+1)
ans=0
#print(l)
for i in a:
    if l[i]==0:
        for j in range(i,10**6+1,i):
            l[j] += 1
    else:
        l[i] += 1
#print(l)
for i in a:
    if l[i]==1:
        ans+=1

print(ans)
instr = map(int, input())
a = int(instr[0])
b = int(instr[2])
op = instr[1]

if op == "+":
  print (a+b)
else:
  print(a-b)


### FIXED CODE ###

instr = list(map(str, input().split()))
a = int(instr[0])
b = int(instr[2])
op = instr[1] 
if op == "+":
  print (a+b)
else:
  print(a-b)
import numpy as np
words = lambda t : list(map(t, input().split()))



h,w = words(int)
wq = [0] * w

grid = []
for i in range(h):
    grid.append(list(input()))

ans = 0
for i in range(h):
    j = 0
    while j < w:
        #print(i,j, grid[i][j])
        if grid[i][j] == '#':
            wq[j] = 0
            j+=1
            continue
        k = 0
        while j+k < w:
            if grid[i][j+k] == '.':
                k += 1
            else:
                break
        #print(i,j,k)
        if k + h > ans:
            for x in range(j,j+k):
                vplus = 0
                if not wq[x] == 0:
                    vplus = wq[x]
                else:
                    for vi in range(i-1,-1,-1):
                        if grid[vi][x] == '#':
                            break
                        else:
                            vplus += 1
                    for vi in range(i+1,h):
                        if grid[vi][x] == '#':
                            break
                        else:
                            vplus += 1
                ans = max(ans, vplus+k)
                wq[x] = vplus
        j += k
print(ans)


### FIXED CODE ###

#import numpy as np
words = lambda t : list(map(t, input().split()))



h,w = words(int)
wq = [0] * w

grid = []
for i in range(h):
    grid.append(list(input()))

ans = 0
for i in range(h):
    j = 0
    while j < w:
        #print(i,j, grid[i][j])
        if grid[i][j] == '#':
            wq[j] = 0
            j+=1
            continue
        k = 0
        while j+k < w:
            if grid[i][j+k] == '.':
                k += 1
            else:
                break
        #print(i,j,k)
        if k + h > ans:
            for x in range(j,j+k):
                vplus = 0
                if not wq[x] == 0:
                    vplus = wq[x]
                else:
                    for vi in range(i-1,-1,-1):
                        if grid[vi][x] == '#':
                            break
                        else:
                            vplus += 1
                    for vi in range(i+1,h):
                        if grid[vi][x] == '#':
                            break
                        else:
                            vplus += 1
                ans = max(ans, vplus+k)
                wq[x] = vplus
        j += k
print(ans)
INF=float('inf')
N=int(input())
A=list(map(int,input().split()))
dp=[[-INF for i in range(20)] for i in range(N+1)]
dp[0][0]=1000#dp[i][j]=i日目に株をj個持っているときの最大所持金

for i in range(N):
    for j in range(20):
        if dp[i][j]==-INF:
            continue
        dp[i+1][j]=dp[i][j]
        for x in range(1,j+1):
            if j-x>=0:
                dp[i+1][j-x]=max(dp[i][j]+A[i]*x,dp[i+1][j-x])
            else:
                break
        for x in range(1,1000000):
            if dp[i][j]-A[i]*x>=0:
                dp[i+1][j+x]=max(dp[i][j]-A[i]*x,dp[i+1][j+x])
            else:
                break
print(max(dp[N]))

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
money=1000;kabu=0
i=0
while(i<N):
    j=i
    money,kabu=money-(money//A[i])*A[i],kabu+(money//A[i])
    while(j<N-1 and A[j]<=A[j+1]):
        j+=1
    money=money+kabu*A[j]
    kabu=0
    i=j+1
print(money)
N = int(input)
ans = (1/2) * (N-1) * (N)
print(int(ans))


### FIXED CODE ###

N = int(input())
ans = (N-1) * (N) //2
print(int(ans))
N i = map(int, input().split())
print(N-i+1)

### FIXED CODE ###

N,i = map(int, input().split())
print(N-i+1)
import sys

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

for i in range(len(s)):    
    if s == t:
        print("Yes")
        sys.exit(1)

    tmp = s.pop(len(s)-1)
    s.insert(0, tmp)

if s == t:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

import sys

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

for i in range(len(s)):    
    if s == t:
        break

    tmp = s.pop(len(s)-1)
    s.insert(0, tmp)

if s == t:
    print("Yes")
else:
    print("No")
N,M = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
import heapq
AB.sort()
heap = []
heapq.heapify(heap)
ans = 0
i = 0
day = 1
while i < N and day <= M:
    while AB[i][0] <= day:
        heapq.heappush(heap,-AB[i][1])
        i += 1
    
    ans -= heapq.heappush(heap)

print(ans)

### FIXED CODE ###


N,M = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
import heapq
AB.sort()
heap = []
heapq.heapify(heap)
ans = 0
i = 0
day = 1
while day <= M:
    while i < N and AB[i][0] <= day:
        heapq.heappush(heap,-AB[i][1])
        i += 1
    day += 1
    if not(heap):continue
    ans -= heapq.heappop(heap)

print(ans)