Harryxun/stf_run huggingface dataset:
h,w = map(int,input().split())
c = [list(map(int,input().split())) for _ in range(10)]
a = [list(map(int,input().split())) for _ in range(h)]
n = 10
from scipy.sparse.csgraph import floyd_warshall
c = floyd_warshall(c)
ans = 0
for i in a:
    for j in i:
        if j!=-1: ans += c[j][1]
print(int(ans))

### FIXED CODE ###

import itertools
import collections
h,w = map(int,input().split())
c = [list(map(int,input().split())) for _ in range(10)]
a = [list(map(int,input().split())) for _ in range(h)]
a = list(itertools.chain.from_iterable(a))
b = collections.Counter(a)
ans = 0

def bfs(x):
    if x[-1]==1:
        global s
        buf = 0
        for i in range(len(x)-1):
            buf += c[x[i]][x[i+1]]
        s = min(s,buf)
    else:
        for i in range(10):
            if not i in x:
                bfs(x+[i])

for i in b:
    if not i in [1,-1]:
        s = 10**9
        bfs([i])
        ans += s*b[i]
print(ans)
n = int(input())
T = []
for i in range(n):
    T.append(int(input()))

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

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

LCM = T[0]
for i in range(n-1):
    LCM = lcm(LCM, T[i+1])

print(LCM)


### FIXED CODE ###

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

T = sorted(T)
def gcd(a, b):
    while b > 0:
        t = a
        a = b
        b = t%b
    return(a)

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

LCM = T[0]
for i in range(n-1):
    LCM = lcm(LCM, T[i+1])

print(LCM)
n = raw_input()
x = n.split()
N= int(x[0])
S = x[1]
x=0 
y = str(x)
for i in range(0,N):
    if S[i] == "I":
        x = x+1 
        y = y + str(x)
    elif S[i]=="D":
        x = x - 1 
        y = y + str(x)
        
print max([int(c) for c in ])

        
    

### FIXED CODE ###

n=int(input())
s=input()
x=0
max=0
for i in range(0,n):
    if(s[i] is 'I'):
        x+=1
    elif(s[i] is 'D'):
        x-=1
    if max<x:
        max=x
print(max)
import math
from functools import reduce

N = int(input())
A = list(map(int,input().split()))
max = 0
L = []
R = []
for i in range(N):
    L = A[:i]
    R = A[i:]
    if i > 0 :
        L.pop()
    while 2>len(L) or 2>len(R):
        L.append(0)
        R.append(0)
    x = reduce(math.gcd,L)
    y = reduce(math.gcd,R)
    gcdmax = math.gcd(x,y)
    if max < gcdmax:
        max = gcdmax
print(max)


### FIXED CODE ###

#3.7.3 -> import math
from fractions import gcd

# [0,--list--,0]
N = int(input())
A = [0]+list(map(int,input().split()))+[0]
L = [0]*(N+2)
R = [0]*(N+2)
#0,A[1]->L[i-1],A[i]->L[N-1],A[N]
for i in range(1,N+1):
    L[i] =gcd(L[i-1],A[i])
#0,A[N]->R[i+1],A[i]->R[2],A[1]
for i in range(N,0,-1):
    R[i] = gcd(R[i+1],A[i])
#A[i]を含めないL,Rのgcdをすべて並べてmaxをとる
print(max(gcd(L[i-1],R[i+1]) for i in range(1,N+1)))
a, b = list(map(int(input().rstrip())))
if a<=8 and b<= 8:
  print("Yay!")
else:
  print(":(")

### FIXED CODE ###

a, b = list(map(int, input().rstrip().split()))
if a<= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")
def hantei(num):
    if num>0 and num<400:
        return 1
    elif num>=400 and num<800:
        return 2
    elif num>=800 and num<1200:
        return 3
    elif num>=1200 and num<1600:
        return 4
    elif num>= 1600 and num<2000:
        return 5
    elif num>=2000 and num<2400:
        return 6
    elif num>=2400 and num<2800:
        return 7
    elif num>=2800 and num<3200:
        return 8
    else:
        return 0

