Harryxun/stf_run huggingface dataset:
MOD=10**9+7

N,_,*a = map(int, open(0).read().split())
A=set(a)
dp = [0 for _ in range(N+1)]
for i in range(1,3):
    if i not in A: dp[i]=dp[i-1]+1
for i in range(3,N+1):
    if i not in A: dp[i]=(dp[i-1]+dp[i-2])%MOD
    
print(dp[N])

### FIXED CODE ###

import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 1000000007

a=open(0)
N,_,*a = map(int, a.read().split())

dp = [-1 for _ in range(100010)]
dp[0] = 0
for i in a: dp[i] = 0
def rec(i):
    if dp[i] > -1:
        return dp[i]
    if i<3:
        dp[i] = rec(i-1) + 1
        return dp[i]
    dp[i] = (rec(i-1)+rec(i-2))%MOD
    return dp[i]
    
print(rec(N))
turn=int(input())
ten=[0,0]

for _ in range(turn):
    hikaku = list(map(int,input().split()))
    if hikaku[0] < hikaku[1]:
        ten[1] +=3

    elif hikaku[0]) > hikaku[1]:
        ten[0] +=3

    else:
        ten[0]+=1
        ten[1]+=1

print(" ".join(map(str,ten)))

### FIXED CODE ###

turn=int(input())
ten=[0,0]

for _ in range(turn):
    hikaku = input().split()
    if hikaku[0] < hikaku[1]:
        ten[1] +=3

    elif hikaku[0] > hikaku[1]:
        ten[0] +=3

    else:
        ten[0]+=1
        ten[1]+=1

print(" ".join(map(str,ten)))
n=int(input())
balls=list(map(int,input().split()))
ans=[0]*n;m=0
for i in range(n)[::-1]:
  d=i+1
  c=n//d
  check=0
  while d*(c+1)<=n:
    check+=ans[d*(c+1)-1]
    c+=1
  if check!=balls[i]:
    ans[i]=1
    m+=1
print(m)
print(" ".join(ans))

### FIXED CODE ###

n=int(input())
balls=list(map(int,input().split()))
ans=[0]*n;m=0;al=[]
for i in range(n)[::-1]:
  d=i+1
  c=n//d
  mal=2
  check=0
  while d*mal<=n:
    check+=ans[d*mal-1]
    mal+=1
  check%=2
  if check!=balls[i]:
    ans[i]=1
    al.append(str(d))
    m+=1
print(m)
print(" ".join(al))
bingo = [[],[],[]]
 
for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())
  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
  ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
  ANS = 0
 
if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yse")
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yse")
  else:
    print("No")
 
 


### FIXED CODE ###

N = int(input())
print(int((N+1)/2))
#参考
#https://atcoder.jp/contests/aising2019/submissions/3995168

import sys
input = sys.stdin.readline

import bisect

N,Q=map(int,input().split())

A=list(map(int,input().split()))

Asum=[0]*N
Asum2=[0]*N
total=0
X=[]
for i in range(N):
  total+=A[i]
  Asum[i]=total
  if i>1:
    Asum2[i]=A[i]+Asum2[i-2]
  else:
    Asum2[i]=A[i]
    
for i in range(Q):
  X.append((int(input()),i))
X.sort(key=lambda x :x[0])
  

#yで高橋くんと青木くんの取りたいカードが初めて衝突すると考える。
#このようなyは半分より小さい所にはないので初期値を半分のところとする。
#yがNまで来た時は最初から交互に取る
#Xを小さい順から計算することで、yの値が単調増加になる
y=N//2-1
ans=[0]*Q
for x,i in X:
  while x>A[y] and y<=N-1:
    y+=1
  while y<=N-1:
    takahashi=N-y
    aoki=y+1-bisect.bisect_left(A,x-(A[y]-x))
    if takahashi>aoki:
      y+=1
    else:
      break;
  #右端からA[y]までは全て高橋くんが取る
  ans[i]+=Asum[N-1]-Asum[y-1]
  #青木くんはyからN-y個取っているので、その下のところから交互に取る
  if y-(N-y)-1<0:
    continue;
  ans[i]+=Asum2[y-(N-y)-1]

for i in range(Q):
  print(ans[i])

### FIXED CODE ###

#参考
#https://atcoder.jp/contests/aising2019/submissions/3995168

import bisect

N,Q=map(int,input().split())

A=list(map(int,input().split()))
Asum=[0]*N
Asum2=[0]*N
total=0

