Harryxun/stf_run huggingface dataset:
h,w = map(int,input().split())
lis = [list(map(int,input().split())) for i in range(9)]
li = [list(map(int,input().split())) for i in range(h)]

for i in range(9):
    for j in range(9):
        for k in range(9):
            if lis[i][j] > lis[i][k] + lis[k][j]:
                lis[i][j] = lis[i][k] + lis[k][j]
ans = 0
for i in range(h):
    for j in range(w):
        if li[i][j] != -1:
            ans += lis[i][j]
print(ans)

### FIXED CODE ###

h,w = map(int,input().split())
lis = [list(map(int,input().split())) for i in range(10)]
li = [list(map(int,input().split())) for i in range(h)]

for k in range(10):
    for i in range(10):
        for j in range(10):
            if lis[i][j] > lis[i][k] + lis[k][j]:
                lis[i][j] = lis[i][k] + lis[k][j]
ans = 0
for i in range(h):
    for num in li[i]:
        if num >= 0:
            ans += lis[num][1]
print(ans)
s = input()
s.reverse()
MOD = 2019
b = {}
a =[0]*MOD
a[0] = 1
c_ = 0
ans = 0
t = 1
for i in s:
  c = (c_+int(i)*t)%MOD
  b[c] += 1
  t *= 10
  t %= MOD
  c_ = c
for i in a:
  ans += i*(i-1)//2
print(ans)

### FIXED CODE ###

s = input()
MOD = 2019
a =[0]*MOD
a[0] = 1
c_ = 0
ans = 0
t = 1
for i in reversed(s):
  c = (c_+int(i)*t)%MOD
  a[c] += 1
  t *= 10
  t %= MOD
  c_ = c
for i in a:
  ans += i*(i-1)//2
print(ans)
sr = input()

a, b, c, d = int(sr[0]), int(sr[1]), int(sr[2]), int(sr[3])

def calc(one, two, three):
  if a + b*one + c*two + d*three == 7:
    return True
  else:
    return False
  
def change(num):
  if num == 1:
    return "+"
  else:
    return "-"
  
for q in [1, -1]:
  for w in [1, -1]:
    for e in [1, -1]:
      if calc(q, w, e):
        q, w, e = change(q), change(w), change(e)
        print(str(a)+q+str(b)+w+str(c)+e+str(d)+"=7")
        break


### FIXED CODE ###

sr = input()

a, b, c, d = int(sr[0]), int(sr[1]), int(sr[2]), int(sr[3])

def calc(one, two, three):
  if a + one*b + two*c + three*d == 7:
    return True
  else:
    return False
  
def change(num):
  if num == 1:
    return "+"
  else:
    return "-"
  
flag = False
for q in [1, -1]:
  for w in [1, -1]:
    for e in [1, -1]:
      if calc(q, w, e):
        r, t, y = change(q), change(w), change(e)
        print(str(a)+r+str(b)+t+str(c)+y+str(d)+"=7")
        flag = True
        break
    if flag:
      break
  if flag:
    break
mod = int(1e9+7)
def add(a, b):
    c = a + b
    if c >= mod:
        c -= mod
    return c

def main():
  	n = len(raw_input())
    ans = ''.join(['x' for _ in range(n)])
	print(ans)
    

main()

### FIXED CODE ###

mod = int(1e9+7)
def add(a, b):
    c = a + b
    if c >= mod:
        c -= mod
    return c

def main():
  	n = len(raw_input())
  	temp = ['x' for _ in range(n)]
  	#print(temp)
  	print(''.join(temp))
    #ans = ''.join(temp)
	#print(ans)
    

main()
from collections import Counter
s = input()
if len(set(s)) ==1:
    print(0)
    exit()
if len(set(s)) != len(s):
    cs = Counter(s)
    I = 0
    n = cs.most_common()[0][1]
    ans = 100
    while cs.most_common()[I][1] == n:
        id = [x for x, v in enumerate(s) if v == cs.most_common()[I][0]]
        x = 0
        for i in range(len(id)-1):
            if id[i+1] - id[i] > x:
                x = id[i+1] - id[i] -1
        if ans > x: ans = x
        I += 1
else: ans = len(s) - len(s)//2
print(ans)

### FIXED CODE ###