N = input()
l = input().split()
tmp_list = []
num=0
for i in l:
    hoge = hantei(int(i))
    if hoge == 0:
        num+=1
    else:
        tmp_list.append(hoge)
min = len(set(tmp_list))
max = min + num
print(min + ' ' + max)

### FIXED CODE ###

N=input()
def waru(num):
    return int(num)//400
a = list(map(waru, input().split()))
b = []
num = 0
for i in a:
    if i >= 8:
        b.append(i)
minu = len(set(a)) - len(set(b))
if minu==0:
    minu = 1
    maxi = len(b)
else:
    maxi = len(b)+minu
print(minu, maxi)
N = int(input())
H = list(map(int,input().split()))
maxi = 0
cnt = 0
for H[i] in range( N ) :
    if H[i] >= maxi :
        cnt += 1
        maxi = H[i]
print( cnt )
    


### FIXED CODE ###

N = int(input())
H = list(map(int,input().split()))
maxi = 0
cnt = 0
for i in range( N ) :
    if H[i] >= maxi :
        cnt += 1
        maxi = H[i]
print( cnt )
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
DIV = 10**9+7

def main():
    B = [0]*(M+1)
    for i in range(M+1):
        if i==0:
            B[i] = A[i]-1
        elif i==M:
            B[i] = N-A[i-1]-1
        else:
            B[i] = A[i] - A[i-1] - 2
    min_B = min(B)
    if min_B<0:
        return 0
    
    max_B = max(B)
    F = [1]*(max_B+1)
    for i in range(max_B+1):
        if i<2:
            pass
        else:
            F[i] = F[i-2] + F[i-1]
    ans = 1
    for b in B:
        ans *= F[b]
        if ans > DIV:
            ans %= DIV
    return ans

print(main())


### FIXED CODE ###

N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
DIV = 10**9+7

def main():
    if M>0:
        B = [0]*(M+1)
        for i in range(M+1):
            if i==0:
                B[i] = A[i]-1
            elif i==M:
                B[i] = N-A[i-1]-1
            else:
                if A[i]==A[i-1]:
                    B[i] = 0
                else:
                    B[i] = A[i] - A[i-1] - 2
    else:
        B = [N]
    min_B = min(B)
    if min_B<0:
        return 0
    
    max_B = max(B)
    F = [1]*(max_B+1)
    for i in range(max_B+1):
        if i<2:
            pass
        else:
            F[i] = F[i-2] + F[i-1]
    ans = 1
    for b in B:
        ans *= F[b]
        if ans >= DIV:
            ans %= DIV
    return ans

print(main())
# 整数の入力
a, b = input(), input()
# 二つの数を掛けて2で割ったときの余り
c = (a * b) % 2
if c != 0:
    print('Odd')
else:
    print('Evev')

### FIXED CODE ###

a, b = map(int, input().split())
if (a * b) % 2 != 0:
    print('Odd')
else:
    print('Even')
import numpy as np

H, W = map(int, raw_input().split())
arr=np.array([])
s=0
while s != H:
  li=list(raw_input())
  li=np.array(li)
  arr=np.hstack((arr,li))

  s+=1
arr=arr.reshape((H,W))
count=0

def check(x,y):
    import __main__
    if arr[x,y] == "#":
        __main__.count+=1

for x in range(H):
    for y in range(W):
        if arr[x,y] == ".":
            count=0
            top= None
            right =None
            left=None
            if y != 0:
                top=True
                check(x,(y-1))
            if x != 0:
                if top:
                    check((x-1),(y-1))
                check((x-1),y)
                left=True
            if x != (W-1):
                if top:
                    check((x+1),(y-1))
                right=True
                check((x+1),y)
            if y != (H-1):
                if left:
                    check(x-1,y+1)
                if right:
                    check(x+1,y+1)
                check(x,(y+1))
            arr[x,y]=str(count)

