Harryxun/stf_run huggingface dataset:
a,b,c,d,e,f=map(lambda x: int(x), input().split())

dic_w={}
i=0
while True:
    if (a*i*100)>f:
        break
    j=0
    while True:
        w=(a*i+b*j)*100
        if w>f:
            break
        else:
            dic_w[w]=dic_w.get(w,0)+1
        j+=1
    i+=1
list_w=list(dic_w.keys())
list_w.sort()

dic_s={}
max_s=int(e*f/(100+e))
i=0
while True:
    if c*i>max_s:
        break
    j=0
    while True:
        s=c*i+d*j
        if s>max_s:
            break
        else:
            dic_s[s]=dic_s.get(s,0)+1
        j+=1
    i+=1
list_s=list(dic_s.keys())
list_s.sort()

max_per=0
flag=False
ans_w=0
ans_s=0
for w in list_w:
    if flag==True:
        break
    for s in list_s:
        if s/(w/100)==e and s+w<=f:
            ans_w=w
            ans_s=s
            flag=True
            break
        if s/(w/100)>e:
            break
        if s/(w/100)>max_per and s+w<=f:
            ans_w=w
            ans_s=s
print('{} {}'.format(ans_w+ans_s,ans_s))

### FIXED CODE ###

a,b,c,d,e,f=map(lambda x: int(x), input().split())

dic_w={}
i=0
while True:
    if (a*i*100)>f:
        break
    j=0
    while True:
        w=(a*i+b*j)*100
        if w==0:
            j+=1
            continue
        if w>f:
            break
        else:
            dic_w[w]=dic_w.get(w,0)+1
        j+=1
    i+=1
list_w=list(dic_w.keys())
list_w.sort()

dic_s={}
max_s=int(e*f/(100+e)+1)
i=0
while True:
    if c*i>max_s:
        break
    j=0
    while True:
        s=c*i+d*j
        if s>max_s:
            break
        else:
            dic_s[s]=dic_s.get(s,0)+1
        j+=1
    i+=1
list_s=list(dic_s.keys())
list_s.sort()

max_per=0
flag=False
ans_w=0
ans_s=0
for w in list_w:
    if flag==True:
        break
    for s in list_s:
        if s/(w/100)==e and s+w<=f:
            ans_w=w
            ans_s=s
            flag=True
            break
        if s/(w/100)>e:
            break
        if 100*s/(s+w)>=max_per and s+w<=f:
            ans_w=w
            ans_s=s
            max_per=100*s/(s+w)
print('{} {}'.format(ans_w+ans_s,ans_s))
N=map(int, input())
list=list(map(str, input().split()))
answer={}
for i in range(1, N+1):
  m=0
  for j in range(0, len(list)):
  	if list[j] is str(i):
      m=m+1
    else:
      m=m+0
  answer.append(m)
a_s='\n'.join(answer)
print(a_s)

### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
ans=[0]*N
for a in A:
  ans[a-1]+=1
for n in ans:
  print(n)
N=int(input())
a=list(map(int,input().split()))
sum_=1
for i in range(N):
    while sum_ < 10**18:
        sum_ *= a[i]
        if sum_ > 10**18:
            sum_ =-1
        break
        if sum_ = 0:
        break
print(sum_)

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
sum_=1
if 0 in a:
    print (0)
else:
    for i in range(N):
        sum_ *= a[i]
        if sum_> 10**18:
            sum_ =-1
            break
    print(sum_)
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
        
def lcm(a,b):
    g = gcd(a,b)
    return int(a/g*b)

n = int(input())
t = []
for i in range(n):
    t.append(int(input()))

res=1
for i in range(n):
    res = lcm(res,t[i])
    
print(res)

### FIXED CODE ###

n = int(raw_input())

def gcd(a,b):
    if a > b:
        a,b = b,a
    # a <= b
    while a > 0:
        a,b = b%a, a
    return b

def lcm(a,b):
    g = gcd(a,b)
    return a/g * b

x = 1
for i in range(n):
    ti = int(raw_input())
    x = lcm(x, ti)

print x
import sys
from math import gcd


# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")



a,b=MI()
x=a
if x >= b:
    print(1)
    exit()
for i in range(2,21):
    x+=(a-1)
    if x >= b:
        print(i)
        exit()

### FIXED CODE ###

import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")



a,b=MI()
x=a

if b == 1:
    print(0)
    exit()
if x >= b:
    print(1)
    exit()
for i in range(2,21):
    x+=(a-1)
    if x >= b:
        print(i)
        exit()
if a>=k:
    print(k)
elif a<k<=a+b:
    print(a)
else:
    print(a-(k-a-b))

### FIXED CODE ###

a,b,c,k=map(int,input().split())
if a>=k:
    print(k)
elif a<k<=a+b:
    print(a)
else:
    print(a-(k-a-b))
s = list(map(int, input().split()))
t = s.copy()
cnta = 0
cntc = 0
ans = [cnta, cntc]
if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in s:
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	cnta +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	cnta +=1

for i in t:
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	cntc +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	cntc +=1

print(min(ans))

### FIXED CODE ###

S = input()
s = list(map(int, S))
t = s.copy()
n = len(s)
x = 0
y = 1

if t[0] == 0:
    t[0]=1
else:
    t[0]=0

for i in range(n-1):
    if s[i+1]==0 and s[i+1] == s[i]:
    	s[i+1]=1
    	x +=1
    elif s[i+1]==1 and s[i+1]==s[i]:
    	s[i+1]=0
    	x +=1
    
for i in range(n-1):
    if t[i+1]==0 and t[i+1] == t[i]:
    	t[i+1]=1
    	y +=1
    elif t[i+1]==1 and t[i+1]==t[i]:
    	t[i+1]=0
    	y +=1

print(min([x,y]))
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []
for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for li in range(l):
    print(" ".join([str(s) for s in C[li]])) 

### FIXED CODE ###

n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []
for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for li in range(n):
    print(" ".join([str(s) for s in C[li]]))
N = int(input())
G = [[] for i in range(N)]
for i in range(N-1):
    a, b = (int(i) for i in input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)

prev = [-1]*N
dp = [0]*(N+1)
def DFS(start):
    res = 0
    for u in G[start]:
        if u != prev[start]:
            prev[u] = start
            res += DFS(u)
    dp[start] = res+1
    return res+1

DFS(0)
start = N-1
path = [N-1]
while True:
    path.append(prev[start])
    start = prev[start]
    if start == 0:
        break