for i in range(N):
  total+=A[i]
  Asum[i]=total
  if i>1:
    Asum2[i]=A[i]+Asum2[i-2]
  else:
    Asum2[i]=A[i]

X=[] 
for i in range(Q):
  X.append((int(input()),i))
X.sort(key=lambda x :x[0])
  

#yで高橋くんと青木くんの取りたいカードが初めて衝突すると考える。
#このようなyは半分より小さい所にはないので初期値を半分のところとする。
#yがNまで来た時は最初から交互に取る
#Xを小さい順から計算することで、yの値が単調増加になる
y=N//2-1
ans=[0]*Q
for x,i in X:
  while y<=N-1 and x>A[y]:
    y+=1
  while y<=N-1:
    takahashi=N-y
    aoki=y+1-bisect.bisect_left(A,x-(A[y]-x))
    if takahashi>aoki:
      y+=1
    else:
      break
  #右端からA[y]までは全て高橋くんが取る
  ans[i]+=Asum[N-1]-Asum[y-1]
  #青木くんはyからN-y個取っているので、その下のところから交互に取る
  if y-(N-y)-1<0:
    continue
  ans[i]+=Asum2[y-(N-y)-1]

for i in range(Q):
  print(ans[i])
#include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int i = m; i < n; ++i)

int main() {
  int N, K;
  string S;
  cin >> N >> K >> S;
  S.push_back('2');
  vector<int> A;
  if(S[0] == '0') A.push_back(0);
  int cnt = 1;
  rep(i, 1, S.size()) {
    if(S[i] == S[i-1]) cnt++;
    else {
      A.push_back(cnt);
      cnt = 1;
    }
  }
  if(S.back() == '0') A.push_back(0);
  int ans = 0;
  int r = 0;
  int sum = 0;
  for(int l = 0; l < A.size(); l++){
    while(r < A.size() && r - l < 2 * K + 1){
      sum += A[r];
      r++;
    }
    if(l % 2 == 0) ans = max(ans, sum);
    if(l == r) r++;
    else sum -= A[l];
  }
  cout << ans << endl;
  return 0;
}


### FIXED CODE ###

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

A = []
if S[0] == '0':
  A.append(0)

cnt = 1
for i in range(1, len(S)):
  if S[i] == S[i-1]:
    cnt += 1
  else:
    A.append(cnt)
    cnt = 1

ans = 0
tot = 0
r = 0

for l in range(len(A)):
  while r < len(A) and r - l < 2 * K + 1:
    tot += A[r]
    r += 1
  if l % 2 == 0:
    ans = max(ans, tot)
  if l == r:
    r += 1
  else:
    tot -= A[l]

print(ans)
O=input()
E=input() + ''
print(''.join([O[i]+E[i] for i in range(len(O))]))

### FIXED CODE ###

O=input()
E=input() + ' '
print(''.join([O[i]+E[i] for i in range(len(O))]))
n, d = map(int, input().split())
lst = [[int(j) for j in input().split()] for i in range(n)]
count = 0
for d in lst:
  distance = (d[0]**2 + d[1]**2)**0.5
  if distance <= d:
    count += 1
print(count)

### FIXED CODE ###

n, d = map(int, input().split())
lst = [[int(j) for j in input().split()] for i in range(n)]
count = 0
for x in lst:
  distance = (x[0]**2 + x[1]**2)**0.5
  if distance <= d:
    count += 1
print(count)
data = []
try:
    while True:
        data.append(raw_input())

except EOFError:
        pass

for i in data:
    a, b, c, d, e, f = i.split()
    a, b, c, d, e, f = int(a), int(b), int(c), int(d), int(e), int(f)
    if (abs(a) <= 1000
        and abs(b) <= 1000
        and abs(c) <= 1000
        and abs(d) <= 1000
        and abs(e) <= 1000
        and abs(f) <= 1000):
        for j in range(-1000, 1001):
            y1 = (c - (a * j)) / float(b)
            y2 = (f - (d * j)) / float(e)
            if y1 == y2:
                print "{:.3f} {:.3f}".format(j, y1)
                break

### FIXED CODE ###

data = []
try:
    while True:
        data.append(raw_input())

except EOFError:
    pass

for i in data:
    a, b, c, d, e, f = map(float, (i.split()))
    if (abs(a) <= 1000
        and abs(b) <= 1000
        and abs(c) <= 1000
        and abs(d) <= 1000
        and abs(e) <= 1000
        and abs(f) <= 1000):
        y = (a*f - c*d) / (a*e - b*d)
        x = (c - b*y) / a
        print "{:.3f} {:.3f}".format(x, y)