for x in range(H):
    stri=""
    for y in range(W):
        stri=stri + arr[x,y]
    print(stri)



### FIXED CODE ###

h,w=map(int,input().split())
lis=[input() for i in range(h)]
outs=[]
for x in range(h):
    s=""
    for y in range(w):
        if lis[x][y]==".":
            c=0
            for xi,yi in [(1,1),(1,0),(1,-1),(0,1),(0,-1),(-1,1),(-1,0),(-1,-1)]:
                if not (xi+x==-1 or yi+y==-1 or xi+x==h or yi+y==w):
                    c+=(1 if lis[xi+x][yi+y]=="#" else 0)
            s+=str(c)
        else:
            s+="#"
    outs.append(s)
for i in outs:
    print(i)
w, h, n = map(int, input().split())
xya = [list(map(int, input().split())) for _ in range(n)]

l, r, b, t = 0, w, 0, h
for x, y, a in xya:
    if a == 1:
        l = max(x, l)
    elif a == 2:
        r = min(x, r)
    elif a == 3:
        b = max(y, b)
    elif a == 4:
        t = min(y, u)
print(max(0, r - l) * max(0, t - b))


### FIXED CODE ###

w, h, n = map(int, input().split())
xya = [map(int, input().split()) for _ in range(n)]

l, r, b, u = 0, w, 0, h
for x, y, a in xya:
    if a == 1:
        l = max(x, l)
    elif a == 2:
        r = min(x, r)
    elif a == 3:
        b = max(y, b)
    elif a == 4:
        u = min(y, u)
print(max(0,r - l) * max(0,u - b))
import math

EnemyCount, slayeCount = map(int, input().split())
enemyHealths = list(map(int, input().split(" "))).sort()

if EnemyCount < slayeCount:
    slayeCount = EnemyCount

for _ in range(slayeCount):
    del enemyHealths[-1]

print(sum(enemyHealths))

### FIXED CODE ###

import math

EnemyCount, slayeCount = map(int, input().split())
enemyHealths = list(map(int, input().split(" ")))
enemyHealths.sort()

if EnemyCount < slayeCount:
    slayeCount = EnemyCount

for _ in range(slayeCount):
    del enemyHealths[-1]

print(sum(enemyHealths))
import math
n = int(input())

count = 0

def sosu(n,z):
    for i in range(z, int(math.sqrt(n))+1):
        if n%i == 0:
            return i
            break
    return -1

if sosu(n,2) == -1 and n != 1:
    print(1)
    exit()

ans  = 0
z = 2

def hantei(n):
    i = sosu(n,2)
    s = 0
    if sosu(n,2) == -1:
        return True
    if sosu(n,2) > 0:
        s = n ** (1/i)
        if int(s) == math.floor(s):
            #print(n,s)
            return True
        else:
            return False

memo = []

while(n != 1) :
    ans = sosu(n,z)
    print(n,ans,z)
    if ans == -1:
        if memo.count(n) == 0 and hantei(n):
            count +=1
            break
        else:
            break

    if hantei(ans) :
        memo.append(ans)
        z = ans+1
        n = n//ans
        count += 1
    else:
        z = ans +1
    #print(count)



print(count)


### FIXED CODE ###

n, m = map(int,input().split())
print(n*m)
def main():
 n, m = map(int,input().split())
 a = list(map(int,input().split()))
 sum = sum(a)
 if sum <= n:
  print(n - sum)
 else:
  print(-1)
      
main()


### FIXED CODE ###

def main():
 n, m = map(int,input().split())
 a = list(map(int,input().split()))
 sum = 0
 for i in a:
  sum += i
 if sum <= n:
  print(n - sum)
 else:
  print(-1)
      
main()
S, T = input().split
A, B = map(int, input().split)
U = input()

if S == U :
  print(A - 1)