path.reverse()
num = len(path)
c, d = (path[(num+1)//2-1], path[(num+1)//2])
G[c].remove(d)
G[d].remove(c)
if DFS(0) > DFS(N-1):
    print("Fennec")
else:
    print("Snuke")

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

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

prev = [-1]*N
def DFS(start):
    res = 0
    for u in G[start]:
        if u != prev[start]:
            prev[u] = start
            res += DFS(u)
    return res+1

DFS(0)
start = N-1
path = [N-1]
while True:
    path.append(prev[start])
    start = prev[start]
    if start == 0:
        break
path.reverse()
num = len(path)
c, d = (path[(num+1)//2-1], path[(num+1)//2])
G[c].remove(d)
G[d].remove(c)
prev = [-1]*N
DFS0 = DFS(0)
prev = [-1]*N
if DFS0 > DFS(N-1):
    print("Fennec")
else:
    print("Snuke")
n=int(input())
d_list=map(int,inout().spllit())
count=0
for i in range(n):
  count-=d_list[i]**2
  for j in range(n):
    count+=d_list[i]*d_list[j]
print(count)

### FIXED CODE ###

n=int(input())
d_list=list(map(int,input().split()))
count=0
for i in range(n):
  for j in range(n):
    if i<j:
        count+=d_list[i]*d_list[j]
print(count)
#https://atcoder.jp/contests/abc150/tasks/abc150_a
K= [ ]
K= int(input())

X= [ ]
X= int(input())

if 500*K<X:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

#https://atcoder.jp/contests/abc150/tasks/abc150_a

K, X= map(int, input().split())

if 500*K<X:
    print("No")
else:
    print("Yes")
s = input()
K = int (input())


def sort_here(ll):  # バブルソート
    for m in range(len(ll)):
        for n in range(len(ll)-1-m):
            A, B = compare(ll[n], ll[n+1])
            ll[n] = A
            ll[n + 1] = B
    return ll


def compare(A, B):
    # このゲームにおける比較
    # 小、大の順で返す
    a = len(A)
    b = len(B)

    if a > b:
        if A[:b] == B:
            return B, A
    elif b > a:
        if B[:a] == A:
            return A, B

    for i in range(len(min(A, B))):
        if A[i] > B[i]:
            return B, A
        elif A[i] < B[i]:
            return A, B


# まずはありうるsubstringを準備
i_list = []
for i in range(1, len(s) + 1):
    # i文字数のsutringをまずは作る
    for j in range(len(s) - i + 1):
        cand = s[j:j+i]
        if cand not in i_list:
            i_list.append(s[j:j+i])

#print(i_list)

# 並び替え
i_list = sort_here(i_list)
#print(i_list)


# 出力
print(i_list[K-1])

### FIXED CODE ###

# 整数の入力
a, b, c, d = list(map(int, input().split(" ")))

if abs(a-c) <= d:
    print("Yes")

else:
    if (abs(a-b) <= d) & (abs(b-c) <= d):
        print("Yes")
    else:
        print("No")
N=int(input())
A=list(map(int,input().split()))
A.sort()
B=[]#偶数だけ
C=[]#奇数だけ
if N%2==0:
  for i in range(0,int(N/2)):
    B+=[2*i,2*i]
    C+=[2*i+1,2*i+1]
  if A==B or A==C:
    print(int(2**(N/2))%(10**9+7))
  else:
    print(0)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
A.sort()
B=[]#偶数だけ
C=[]#奇数だけ

if N%2==0:
  for i in range(0,int(N/2)):
    B+=[2*i,2*i]
    C+=[2*i+1,2*i+1]
  if A==B or A==C:
    n=int(N/2)
    ans=2**n
    print(ans%(10**9+7))
  else:
    print(0)
else:
  B+=[0]
  C+=[1]
  for i in range(0,int(N/2)):
    B+=[2*i+2,2*i+2]
    C+=[2*i+3,2*i+3]
  if A==B or A==C:
    n=int((N-1)/2)
    ans=2**n
#    ans=2**((N-1)/2)
    print(ans%(10**9+7))
  else: 
    print(0)
S = int(input())
int_max = 10 ** 9
X1 = 0
Y1 = 0
X2 = int_max
Y2 = 1
X3 = int_max * Y3 - S
Y3 = (S + X3) // int_max
print(X1, Y1, X2, Y2, X3, Y3)


### FIXED CODE ###

S = int(input())
M = 10 ** 9
X1 = 0
Y1 = 0
X2 = M
Y2 = 1
X3 = (M - S%M)%M
Y3 = (S + X3) // M
print(X1, Y1, X2, Y2, X3, Y3)
A.B.C=map(int,input().split())
if A+B+C>=22:
  print("bust")
else:
  print("win")

### FIXED CODE ###

A,B,C=map(int,input().split())
if A+B+C>=22:
  print("bust")
else:
  print("win")
n = int(input())
vlist = list(map(int, input().split(" ")))

head = vlist[::2]
foll = vlist[1::2]

import collections
ch = collections.Counter(head).most_common()
cf = collections.Counter(foll).most_common()

h_ = ch[0]
f_ = cf[0]

if h_[0] == f_[0]:
    #if h_[1] == f_[1]:
    #    if h_[0] == vlist[0]:
    #        f_ = (-1.1, 0)
    #    else:
    #        h_ = (-1.1, 0)
    if h_[1] > f_[1]:
        if len(cf) != 1:
            f_ = cf[1]
        else:
            f_ = (-1.1, 0)
    else:
        if len(ch) != 1:
            h_ = ch[1]
        else:
            h_ = (-1.1, 0)

count = 0
for i in range(len(vlist)):
    if i % 2 == 0 and vlist[i] != h_[0]:
        count += 1
    if i % 2 == 1 and vlist[i] != f_[0]:
        count += 1

print(count)

### FIXED CODE ###

intput_ = list(input())
output = ""
for s_ in intput_:
  if s_ == '1':
    output += "9"
  elif s_ == '9':
    output += "1"
  else:
    output += s_

print(output)
n,m=map(int,input().split())
li=[0]*n
for i in range(n):
  a,b=map(int,input().split())
  li[a-1]+=1
  li[b-1]+=1
for i in li:
  print(i)

### FIXED CODE ###

n,m=map(int,input().split())
li=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  li[a-1]+=1
  li[b-1]+=1
for i in li:
  print(i)
li= list(map(int, input().split()))
while True:
	li.sort()
	if li==[0,0]
		break
	print(*li)


### FIXED CODE ###

while True:
	x,y=sorted(map(int,input().split()))
	if x==0 and y==0:
		break
	print(x, y)
a,b = map(int,input().split())
n =　b-a
print(n*(n+1)//2-b)


### FIXED CODE ###

a,b = map(int,input().split())
n = b-a
tower = ((n+1)*n)/2
print(int(tower-b))
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(M)
A = input().split()
A = [int(s) for s in A]
AN = M * N - sum(A)
if (AN <= K) and (AN >= 0):
	print (AN)
elif AN < 0:
	print (0)
else:
	print (-1)

### FIXED CODE ###

a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
C = input()
if (C != 'z') and (C in a):
	i = a.index(C)
	print (a[i+1])
data = [int(s) for in input().split()]

if data[1] >= 13:
    print(data[0]):
elif data[1] >= 6:
    print(data[0]/2):
else:
    print(0)

### FIXED CODE ###

data = [int(s) for s in  input().split()]

if data[0] >= 13:
    print(data[1])
elif data[0] >= 6:
    print(int(data[1]/2))
else:
    print(0)
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
 
N,M=map(int,input().split())
if M==1:
  print(1)
else:
  primes0=prime_factorize(M)
  keys=list(set(primes0))
  primes={}
  for i in range(len(keys)):
    k=keys[i]
    primes[k]=0
    for j in range(len(primes0)):
      if primes0[j]==k:
        primes[k]+=1

  def cmb(n, k, mod, fac, ifac): #calc nCk under mod
      if n < k or n < 0 or k < 0:
          return 0
      else: 
          k = min(k, n-k)
          return fac[n] * ifac[k] * ifac[n-k] % mod

  def make_tables(mod, n): #Make factorial and inverse tables under mod 
      fac = [1, 1] # factorial table
      ifac = [1, 1] #factorial of inverse table
      inverse = [0, 1] #inverse

      for i in range(2, n+1):
          fac.append((fac[-1] * i) % mod)
          inverse.append((-inverse[mod % i] * (mod//i)) % mod)
          ifac.append((ifac[-1] * inverse[-1]) % mod)
      return fac, ifac

  mod=10**9+7
  fac,ifac = make_tables(mod,N*2)
  ans=1
  for i in range(len(keys)):
    ans*=cmb(N+primes[keys[i]]-1, primes[keys[i]], mod, fac, ifac)
    ans%=mod
  print(ans)

### FIXED CODE ###

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
 
N,M=map(int,input().split())
primes0=prime_factorize(M)
keys=list(set(primes0))
primes={}
for i in range(len(keys)):
  k=keys[i]
  primes[k]=0
  for j in range(len(primes0)):
    if primes0[j]==k:
      primes[k]+=1
 
def cmb(n, k, mod, fac, ifac): #calc nCk under mod
    if n < k or n < 0 or k < 0:
        return 0
    else: 
        k = min(k, n-k)
        return fac[n] * ifac[k] * ifac[n-k] % mod
 
def make_tables(mod, n): #Make factorial and inverse tables under mod 
    fac = [1, 1] # factorial table
    ifac = [1, 1] #factorial of inverse table
    inverse = [0, 1] #inverse
 
    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        ifac.append((ifac[-1] * inverse[-1]) % mod)
    return fac, ifac
 
mod=10**9+7
fac,ifac=make_tables(mod,N*10)
ans=1
for i in range(len(keys)):
  ans*=cmb(N+primes[keys[i]]-1, primes[keys[i]], mod, fac, ifac)
  ans%=mod
print(ans)
maior=0
A = int(input())
B = int(input())
lista = [A+B, A-B, A*B]
for i in range(0,3):
    if lista[i]> maior:
        maior = lista[i]
print(maior)

### FIXED CODE ###

a, b = map(int, input().split())
c = max([a +b, a-b, a*b])
print(c)
R = lambda: tuple(map(int, input().split()))
A, B, M = R()
a, b = R(), R()
d = (R() for _ in range(M))
print(min([min(a) + min(b)] + [a[x - 1] + b[x - 1] - c for x, y, c in d]))


### FIXED CODE ###

R = lambda: tuple(map(int, input().split()))
A, B, M = R()
a, b = R(), R()
d = (R() for _ in range(M))
print(min([min(a) + min(b)] + [a[x - 1] + b[y - 1] - c for x, y, c in d]))
#print(f"black={black}")
    for i in range(H+1):
        for iconb in comb(range(H), i):
            for j in range(W+1):
                for jconb in comb(range(W), j):
                    cells = np.copy(original)
                    cells[iconb, :] = '-'
                    cells[:, jconb] = '-'
                    black = np.count_nonzero(cells == '#')
                    #print(f"black={black} iconb={iconb} jconb={jconb}")
                    if black == K:
                        count += 1
    print(count)

if __name__ == '__main__':
    main()


### FIXED CODE ###

from itertools import combinations as comb
from bisect import bisect_left

import numpy as np
def main():
    H, W, K = map(int, input().split())
    cells = []
    count = 0
    for _ in range(H):
        row = [w for w in input()]
        cells.append(row)

    original = np.copy(np.array(cells))
    black = np.count_nonzero(cells == '#')
    #print(f"black={black}")
    for i in range(H+1):
        for iconb in comb(range(H), i):
            for j in range(W+1):
                for jconb in comb(range(W), j):
                    cells = np.copy(original)
                    cells[iconb, :] = '-'
                    cells[:, jconb] = '-'
                    black = np.count_nonzero(cells == '#')
                    #print(f"black={black} iconb={iconb} jconb={jconb}")
                    if black == K:
                        count += 1
    print(count)

if __name__ == '__main__':
    main()
N = int(input())
L = int(input().split())
L2 = set(L) # 重複を削除

ans = 0

for i in len(L2):
  for j in range(i+1, len(L2)):
    for k in range(i+2, len(L2)):
      l = [i, j, k]
      l = sorted(l, reverse = True)
      if l[0] < l[1] + l[2]:
        ans += L.count(i) * L.count(j) * L.count(k)

print(ans)      
    


### FIXED CODE ###

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

L2 = list(set(L)) # 重複を削除

ans = 0

for i in range(len(L2)):
  for j in range(i+1, len(L2)):
    for k in range(j+1, len(L2)):
      l = [L2[i], L2[j], L2[k]]
      l = sorted(l, reverse = True)
      if l[0] < l[1] + l[2]:
        ans += L.count(L2[i]) * L.count(L2[j]) * L.count(L2[k])

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

x_sort = sorted(X)
m = N/2 - 1
for i in range(N):
    if X[i] <= x_sort[m]:
        print(x_sort[m + 1])
    else:
        print(x_sort[m])

### FIXED CODE ###

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

x_sort = sorted(X)
m = N//2 - 1
for i in range(N):
    if X[i] <= x_sort[m]:
        print(x_sort[m + 1])
    else:
        print(x_sort[m])
inputstr1 = input().split()
n = inputstr1[0]
k = inputstr1[1]
s = input()

chars = list(s)
chars[int(k)-1]=chars[int(k)-1].lower()
correct = "".join(chars)
print(correct)

### FIXED CODE ###

a, b, t = map(int,input().split())
i = 1
bisket = 0

while t+0.5 > i*a:
    bisket += b
    i += 1

print(bisket)
n=int(input())
a=list(map(int,input().split()))
b=a.copy()
b=sorted(b,reverse=True)
comb_n=max(b)
b.pop(0)
c=b
comb_list=[]
ind_list=[]
for i in c:
    comb_list.append(comb(comb_n,i))
    ind_list.append(i)
max_num=max(comb_list)
for i in range(len(comb_list)):
    if comb_list[i]==max_num:
        print(comb_n,ind_list[i])

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
comb_n=a[0]
a=a[1:]
r_ind=int(comb_n/2)

ans=0
for i in range(len(a)-1):
     if abs(a[i]-r_ind)<=abs(a[i+1]-r_ind):
          ans=a[i]
          break
print(comb_n,ans)
x,y=map(int,input().split())
T=x+y
W=x-T//3
D=10**9
print(T//3)

import sys
if T%3!=0 or y/x<1/2 or y/x>2:
    print(0)
    sys.exit()

if x==y==999999:
    print(151840682)
    sys.exit()

from functools import lru_cache
@lru_cache(maxsize=1000000)
def c(n,k): 
  return 1 if(k<=0 or n<=k) else (c(n-1, k-1) + c(n-1, k))%D

sys.setrecursionlimit(10000)
print(c(T//3,W))

### FIXED CODE ###

import sys

x,y=map(int,input().split())
T=x+y
MOD=10**9+7

def nCmMOD(A,B,Mod):
    num,den=1,1
    for i in range(B):
        num*=(A-i)
        den*=(i+1)
        num%=Mod
        den%=Mod
    return (num*pow(den,Mod-2,Mod))%Mod

if T%3!=0 or y/x<1/2 or y/x>2:
    print(0)
    sys.exit()
else:
    n=(2*y-x)//3
    m=(2*x-y)//3
    l=min(n,m)
    print(nCmMOD(n+m,l,MOD))
H,W = map(int,input().split())
a = [[x for x in input()] for i in range(H)]
f = True
if a[0][0] == "#":
    if a[0][1] == "." and a[1][0] == ".":
        print("No")
        f = False
elif a[0][-1] == "#":
    if a[0][-2] == "." and a[1][-1] == ".":
        print("No")
        f = False
elif a[-1][0] == "#":
    if a[-1][1] == "." and a[-2][0] == ".":
        print("No")
        f = False
elif a[-1][-1] == "#":
    if a[-1][-2] == "." and a[-2][-1] == ".":
        print("No")
        f = False
else:
    for i in range(1,H-1):
        if a[0][i] == "#":
            if a[0][i-1] == "." and a[0][i+1] == "." and a[1][i] == ".":
                print("No")
                f = False
                break
        elif a[-1][i] == "#":
            if a[-1][i-1] == "." and a[-1][i+1] == "." and a[-2][i] == ".":
                print("No")
                f = False
                break
    for i in range(1,W-1):
        if a[i][0] == "#":
            if a[i-1][0] == "." and a[i+1][0] == "." and a[i][1] == ".":
                print("No")
                f = False
                break
        elif a[i][-1] == "#":
            if a[i-1][-1] == "." and a[i+1][-1] == "." and a[i][-2] == ".":
                print("No")
                f = False
                break
    if f:
        for i in range(1,H-1):
            for j in range(1,W-1):
                if a[i][j] == "#":
                    if a[i][j+1] == "." and a[i][j-1] == "." and a[i+1][j] == "." and a[i-1][j] == ".":
                        print("No")
                        f = False
                        break
                        break
if f:
    print("Yes")

### FIXED CODE ###

H,W = map(int,input().split())
a = [["."]*(W+2)]*(H+1)
f = True
for i in range(H):
    a[i+1] = ["."]
    a[i+1].extend([x for x in input()])
    a[i+1].append(".")
a.append(["."]*(W+2))
for i in range(1,H+1):
    for j in range(1,W+1):
        if a[i][j] == "#":
            if a[i][j+1] == "." and a[i][j-1] == "." and a[i+1][j] == "." and a[i-1][j] == ".":
                f = False
                break
                break
if f:
    print("Yes")
else:
    print("No")