N = int(input())
A = list(map(int, input().split(" ")))
abs_list = list(map(abc, A))
sort(A)
sort(abs_list)

if (N % 2 == 0):
	print(sum(abs_list))
else:
	print(sum(abs_list[1:]))


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split(" ")))
abs_list = list(map(abs, A))
abs_list.sort()
pos = list(filter(lambda x: x > 0, A))
neg = list(filter(lambda x: x < 0, A))
pos.sort()
neg.sort()

# A has 0
if abs_list[0] == 0:
	print(sum(abs_list))
elif len(neg) % 2 == 0:
	print(sum(abs_list))
elif len(pos) > 0 and abs(pos[0]) < abs(neg[-1]):
	print(sum(abs_list) - 2*pos[0])
else:
	print(sum(abs_list[1:])-abs_list[0])
N, D = map(int, input().split())
X = np.zeros((N, D), np.int8)
for i in range(N):
  X[i,:] = list(map(int, input().split()))

ans = 0
for i in range(N):
  for j in range(i+1, N):
    dist_sq = 0
    for x, y in zip(X[i], X[j]):
      dist_sq += (x - y) ** 2

    dist = dist_sq ** 0.5
    #print(i, j, dist)

    if dist - int(dist) == 0:
      ans += 1

print(ans)

### FIXED CODE ###

N, D = map(int, input().split())
X = []
for i in range(N):
  X.append(list(map(int, input().split())))
#print(X)

ans = 0
for i in range(N):
  for j in range(i+1, N):
    dist_sq = 0
    for x, y in zip(X[i], X[j]):
      dist_sq += (x - y) ** 2

    dist = dist_sq ** 0.5
    #print(i, j, dist)

    if dist - int(dist) == 0:
      ans += 1

print(ans)
import math

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)
    if temp!=1:
        arr.append(temp)
    return arr
  
a_list = factorization(a)
b_list = factorization(b)

d = math.gcd(a,b)
d_list = factorization(d)
print(len(d_list)+1)


### FIXED CODE ###

from fractions import gcd

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    return arr
  
d = gcd(a,b)
print(len(factorization(d)) + 1)
a, b=map(str, input().split())
if int(a)<int(b):
	c=a
    a=b
    b=c
print(b*int(a))

### FIXED CODE ###

a, b=map(str, input().split())
if int(a)<int(b):
	c=a
	a=b
	b=c
print(b*int(a))
n,i = list(map,int(input().split()))
print(n-i+1)

### FIXED CODE ###

n,i = list(map(int,input().split()))
print(n-i+1)
x = int(input())
l = set([])
i = 1
while i < x:
    j = 2
    while j < 10:
        if i**j <= x:
            l.add(i**j)
        j += 1
    i += 1

print(max(l))

### FIXED CODE ###

x = int(input())
l = set([1])
i = 1
while i < x:
    j = 2
    while j < 10:
        if i**j <= x:
            l.add(i**j)
        j += 1
    i += 1

print(max(l))
H,W = map(int,input().split())

A = ""

for _ in range(H):
  s = input()
  if len(set(s)) == 1 and s == "." * W:
    H -= 1
  else:
    for i in s:
      A.append(i)

if len(A) == 0:
  print(A)

else:
  M = []

  for i in range(W):
    if A[i] == ".":
      for j in range(i + W,H * W,W):
        if A[j] == "#":
          break
      else:
        M.append(i)

  A = [A[i] for i in range(H * W) if not (i % W) in M]
  W = W - len(M)
  
  S = ""
  
  for i in range(H * W):
    S += A[i]
    if (i + 1) % W == 0:
      print(S)
      S = ""

### FIXED CODE ###

H,W = map(int,input().split())

A = ""

for _ in range(H):
  s = input()
  if len(set(s)) == 1 and s == "." * W:
    H -= 1
  else:
    for i in s:
      A += i

if len(A) == 0:
  print(A)

else:
  M = []

  for i in range(W):
    if A[i] == ".":
      for j in range(i + W,H * W,W):
        if A[j] == "#":
          break
      else:
        M.append(i)

  A = [A[i] for i in range(H * W) if not (i % W) in M]
  W = W - len(M)
  
  S = ""
  
  for i in range(H * W):
    S += A[i]
    if (i + 1) % W == 0:
      print(S)
      S = ""
X = input()
if X >= 30:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

X = int(input())
if X >= 30:
    print("Yes")