elif T == U :
  print(B - 1)

### FIXED CODE ###

S, T = input().split()
A, B = map(int, input().split())
U = input()
 
if S == U :
  print(str(A - 1) + ' ' + str(B))
elif T == U :
  print(str(A) + ' ' + str(B - 1))
from decimal import *
A,B = map(float,input().split())
num = str(Decimal(A)*Decimal(B))
ans = ''

for i in range(len(num)):
  if num[i] == '.':
    break
  ans += num[i]
print(int(ans))

### FIXED CODE ###

from decimal import *
A,B = map(str,input().split())
num = str(Decimal(A)*Decimal(B))
ans = ''
 
for i in range(len(num)):
  if num[i] == '.':
    break
  ans += num[i]
print(int(ans))
n = int(input())
h = map(int, input().split())
cnt = []
cur_cnt = 0
for x in range(n-1):
    if h[x] >= h[x + 1]:
        cur_cnt += 1
    else:
        cnt.append(cur_cnt)
        cur_cnt = 0
cnt.append(cur_cnt)

print(max(count))


### FIXED CODE ###

n = int(input())
h = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
        ans = max(ans,cnt)
    else:
        cnt = 0
print(ans)
S = input()
acgt = {'A', 'C', 'G', 'T'}
length = len(S)
start = 0
ans = 0
while start < length:
  while S[start] not in acgt:
    start += 1
  right = start
  while right < length and S[right] in acgt:
    right += 1
  ans = max(ans, right - start )
  start = right
print(ans)

### FIXED CODE ###

S = input()
acgt = {'A', 'C', 'G', 'T'}
length = len(S)
start = 0
ans = 0
while start < length:
  while start < length and S[start] not in acgt:
    start += 1
  right = start
  while right < length and S[right] in acgt:
    right += 1
  ans = max(ans, right - start)
  start = right
print(ans)
N, X = map(int, input().split())
L = list(map(int, input().split()))
cnt = 0
for i in range(N):
    cnt+=L[i]
    if cnt>X:
        ans = i+1
        break
print(ans)


### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
cnt = 0
ans = N+1
for i in range(N):
    cnt+=L[i]
    if cnt>X:
        ans = i+1
        break
print(ans)
import re

def revPolish(f):
    f = re.sub(r'(\-?\d+\.?\d*)\s(\-?\d+\.?\d*)\s([\+\-\*/])(?!\d)',
        lambda m: str(eval(m.group(1) + m.group(3) + m.group(2))),
        f)
    if f[-1] in ('+','-','*','/'):
        return revPolish(f)
    else:
        return f

if __name__==`__main__`:
    print(revPolish(input()))


### FIXED CODE ###

import re
pat = re.compile(r'(\-?\d+\.?\d*)\s(\-?\d+\.?\d*)\s([\+\-\*/])(?!\d)')

def revPolish(f):
    global pat
    f = pat.sub(lambda m: str(eval(m.group(1) + m.group(3) + m.group(2))),f)
    if f[-1] in '+-*/':
        return revPolish(f)
    else:
        return f

print(revPolish(input()))
import math
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = int(C/math.gcd(C,D) *D)
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

### FIXED CODE ###

from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)
A =int( input())
B =int( input())
C =int( input())
D = int(input())
E = int(input())

li = [A,B,C,D,E]
li_nonzero=[]

for x in li:
    if x % 10 != 0:
        li_nonzero.append(x)

z = li_nonzero[0]%10
for y in li_nonzero:
    if y % 10 <= z:
        z = y%10
        last_menu = y
        
li.remove(last_menu)

if len(li) != 4:
    while(len(li)==4):
        li.append(last_menu)