s = input()
n = len(s)
ans = 1000
for t in set(s):
    ans = min(ans, max([len(l) for l in s.split(t)]))
print(ans)
S = str(input())

def del_cube(s, i):
    s = s[:i] + s[i+2:]
    return s

def dfs(s):
    ans_list = []
    flag = True
    if '10' in s:
        flag = False
        s_10 = s.replace('10', '')
        ans_list.append(dfs(s_10))
    if '01' in s:
        flag = False
        s_01 = s.replace('01', '')
        ans_list.append(dfs(s_01))
    
            
    if flag == True:
        return(len(s))
    else:
        return(min(ans_list))
    
print(len(S) - dfs(S))



### FIXED CODE ###

S = str(input())

s = S

zero = s.count('0')
one = s.count('1')

zero_one_diff = max(zero, one) - min(zero, one)
print(len(s) - zero_one_diff)
n=int(input())
a=list(map(int,input().split()))
n=0
if all(aa%2==0 for aa in a):
  aa%=2
  n+=1
print(n)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=0
while all(aa%2==0 for aa in a):
  ans+=1
  a=[aa//2 for aa in a]
print(ans)
n,k = map(int,input().split())
p = [int(i) for i in input().split()]
p.sort()
s = p[0]+p[1]+p[2]
print(s)


### FIXED CODE ###

n,k = map(int,input().split())
p = [int(i) for i in input().split()]
p.sort()
s = 0
for i in range(k) :
    s += p[i]
print(s)
N,K=map(int,input.split())
p=list(int,input().split())
B=0
p.sort()
K=K-1
for i in range(0,K):
    B=B+p[i]
    i=i+1
    
print(B)

### FIXED CODE ###

N,K=map(int,input().split())
p=list(map(int,input().split()))
B=0
C=0
p.sort()
N=N-5
for i in range(0,K):
    B=B+p[i]
    i=i+1
    
print(B)
N = int(input())

# 長さが10で英小文字の文字列リスト
str_list = [input() for i in range(N)]

import itertools as iter
comb_list = list(iter.combinations(str_list, 2))

def from_cache(cache_dict, word):
    if word in cache_dict.keys():
        return cache_dict

    cnt_dict = {}
    for s in list(word):
        if s not in cnt_dict.keys():
            cnt_dict[s] = 0
        cnt_dict[s] += 1
    cache_dict[word] = sorted(cnt_dict.items(), key=lambda x:x[0])


cache_dict = {}
cnt = 0
for comb_str in comb_list:
    w1, w2 = comb_str[0], comb_str[1]

    cache_dict = from_cache(cache_dict, w1)
    cache_dict = from_cache(cache_dict, w2)

    if cache_dict[w1].keys() != cache_dict[w2].keys():
        continue

    if cache_dict[w1].values() != cache_dict[w2].values():
        continue

    cnt += 1


print(cnt)

### FIXED CODE ###


N = int(input())

cnt_dict = {}

for i in range(N):
    s_list = list(input())
    s_list.sort()
    s_str = "".join(s_list)
    if s_str not in cnt_dict.keys():
        cnt_dict[s_str] = 1
        continue
    cnt_dict[s_str] += 1

import itertools
comb = itertools.combinations

total = 0
for key in cnt_dict.keys():
    cnt = cnt_dict[key]
    if cnt < 2:
        continue
    total += cnt * (cnt - 1) // 2

print(total)
A = jnt(raw_input('A='))
B = int(raw_input('B='))
if A == 1
  A = A + 13
  if B == 1
    B = B + 13
    if A == B
      print 'Draw'
    elif A ＞ B
      print 'Alice'
    elif B ＞ A
      print 'Bob'

  elif B != 1
    if A == B
      print 'Draw'
    elif A ＞ B
      print 'Alice'
    elif B ＞ A
      print 'Bob'

  elif A != 1
    if A == B
      print 'Draw'
    elif A ＞ B
      print 'Alice'
    elif B ＞ A
      print 'Bob'

### FIXED CODE ###

# -*- coading: utf-8 -#-

A = raw_input()
B = A.split( )
C, D = int(B[0]), int(B[1])

if C == 1:
  if D == 1:
    print 'Draw'
  else:
    print 'Alice'
else:
  if D == 1:
    print 'Bob'
  else:
    if C > D:
      print 'Alice'
    elif C < D:
      print 'Bob'
    else:
      print 'Draw'
def main():
    A, B = input().split()
    A = int(A)
    B_big, B_small = B.split(".")
    B_big = int(B_big)
    B_small = int(B_small)
    print(A*B + int(A*B_small/100))


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    A, B = input().split()
    A = int(A)
    B_big, B_small = B.split(".")
    B_big = int(B_big)
    B_small = int(B_small)
    print(A*B_big + A*B_small//100)


if __name__ == "__main__":
    main()
x = int(input())

if 400 <= x <= 599 :
    print(8)
elif 600 <= x <= 799 :
    print(7)
elif 800 <= x <= 999 :
    print(6)
elif 1000 <= x <= 1199 :
    print(5)
elif 1200 <= x <= 1399 :
    print(4)
elif 1400 <= x <= 1599 :
    print(3)
elif 1600 <= x <= 1799 :
    print(2)
elif 1800 <= x <= 1999 :
    prnit(1)


### FIXED CODE ###

x = int(input())

if 400 <= x <= 599 :
    print(8)
elif 600 <= x <= 799 :
    print(7)
elif 800 <= x <= 999 :
    print(6)
elif 1000 <= x <= 1199 :
    print(5)
elif 1200 <= x <= 1399 :
    print(4)
elif 1400 <= x <= 1599 :
    print(3)
elif 1600 <= x <= 1799 :
    print(2)
elif 1800 <= x <= 1999 :
    print(1)
N = int(input())
Ali = list(map(int,input().split()))
Ali = Ali[::-1]
Bli = sorted(Ali)
C = [-1,-1,-1]

for i in range(Ali.count(0)):
  C[i] = Bli[-i-1]+1
  
if Ali.count(0) <= 2:
  r = 3
else:
  r = 1

for i in range(N):
  n = 0
  ta = 0 
  for j in range(3):
    if C[j]-1 == Ali[i]:
      n += 1
      ta = j
  r *= n
  C[ta] = Ali[i]
  
print(r%1000000007)

### FIXED CODE ###

import itertools

N = int(input())
Ali = list(map(int,input().split()))
C = [0,0,0]

for i in range(N):
  n = 0
  for j in range(3):
    if C[j] == Ali[i]:
      C[j] += 1
      break
  
Ali = Ali[::-1]
if C[0] == C[1] == C[2]:
  r = 1
elif C[0] == C[1] or C[1] == C[2] or C[2] == C[0]:
  r = 3
else:
  r = 6

  
for i in range(N):
  n = 0
  ta = 0 
  for j in range(3):
    if C[j]-1 == Ali[i]:
      n += 1
      ta = j
  r *= n
  C[ta] = Ali[i]
  
print(r%1000000007)
from collections import*
n,k,l=map(int,input().split());d=[-1]*n;t=[-1]*n
def f(l,x):
  if l[x]<0:return x
  else:l[x]=f(l,l[x]);return l[x]
def u(l,x,y):l[f(l,y)]=f(l,x)
for _ in range(k):a,b=map(int,input().split());u(d,a-1,b-1)
for _ in range(l):a,b=map(int,input().split());u(t,a-1,b-1)
p=[(f(d,i),f(t,i))for i in range(n)];c=Counter(p);print(*[c[p[i]]for i in range(n)])

### FIXED CODE ###

from collections import*
class u():#UnionFind f-根探し u-連結 s-連結? c-要素数
  def __init__(self,n):self.n,self.r=[-1]*n,[0]*n
  def f(self,x):
    if self.n[x]<0:return x
    else:self.n[x]=self.f(self.n[x]);return self.n[x]
  def u(self,x,y):
    x,y=self.f(x),self.f(y)
    if x==y:return
    elif self.r[x]>self.r[y]:self.n[x]+=self.n[y];self.n[y]=x
    else:self.n[y]+=self.n[x];self.n[x]=y;self.r[y]+=self.r[x]==self.r[y]
  def s(self,x,y):return self.f(x)==self.f(y)
  def c(self,x):return -self.n[self.f(x)]
n,k,l=map(int,input().split())
d=u(n);t=u(n)
for _ in range(k):a,b=map(int,input().split());d.u(a-1,b-1)
for _ in range(l):a,b=map(int,input().split());t.u(a-1,b-1)
p=[(d.f(i),t.f(i))for i in range(n)]
c=Counter(p)
print(*[c[p[i]]for i in range(n)])
import math

def lcm(a, b):
	return a * b // math.gcd (a, b)

c, d = map(int, input().split())

print(lcm(c, d))

### FIXED CODE ###

import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))
import math
X,Y = map(int,input().split())