else:
    print("No")
N = int(input())
I = int(input())

if I <= 13:
    print(N)
elif: 6 <= I <=12:
    print(N/2)
elif: I <= 5
    print("0")

### FIXED CODE ###

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

c = 0
if a >= 13:
    print(b)
elif 6 <= a <=12:
    c = int(b /2)
    print(c)
elif a <= 5:
    print("0")
K = int(input)
a = K//2
b = K-a
print(a*b)

### FIXED CODE ###

K = int(input())
a = K//2
b = K-a
print(a*b)
import numpy as np

n = int(input())
max_n = int(n ** 0.5)
memo = np.zeros((max_n, max_n, max_n))

ans = [0]*(n+1)

for x in range(1, max_n):
    for y in range(1, max_n):
        for z in range(1, max_n):
            s = x**2+y**2+z**2+x*y+y*z+z*x
            if s <= 1000:
                ans[s] += 1


for i in range(1, n+1):
    print(ans[i])


### FIXED CODE ###

import numpy as np

n = int(input())
max_n = int(n ** 0.5)
memo = np.zeros((max_n, max_n, max_n))

ans = [0]*(n+1)

for x in range(1, max_n):
    for y in range(1, max_n):
        for z in range(1, max_n):
            s = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if s < n+1:
                ans[s] += 1


for i in range(1, n+1):
    print(ans[i])
c=0
if (b-a)>k+1:
  c=1
elif (a%k)-(b%k)>=0:
    c=1
else:
  c=0
if c==1:
  print('ok')
else:
  print('ng')

### FIXED CODE ###