sum_time = 0
for menu in li:
    if menu % 10 != 0:
        sum_time = sum_time +( (menu//10)*10+10)
    else:
        sum_time = sum_time +( (menu//10)*10+0)
        
    
print(sum_time+last_menu)

### FIXED CODE ###

A =int( input())
B =int( input())
C =int( input())
D = int(input())
E = int(input())

li = [A,B,C,D,E]
li_nonzero=[]



for x in li:
    if x % 10 != 0:
        li_nonzero.append(x)

if len(li_nonzero) == 0:
    last_menu = li[4]
    li.remove(li[4])
else:
    z = li_nonzero[0]%10
    for y in li_nonzero:
        if y % 10 <= z:
            z = y%10
            last_menu = y
            
    li.remove(last_menu)

if len(li) < 4:
    while(len(li)==4):
        li.append(last_menu)
sum_time = 0
for menu in li:
    if menu % 10 != 0:
        sum_time = sum_time +( (menu//10)*10+10)
    else:
        sum_time = sum_time +( (menu//10)*10+0)
        
    
print(sum_time+last_menu)
while True:
 m,f,r=map(int,input().split())
 if m==f==r==-1 : break

 if (m==-1) or (f==-1):
   print('F')

 if(m+f>=80):
   print('A')

 if (65<= m+f) and (m+f<80) :
   print('B')

 if (50<= m+f) and (m+f<60):
   print('C')

 if(30<= m+f) and (m+f<50):
   if (50<=r):
    print('C')
   else
    print('D')

 if(m+f<30):
   print('F')

### FIXED CODE ###

while True:
 m,f,r=map(int,input().split())
 if m==f==r==-1 : break

 if m==-1 or f==-1 :
   print('F')

 elif (m+f)>=80 :
   print('A')

 elif 65<= (m+f) and (m+f)<80 :
   print('B')

 elif 50<= (m+f) and (m+f)<65 :
   print('C')

 elif 30<=(m+f) and (m+f)<50 :
   if 50<=r :
    print('C')
   else:
    print('D')

 elif (m+f)<30 :
   print('F')
a,b=input().split()
a=int(a)
b=int(b)
if a<=8:
  if b<=8:
    print("Yay!")
      else:
        print(":(")
else:
  print(":(")

### FIXED CODE ###

a,b=input().split()
a=int(a)
b=int(b)
if a<=8:
  if b<=8:
    print("Yay!")
  else:
    print(":(")
else:
  print(":(")
s = list(input())
t = list(input())
count = 0
for i in range(0,3):
    if s[i] == t[i]:
        count += 1
print(count)


### FIXED CODE ###

a = input()
s = input()
if int(a) >= 3200:
    print(s)
else:
    print('red')
W, H, N = map(int, input().split())
xy = [list(map(int, input().split())) for i in range(N)]
x_black = [0] * W 
y_black = [0] * H 
def get_area(x, y, a): 
        if a == 1:
                x_black[:x] = [1] * x 
        if a == 2:
                x_black[x:W] = [1] * (W - x)
        if a == 3:
                y_black[y] = [1] * y 
        if a == 4:
                y_black[y:H] = [1] * (H - y)
for i in xy: 
        get_area(i[0], i[1], i[2])
print(x_black.count(0) * y_black.count(0))

### FIXED CODE ###

W, H, N = map(int, input().split())
xy = [list(map(int, input().split())) for i in range(N)]
x_black = [0] * W 
y_black = [0] * H 
def get_area(x, y, a): 
        if a == 1:
                for i in range(x):
                        x_black[i] = 1 
        if a == 2:
                for i in range(x, W): 
                        x_black[i] = 1 
        if a == 3:
                for i in range(y):
                        y_black[i] = 1 
        if a == 4:
                for i in range(y, H): 
                        y_black[i] = 1 
for i in xy: 
        get_area(i[0], i[1], i[2])
print(x_black.count(0) * y_black.count(0))
n=int(input())
for i in range(n):
    s=list(input())
m=int(input())
for j in range(m):
    t=list(input())

for i in range(n):
    result=s.count(s[i])-t.count(s[i])

print(max(o,result))


### FIXED CODE ###

n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]
result=0
for i in set(s):
    result=max(result,s.count(i)-t.count(i))
print(result)
s = input().split()
if A > 10 or B > 10:
  print(1)
else:
  print(a * b)

### FIXED CODE ###

a = list(map(int,input().split()))
if a[0] >= 10 or a[1] >= 10:
  print('-1')
else:
  print(a[0] * a[1])
N,A,B = map(int,input().split())
string = ''
for i in range(10**100):
  string += 'b'*A
  string += 'r'*B
  if len(string) >= N:
    break
str2 = string[0:N]
cnt = str2.count('b')
print(cnt)

### FIXED CODE ###

N,A,B = map(int,input().split())
syou = N//(A+B)
amari = N%(A+B)
ans = A*syou + min(A,amari)
print(ans)
from itertools import accumulate
n,x = (int(i) for i in input().split())
l = [int(i) for i in input().split()]
ruiseki = list(accumulate(l))
i = 0
while ruiseki[i] <= x and i < n+1:
    i += 1
print(i+1)


### FIXED CODE ###

from itertools import accumulate
n,x = (int(i) for i in input().split())
l = [int(i) for i in input().split()]
ruiseki = list(accumulate(l))
ruiseki.insert(0,0)
i = 0
#print(ruiseki)
while i < len(ruiseki) and ruiseki[i] <= x:
    i += 1
print(i)
def solve(h,w,n,black_list):
  if len(black_list) == 0:
    return [(h-2)*(w-2)]+[0]*9
  idx_list = []
  for idx, (a,b) in enumerate(black_list):
    left = max(0, b-3)
    top = max(0, a-3)
    bottom = min(top+3, h-a)
    for row in range(top, a):
      if row+2 >= h:
        continue
      for col in range(left, b):
        if col+2 >= w:
          continue
        idx_list.append(row*h+col)

  set_count = set(idx_list)
  idx_list = sorted(idx_list)

  ans = [0]*9
  now = idx_list[0]
  count = 0
  for item in idx_list:
    if item == now:
      count += 1
    else:
      now = item
      ans[count-1] += 1
      count = 1
  ans[count-1] += 1
  return [(h-2)*(w-2)-len(set_count)]+ans


if __name__ == "__main__":
  h,w,n = map(int,input().split())
  black_list = [tuple(map(int,input().split())) for _ in range(n)]
  ret = solve(h,w,n,black_list)
  for i in ret:
    print(i)


### FIXED CODE ###

def solve(h,w,n,black_list):
  if len(black_list) == 0:
    return [(h-2)*(w-2)]+[0]*9
  idx_list = []
  for idx, (a,b) in enumerate(black_list):
    left = max(0, b-3)
    top = max(0, a-3)
    for row in range(top, a):
      if row+2 >= h:
        continue
      for col in range(left, b):
        if col+2 >= w:
          continue
        idx_list.append(row*w+col)

  set_count = set(idx_list)
  idx_list = sorted(idx_list)

  ans = [0]*9
  now = idx_list[0]
  count = 0
  for item in idx_list:
    if item == now:
      count += 1
    else:
      now = item
      if count == 10:
        print(item)
      ans[count-1] += 1
      count = 1
  ans[count-1] += 1
  return [(h-2)*(w-2)-len(set_count)]+ans


if __name__ == "__main__":
  h,w,n = map(int,input().split())
  black_list = [tuple(map(int,input().split())) for _ in range(n)]
  ret = solve(h,w,n,black_list)
  for i in ret:
    print(i)
a b = map(int, input().split())
ans = a-2*b
if ans >= 0:
  print(ans)
else:
  print(0)

### FIXED CODE ###

a, b = map(int, input().split())
ans = a-2*b
if ans >= 0:
  print(ans)
else:
  print(0)
L=map(int,input().split())
table=[5,5,7]
L=soretd(L)
if table == L:
  print("YES")
else:
  print("NO")


### FIXED CODE ###

L=list(map(int,input().split()))
table=[5,5,7]
L=sorted(L)
if table == L:
  print("YES")
else:
  print("NO")
def main():
    n = int(input())
    ans = []
    A = [26, 702, 18278, 475254, 12356630, 321272406, 8353082582, 217180147158, 5646683826134, 146813779479510]
    for i in range(9, 0, -1):
        if n > A[i-1]:
            a = n // 26**i
            if a <= 26:
                ans.append(chr(96+a))
                n = n - (26**i*a)
            else:
                a = 26
                ans.append(chr(96+a))
                n = n - (26**i*a)
    ans.append(chr(96+n))
    print(*ans, sep='')
 
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n = int(input())
    ans = []
    for i in range(1, 12):
        if n <= 26**i:
            n -= 1
            for j in range(i):
                a = n % 26
                ans.append(chr(97+a))
                n = n // 26
            break
        else:
            n -= 26**i
    print(*ans[::-1], sep='')
 
if __name__ == '__main__':
    main()
N=int(input())
v = list(map(int,inut().split()))
v.sort(reverse=True)
print(v[0]*v[1]//2)

### FIXED CODE ###

N=int(input())
v = list(map(int,input().split()))
from heapq import heappop,heappush,heapify
heapify(v)
ans = heappop(v)
for i in range(N-1):
    ans = (ans+heappop(v))/2
print(ans)
print("".join(list(reversed(list(map(str,input().split())))))


### FIXED CODE ###

print("".join(list(reversed(list(map(str,input().split()))))))
a=raw_input()
b=raw_input()

if a>b:
 print(a-1)
else:
 print(a);

### FIXED CODE ###

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

if a<=b:
    print(a)
else:
    print(a-1)
N, M = map(int, input().split())
for _ in range(M):
    a, b = map(int, input().split())
for i in range(1,N+1):
    print(a.count(i)+b.count(i))

### FIXED CODE ###

n, m = map(int, input().split())
a, b = [0]*m, [0]*m
for i in range(m):
    a[i], b[i] = map(int, input().split())
for j in range(1,n+1):
    print(a.count(j)+b.count(j))
a, b =map(int, input().split())
if (a*b)%2 ==0:
  print 'even'
else:
  print 'odd'

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b)%2 == 0:
  print ('Even')
else:
  print ('Odd')
def acinput():
    return list(map(int, input().split(" ")))


N, M = acinput()
a = [0]*(N+100)
for i in range(M):
    a[int(input())] = 1


Mod = 1000000007


def solve(x):
    global dp, M
    if dp[x] >= 0:
        return dp[x]

    if x < 0:
        return 0

    res = 0
    zeroflg = True
    try:
        if x-2 >= 0 and a[x-2] != 1:
            res += solve(x-2) % Mod
            zeroflg = False
    except:
        pass
    try:
        if x-1 >= 0 and a[x-1] != 1:
            res += solve(x-1) % Mod
            zeroflg = False
    except:
        pass

    if zeroflg:
        return 0
    dp[x] = res
    return res


dp = [-1]*(N+10)
dp[0] = 1
dp[1] = 1

print(solve(N) % Mod)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

def acinput():
    return list(map(int, input().split(" ")))


N, M = acinput()
a = [0]*(N+1)
for i in range(M):
    a[int(input())] = 1


Mod = 1000000007


def solve(x):
    global dp, Mod
    if dp[x] >= 0:
        return dp[x]

    if x < 0:
        return 0

    res = 0
    zeroflg = True

    if  a[x-2] != 1:
        res += solve(x-2) 
        zeroflg = False

    if a[x-1] != 1:
        res += solve(x-1)
        zeroflg = False

    if zeroflg:
        return 0
    dp[x] = res% Mod
    return res


dp = [-1]*(N+1)
dp[0] = 1
dp[1] = 1

print(solve(N) % Mod)


'''
5 1
1
'''