n = 2*Y/3 - X/3
m = 2*X/3 - Y/3


def comb(n, r):
    return (math.factorial(n) // (math.factorial(n - r) * math.factorial(r))) % (10**9+7)



if (X+Y)%3 != 0:
    print(0)
else:
    if n<0 or m<0:
        print(0)
    else:
        print(comb(n+m,n))


### FIXED CODE ###

def combination(n, r, mod=10**9+7):
    n1, r = n+1, min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod
 
 
def main():
    X, Y = map(int, input().split())
 
    if (X + Y) % 3 or X > Y*2 or Y > X*2:
        return 0
 
    n = (X + Y) // 3
    r = Y - n
    return(combination(n, r))
 
 
print(main())
s=int(input())
print("Heisei" if s =< "2019/04/30" else "TBD")

### FIXED CODE ###

s=input()
print("Heisei" if s <= "2019/04/30" else "TBD")
from operator import mul
from functools import reduce

X,Y = map(int,input().split()[:2])

if (X + Y) % 3 != 0:
    print(0)
    exit()

x_tmp=X
y_tmp=Y

x_count=0
y_count=0

while x_tmp*2 != y_tmp:
    x_tmp-=2
    y_tmp-=1
    x_count+=1

y_count = y_tmp//2

sum = x_count + y_count

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ret = cmb(sum,y_count,mod)
print(ret)


### FIXED CODE ###

from operator import mul
from functools import reduce

X,Y = map(int,input().split()[:2])

if (X + Y) % 3 or not (X <= 2*Y and Y <= 2*X):
    print(0)
    exit()

x_tmp=X+1
y_tmp=Y+2

x_count=0
y_count=0

while x_tmp*2 != y_tmp:
    x_tmp-=2
    y_tmp-=1
    x_count+=1

y_count = y_tmp//2 - 1

sum = x_count + y_count

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, sum + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ret = cmb(sum,x_count,mod)
print(ret)
from collections import deque
plusQ = deque([]) 
minsQ = deque([])
 
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
 
for itr, val in enumerate(A):
  if itr <= (len(A) - 1) // 2 and val > 0:
    plusQ.append(val)
  else:
    minsQ.append(val)
    
p1 = plusQ.popleft()

ans = deque([])
while len(minsQ) > 0:
  if len(plusQ) > 0:
    p, m = plusQ.popleft(), minsQ.popleft()
    ans.append([m, p])
    minsQ.append(m - p)    
  else:
    m = minsQ.popleft()
    ans.append([p1, m])
    p1 = p1 - m

print(p1)
while len(ans) > 0:
  hoge = ans.popleft()
  print(hoge[0],hoge[1])

### FIXED CODE ###

from collections import deque
plusQ = deque([]) 
minsQ = deque([])
 
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
 
for itr, val in enumerate(A):
  if itr == 0:
    plusQ.append(val)
  elif itr != len(A) - 1 and val > 0:
    plusQ.append(val)
  else:
    minsQ.append(val)
    
p1 = plusQ.popleft()
 
ans = deque([])
while len(minsQ) > 0:
  if len(plusQ) > 0:
    p, m = plusQ.popleft(), minsQ.popleft()
    ans.append([m, p])
    minsQ.append(m - p)    
  else:
    m = minsQ.popleft()
    ans.append([p1, m])
    p1 = p1 - m

print(p1)
while len(ans) > 0:
  hoge = ans.popleft()
  print(hoge[0],hoge[1])
from sys import stdin, stdout  

n = stdin.readline() 
arr = [int(x) for x in stdin.readline().split()] 
K=arr[0]
N=arr[1]
n = stdin.readline() 
A = [int(x) for x in stdin.readline().split()] 
dist=[]
for i in range(0,N-1):
    dist.append(A[i+1]-A[i])
dist.append(abs(A[0]-A[-1]+K))

m=max(dist)
for idx,val in enumerate(dist):
    if(val==m):
        dist[idx]=0
        break
print(sum(dist))

### FIXED CODE ###

from sys import stdin, stdout  

K, N = [int(c) for c in input().split()]
A = [int(c) for c in input().split()]
dist=[]
for i in range(0,N-1):
    dist.append(A[i+1]-A[i])
dist.append(abs(A[0]-A[-1]+K))

m=max(dist)
for idx,val in enumerate(dist):
    if(val==m):
        dist[idx]=0
        break
print(sum(dist))
n, t = map(int, input().split())
costs=[]
time = []
for i in range(n):
    new_cost, new_time = map(int, input().split())
    if new_time<t:
        costs.append(new_cost)
        time.append(new_time)
    else:
        continue
print(min(costs))

### FIXED CODE ###

n, t = map(int, input().split())
costs=[]
time = []
for i in range(n):
    new_cost, new_time = map(int, input().split())
    if new_time<=t:
        costs.append(new_cost)
        time.append(new_time)
    else:
        continue
if costs ==[]:
    print('TLE')
else:
    print(min(costs))
import math
a, b = map(int, iniput().split(" "))
print(math.ceil((a + b) / 2))

### FIXED CODE ###

import math
a, b = map(int, input().split(" "))
print(math.ceil((a + b) / 2))
s=input()
k=int(input())
m=len(s)

word={j:26-i for i,j in enumerate([chr(_) for _ in range(97,97+26)])}
number={i:j for i,j in enumerate(chr(_) for _ in range(97,97+26))}
ans=""

for i,j in enumerate(s):
    if i==m-1 and k>0:
        k %=26
        if k>word[j]:ans +=number[k-word[j]]
        else:ans +=number[26-word[j]+k]
    elif word[j]<=k:
        k -=word[j]
        ans +="a"
    else:ans +=j
    
print(ans)

### FIXED CODE ###

N = 26
ord_a = ord('a')
S = [ord(s) - ord_a for s in input()]
K = int(input())


for i in range(len(S)):
    r = (N - S[i]) % N
    if K >= r:
        K -= r
        S[i] = 0


S[-1] += K % N
S[-1] %= N

answer = ''.join(chr(s + ord_a) for s in S)
print(answer)
n = int(input())
count = 0

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

for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            m = gcd(i,j,k)
            count += m
print(count)   

### FIXED CODE ###


import math

n = int(input())
count = 0

for i in range(1,n+1):
    for j in range(1,n+1):
        t = math.gcd(i,j)
        for k in range(1,n+1):
            m = math.gcd(t,k)
            count += m
print(count)
S = sorted(x for x in input())
T = sorted([x for x in input()], reverse=True)
for s,t in zip(S,T):
    if s < t:
        ans = 'Yes'
        break
    if s > t:
        ans = 'No'
print(ans)

### FIXED CODE ###

s = sorted(x for x in input())
t = sorted([x for x in input()], reverse=True)
print('Yes' if s < t else 'No')
a, b, c, d = map(int, input().split())
a<=x<=b
c<=y<=d

print(max(int(x)*int(y)))



### FIXED CODE ###

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

print(max(a*c, a*d, b*c, b*d))
from collections import Counter

s = input()
K = int(input())
c = Counter(s)

key = sorted(c.keys())
ans = []
queue = []

while (len(ans) < K):
    if queue:
        queue = sorted(list(set(queue)))
        res = queue.pop(0)
        ans.append(res)
    else:
        c = key.pop(0)
        queue.append(c)
        ind = [i for i in range(len(s)) if s[i] == c]
        for i in ind:
            for j in range(1, len(s) - i - 1):
                queue.append(s[i:i+j+1])

print(ans[K-1])


### FIXED CODE ###

from heapq import heappush, heappop

s = input()
K = int(input())

min_s = sorted(list(set(s)))

res = [min(s)]
q = []
x = 0

while len(set(q)) < K:
    min_index = [n for n, v in enumerate(s) if v == min_s[x]]
    for m in min_index:
        for i in range(1, 6):
            if m+i <= len(s):
                q.append(s[m:m+i])
    x += 1

ans = sorted(list(set(q)))[K-1]

print(ans)
import numpy as np
def inpl(): return [int(i) for i in input().split()]
def minisum(x):
    mini = np.argmin(x)
    d = len(x)
    result = 0
    if mini != 0:
        result += minisum(x[0:mini])
    if mini != d-1:
        result += minisum(x[mini+1:d])
    return result + (d-mini)*(mini+1)*x[mini]

N = input()
a = np.array(inpl())
print(minisum(a))

### FIXED CODE ###

def inpl(): return [int(i) for i in input().split()]
N = int(input())
a = inpl()
b = {a[i]: i for i in range(N)}

left = list(range(N+2))
right = list(range(N+2))

ans = 0
for i in range(N,0,-1):
    x = b[i]
    ans += i*(right[x]-x +1)*(x-left[x] +1)
    right[left[x] - 1] = right[x]
    left[right[x] + 1] = left[x]
print(ans)
S = input()

result = 0
入力例1なら3文字目まで
for i in range(len(S) // 2):
  # sの1(2番目)がsの最後尾と一緒ならカウント
  if S[i] != S[-(i + 1)]:
    result += 1
print(result)

### FIXED CODE ###

S = input()

result = 0
# 入力例1なら3文字目まで
for i in range(len(S) // 2):
  # sの1(2番目)がsの最後尾と一緒ならカウント
  if S[i] != S[-(i + 1)]:
    result += 1
print(result)
import math
print(math.factrial(int(input))%(10**9+7))

### FIXED CODE ###

import math
print(math.factorial(int(input()))%(10**9+7))
n=int(input())
A=[]
X=[]
Y=[]
x=[]
y=[]
for i in range(n):
  a=int(input())
  A.append(a)
  for j in range(a):
    x1,y1=[int(s) for s in input().split()]
    x.append(x1)
    y.append(y1)
  X.append(x)
  Y.append(y)
  
c=0
for i in range(n):
  l=[1]*n
  for j in range(i, n):
    if l[j]==0:continue
    for k in range(A[j]):
    　　l[X[j][k]] *= Y[j][k]
  if c<l.count(1):
    c=l.count(1) 
  
        
  
print(c)  
  
  
  
  
  
  
  
  
  
  
  
  
  

### FIXED CODE ###

n=int(input())
X=[]
Y=[]
A=[0]*n
for i in range(n):
  A[i]=int(input())
  a=A[i]
  x=[0]*a
  y=[0]*a
  for j in range(a):
    x[j],y[j]=[int(s) for s in input().split()]
  X.append(x)
  Y.append(y)
  
s=0
for i in range(2**n):
  c=0
  d=0
  B=[0]*n
  for j in range(n):
    if((i >> j) & 1):
      c=c+1
      B[j]=1
  for k in range(n):
    if B[k]==1:
      for j in range(A[k]):
        if Y[k][j]!=B[X[k][j]-1]:
          d=-1
          break
    if d<0:
      break
  if s<c and d==0:
    s=c
      
      
print(s)
date = input()
date[3] = "8"
print(date)

### FIXED CODE ###

date = input()
new_date = "2018"+date[4:]
print(new_date)
x = [list(map(str, input().split())) for i in range(2)]
if x[0][0] == x[1][2] and x[0][1] == x[1][1] and x[1][0] == x[0][2]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

x = [input() for i in range(2)]
if x[0][0] == x[1][2] and x[0][1] == x[1][1] and x[1][0] == x[0][2]:
  print('YES')
else:
  print('NO')
#abc117b

n=int(raw_input())
l=map(int,raw_input().split())
if max(l)>=sum(l)-max(l):
 print 'No'
else:
 print 'Yes'


### FIXED CODE ###

#abc117a
t,x=map(int,raw_input().split())
print 1.0*t/x
import math

N,M = map(int,input().split())
A = M//N
L = []
for i in range(1,int(math.sqrt(M))):
  if (M%i == 0 and i <= A):
    L.append(i)
    if (M//i <= A):
      L.append(M//i)
print(max(L))

### FIXED CODE ###

import math

N,M = map(int,input().split())
A = M//N
L = []
for i in range(1,int(math.sqrt(M))+1):
  if (M%i == 0 and i <= A):
    L.append(i)
    if (M//i <= A):
      L.append(M//i)
print(max(L))
from math import gcd

n = int(input())
MOD = 10**9+7
p_map = {}
n_map = {}
z_map = 0
for _ in range(n):
    ab = list(map(int, input().split()))
    ab_gcd = gcd(ab[0], ab[1])
    a = ab[0]//ab_gcd
    b = ab[1]//ab_gcd
    key = "{}_{}".format(a, b)
    if a*b > 0:
        if key not in p_map:
            p_map[key] = 1
        else:
            p_map[key] += 1
    elif a*b == 0:
        z_map += 1
    else:
        if key not in n_map:
            n_map[key] = 1
        else:
            n_map[key] += 1

ans = 1
for k, v in p_map.items():
    
    a = int(k.split("_")[0])
    b = int(k.split("_")[1])
    n_num = 0
    key_a = "{}_{}".format(-b, a)
    key_b = "{}_{}".format(b, -a)
    if key_a in n_map:
        n_num += n_map.pop(key_a)
    if key_b in n_map:
        n_num += n_map.pop(key_b)
    res = 0
    res += pow(2, v, MOD)-1
    if n_num > 0:
        res += pow(2, n_num, MOD)-1
    res += 1
    ans *= res
    ans %= MOD

n_num = sum(n_map.values())
ans *= pow(2, n_num, MOD)
ans %= MOD
ans -= 1

if z_map > 0:
    ans += z_map
ans %= MOD
print(ans)

### FIXED CODE ###

from math import gcd

n = int(input())
MOD = 10**9+7
p_map = {}
n_map = {}

p_zero_map = 0
n_zero_map = 0
z_map = 0
for _ in range(n):
    ab = list(map(int, input().split()))
    ab_gcd = gcd(ab[0], ab[1])
    if ab_gcd == 0:
        ab_gcd = 1
    a = ab[0]//ab_gcd
    b = ab[1]//ab_gcd

    if (a > 0 and b > 0) or (a < 0 and b < 0):
        if a < 0:
            a = -a
            b = -b
        key = "{}_{}".format(a, b)
        if key not in p_map:
            p_map[key] = 1
        else:
            p_map[key] += 1
    elif a == 0 and b == 0:
        z_map += 1
    elif a == 0 and b != 0:
        n_zero_map += 1
    elif b == 0 and a != 0:
        p_zero_map += 1
    else:
        if b < 0:
            a = -a
            b = -b
        key = "{}_{}".format(a, b)
        if key not in n_map:
            n_map[key] = 1
        else:
            n_map[key] += 1

ans = 1
for k, v in p_map.items():
    a = int(k.split("_")[0])
    b = int(k.split("_")[1])
    n_num = 0
    key_a = "{}_{}".format(-b, a)
    if key_a in n_map:
        n_num += n_map.pop(key_a)
    res = 0
    res += pow(2, v, MOD)-1
    if n_num > 0:
        res += pow(2, n_num, MOD)-1
    res += 1
    ans *= res
    ans %= MOD

n_num = sum(n_map.values())
if n_num > 0:
    ans *= pow(2, n_num, MOD)
    ans %= MOD

res = 0
if p_zero_map > 0 and n_zero_map > 0:
    res = pow(2, p_zero_map, MOD)-1 + pow(2, n_zero_map, MOD)-1
    res += 1
    res %= MOD
elif p_zero_map > 0 and n_zero_map == 0:
    res = pow(2, p_zero_map, MOD)
elif p_zero_map == 0 and n_zero_map > 0:
    res = pow(2, n_zero_map, MOD)
if res > 0:
    ans *= res
    ans %= MOD


if z_map > 0:
    ans += z_map
ans -= 1
ans %= MOD
print(ans)
n=int(input())
for i in range(n//4,3501):
    for j in range(1,3501):
        t=4*i*j-i*s-j*s
        y=s*i*j
        if t>0 and s*i*j%t==0:
            print(s*i*j//t,i,j)
            exit()


### FIXED CODE ###

s=int(input())
for i in range(s//4,3501):
    for j in range(1,3501):
        t=4*i*j-i*s-j*s
        y=s*i*j
        if t>0 and s*i*j%t==0:
            print(s*i*j//t,i,j)
            exit()