k=int(input())
suzi_list=input().split()
a=int(suzi_list[0])
b=int(suzi_list[1])
c=(b//k)*k
if a<=c:
  print('OK\n')
else:
  print('NG\n')
# 全域木？っていうんだっけ？でもコストは関係ないか
# 適当に隣接リストでもってしてDFSする
N, M = map(int, input().split())
Neighbor_list = [[] for _ in range(n)]
for _ in range(M):
    s, t = map(int, input().split())
    Neighbor_list[s-1].append(t-1)
    Neighbor_list[t-1].append(s-1)


def dfs(cur, path):
    if len(path) == N:
        return 1
    else:
        ret = 0
        for neighbor in Neighbor_list[cur]:
            if neighbor not in path:
                next_list = path[:]
                next_list.append(neighbor)
                ret += dfs(neighbor, next_list)
        return ret


print(dfs(0, []))


### FIXED CODE ###

# 全域木？っていうんだっけ？でもコストは関係ないか
# 適当に隣接リストでもってしてDFSする
N, M = map(int, input().split())
Neighbor_list = [[] for _ in range(N)]
for _ in range(M):
    s, t = map(int, input().split())
    Neighbor_list[s-1].append(t-1)
    Neighbor_list[t-1].append(s-1)


def dfs(cur, path):
    if len(path) == N:
        return 1
    else:
        ret = 0
        for neighbor in Neighbor_list[cur]:
            if neighbor not in path:
                next_list = path[:]
                next_list.append(neighbor)
                ret += dfs(neighbor, next_list)
        return ret


print(dfs(0, [0]))
import math;print(int((lambda l:math.floor(1e-5+math.log2(l[1]/l[0]))+1))(list(map(int,input().split()))))


### FIXED CODE ###

X,Y = map(int,input().split())
ans = 0
while X <= Y:
	ans += 1
	X *= 2
print(ans)
import sys
input = sys.stdin.buffer.readline

N = int(input())
AB = [list(map(int, input().split)) for _ in range(N - 1)]

graph = [[] for _ in range(N + 1)]
for a, b in AB:
    graph[a].append(b)
    graph[b].append(a)
  
def make_tree(graph, root) -> (list, list, list):
    INF = 10 ** 15
    dist = [INF] * len(graph)
    parent = [-1] * len(graph)
    stack = [root]
    dist[root] = 0
    order = []
    parent[root] = root
    while stack:
        s = stack.pop()
        order.append(s)
        for g in graph[s]:
            if dist[g] > dist[s] + 1:
                dist[g] = dist[s] + 1
                parent[g] = s
                stack.append(g)
    return dist, parent, order
  
def lca(u, v, dist, parent):
    distu, distv = dist[u], dist[v]
    if distu > distv:
        for _ in range(distu - distv):
            u = parent[u]
    if distv > distu:
        for _ in range(distv - distu):
            v = parent[v]
    while u != v:
        u, v = parent[u], parent[v]
    return u

### FIXED CODE ###

N, M = map(int, input().split())

print("Yes" if N == M else "No")
lst = map(int, input().split())
print("YES" if lst.count(5) == 2 and lst.count(7) == 1 else "NO")

### FIXED CODE ###

lst = list(map(int, input().split()))
print("YES" if lst.count(5) == 2 and lst.count(7) == 1 else "NO")
A = input()
for i in range(A)
	B = int(A)

if A % B == 0 :
  print("Yes")
else:
  print("No")

### FIXED CODE ###

A = int(input())
B = A
list=[]
while B > 0:
    list.append(B%10)
    B //=10
    #print(list)
if A % sum(list) == 0:
    print("Yes")
else :
    print("No")
from collections import defaultdict
from scipy.sparse.csgraph import shortest_path
import numpy as np
N, X, Y = map(int, input().split())
edges = [[0 for _ in range(N)] for _ in range(N)]
for i in range(N-1):
    edges[i][i + 1] = 1
    edges[i + 1][i] = 1
X -= 1
Y -= 1
edges[X][Y] = 1
edges[Y][X] = 1
res = shortest_path(np.array(edges))
ans = defaultdict(int)
for i in range(N-1):
    for j in range(i+1, N):
        ans[int(res[i][j])] += 1
for k in range(1, N):
    print(ans[k])

### FIXED CODE ###

from collections import defaultdict
N, X, Y = map(int, input().split())
d = [[0 for _ in range(N)] for _ in range(N)]
for i in range(N-1):
    for j in range(i+1, N):
        d[i][j] = d[i][j-1] + 1
X -= 1
Y -= 1
for i in range(N-1):
    for j in range(i + 1, N):
        diff = abs(X - i) + abs(Y - j) + 1
        if diff < d[i][j]:
            d[i][j] = diff
#print(d)
ans = defaultdict(int)
for i in range(N-1):
    for j in range(i + 1, N):
        ans[d[i][j]] += 1
for k in range(1, N):
    print(ans[k])
def iterate_position():
        yield list(map(int, sys.stdin.readline().rstrip().split()))

    N = int(sys.stdin.readline().rstrip())
    now_position = [0, 0, 0]
    for x in range(N):
        try:
            next_position = next(iterate_position())
            dt = next_position[0] - now_position[0]
            dx = next_position[1] - now_position[1]
            dy = next_position[2] - now_position[2]
            if dt < abs(dx) + abs(dy):
                print("No")
                sys.exit()
            check = dt - (dx + dy)
            if check % 2 == 1:
                print("No")
                sys.exit()
            now_position = next_position
        except StopIteration:
            print("No")
    else:
        print("Yes")

### FIXED CODE ###

import sys
import math

def main():
    def iterate_position():
        yield list(map(int, sys.stdin.readline().rstrip().split()))

    N = int(sys.stdin.readline().rstrip())
    now_position = [0, 0, 0]
    for x in range(N):
        try:
            next_position = next(iterate_position())
            dt = next_position[0] - now_position[0]
            dx = next_position[1] - now_position[1]
            dy = next_position[2] - now_position[2]
            if dt < abs(dx) + abs(dy):
                print("No")
                sys.exit()
            check = dt - (dx + dy)
            if check % 2 == 1:
                print("No")
                sys.exit()
            now_position = next_position
        except StopIteration:
            print("No")
    else:
        print("Yes")

if __name__ == '__main__':
    main()
from collections import Counter
from functools import reduce
import fractions
import pprint
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # greatest common divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # least common multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))


N, W = MI()
dp = [[0 for i in range(20)] for i in range(N+1)]

for i in range(N):
    w, v = MI()
    for sum_w in range(W+1):
        if sum_w - w >= 0:
            dp[i+1][sum_w] = max(dp[i][sum_w - w] + v, dp[i+1][sum_w])
        
        dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w])

P(max(dp[-1]))


### FIXED CODE ###

N, W = map(int,input().split())
dp = [[0 for i in range(100001)] for i in range(N+1)]

for i in range(N):
    w, v = map(int, input().split())
    for sum_w in range(W+1):
        if sum_w - w >= 0:
            dp[i+1][sum_w] = max(dp[i][sum_w - w] + v, dp[i+1][sum_w])

        dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w])

print(max(dp[-1]))
N,C = list(map(int,input().split()))

discomforts = [[0]*(N+1)]
for _ in range(C):
    discomforts.append([0,*map(int,input().split())])
print(discomforts)
grid = [[0]*(N+1)]
for _ in range(N):
    grid.append([0,*map(int,input().split())])

color_counts = [[0]*(C+1) for i in range(3)]

for i in range(1,N+1):
    for j in range(1,N+1):
        color_counts[(i+j)%3][grid[i][j]] += 1

ans = float('inf')
for c0 in range(1,C+1):
    for c1 in range(1,C+1):
        for c2 in range(1,C+1):
            if c0 != c1 and c1 != c2 and c2 != c0:
                total = 0
                for i in range(1,C+1):
                    total += discomforts[i][c0]*color_counts[0][i]
                    total += discomforts[i][c1]*color_counts[1][i]
                    total += discomforts[i][c2]*color_counts[2][i]
                ans = min(ans,total)
print(ans)

### FIXED CODE ###

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

discomforts = [[0]*(N+1)]
for _ in range(C):
    row = [0]
    row.extend(list(map(int,input().split())))
    discomforts.append(row)
grid = [[0]*(N+1)]
for _ in range(N):
    row = [0]
    row.extend(list(map(int,input().split())))
    grid.append(row)

color_counts = [[0]*(C+1) for i in range(3)]

for i in range(1,N+1):
    for j in range(1,N+1):
        color_counts[(i+j)%3][grid[i][j]] += 1

ans = float('inf')
for c0 in range(1,C+1):
    for c1 in range(1,C+1):
        for c2 in range(1,C+1):
            if c0 != c1 and c1 != c2 and c2 != c0:
                total = 0
                for i in range(1,C+1):
                    total += discomforts[i][c0]*color_counts[0][i]
                    total += discomforts[i][c1]*color_counts[1][i]
                    total += discomforts[i][c2]*color_counts[2][i]
                ans = min(ans,total)
print(ans)
N = int(input())
A = list(map(int, input().split()))

# 各数字の個数を格納
dict = {}
for a in A:
    if a in dict:
        dict[a] += 1
    else:
        dict[a] = 1

# k番目の値を除いたlistで同じ数字を引く回数を出力
memo = {}
for k in range(N):
    ans = 0
    m = A[k]
    if m in memo.keys():
        ans = memo[m]
    else:
        dict_work = dict.copy()
        dict_work[m] -= 1
        for d in dict_work.values():
            if d > 1:
                ans += (d * (d - 1)) // 2
        memo[m] = ans
    print(ans)


### FIXED CODE ###

L = int(input())

print((L/3)**3)
a = int(input())
b = int(input())
h = int(input())
ans = (a+b)*h//2
input(ans)


### FIXED CODE ###

a = int(input())
b = int(input())
h = int(input())
ans = (a+b)*h//2
print(ans)
import math

k = int(input())

if k%2:
    print(math.floor(k/2)*math.cei(k/2))
else:
    print((k/2)*2)

### FIXED CODE ###

import math

k = int(input())

if k%2:
    print(math.floor(k/2)*math.ceil(k/2))
else:
    print(int((k/2)**2))
def solve(string):
    n, *a = map(int, string.split())
    a = sorted(a)
    return str(abs(a[0] - a[-1]))


if __name__ == '__main__':
    print(solve(input()))

   

### FIXED CODE ###

def solve(string):
    n, *a = map(int, string.split())
    a = sorted(a)
    return str(abs(a[0] - a[-1]))


if __name__ == '__main__':
    print(solve("\n".join([input(), input()])))
from statistics import mean
import math
N = int(input())
*A, = map(int, input().split())
B = [A[i]-i for i in range(N)]
bm = median(B)
K = [x - bm for x in B]
KZ = [abs(x) for x in K]
Z = sum(KZ)
for i in range(200):
    C = [abs(x-i+100) for x in K]
    Z = min([sum(C),Z])
print(int(Z))

### FIXED CODE ###

from statistics import median
import math
N = int(input())
*A, = map(int, input().split())
B = [A[i]-i for i in range(N)]
b = median(B)
bm = math.floor(b)
K = [x - bm for x in B]
KZ = [abs(x) for x in K]
Z = sum(KZ)
for i in range(20):
    C = [abs(x-i+10) for x in K]
    Z = min([sum(C),Z])
print(int(Z))
A,B = map(int,input())
if(A<10 and B<10):
  print(A*B)
else:
  print(-1)

### FIXED CODE ###

A,B = map(int,input().split())
if(A<10 and B<10):
  print(A*B)
else:
  print(-1)