Harryxun/stf_run huggingface dataset:
import collections
import numpy as np
# import math
import itertools

N = int(input())

moji = [input() for _ in range(N)]

check = np.zeros((N, N))


for i in range(N):
    c = []
    x = collections.Counter(moji[i])

    c.append(i)

    for j in range(i + 1, N):
        if check[i, j] == 1:
            continue

        y = collections.Counter(moji[j])

        if x == y:
            c.append(j)

    for v in itertools.combinations(c, 2):
        check[v] = 1

# print(check)
print(int(np.sum(check)))

### FIXED CODE ###

N = int(input())
moji_lst = [input() for _ in range(N)]

dic = {}
cnt = 0

for moji in moji_lst:
    x = ''.join(sorted(moji))

    if x in dic:
        dic[x] += 1
        cnt += dic[x]
    else:
        dic[x] = 0


print(cnt)
from fractions import gcd
from functools import reduce
n=int(input())
h=[int(a) for a in input().split()]
ans=0
for i in range(n):
  del h[i]
  ans=max(reduce(gcd,h),ans)
print(ans)

### FIXED CODE ###

#ABC125C
from fractions import gcd
n=int(input())
a=list(map(int,input().split()))
l,r=[0]*(n+1),[0]*(n+1)
for i in range(n):
    l[i+1]=gcd(l[i],a[i])
for i in range(n,0,-1):
    r[i-1]=gcd(r[i],a[i-1])
ans=0
for i in range(n):
    ans=max(ans,gcd(l[i],r[i+1]))
print(ans)
N = input()
A = list(map(int,input().split()))
c = 0
d = -1
while c>d:
  d+=1
  for i in A:
    if i%2 == 0:
      continue
    else :
      print(c)
      break
  else :
    A=list(map(lambda x :x/2,A))
    c += 1



### FIXED CODE ###

mass = input()
s1 = int(mass[0])
s2 = int(mass[1])
s3 = int(mass[2])
c = 0
if s1 == 1:
  c += 1
if s2 == 1:
  c += 1
if s3 == 1:
  c += 1
print(c)
A,B=map(int,input().split())
elif A==B==1 :
    print("Draw")
if A==1:
    print("Alice")
elif B==1 :
    print("Bob")
elif A<B:
    print("Bob")
elif A>B:
    print("Alice")
elif A==B:
    print("Draw")

### FIXED CODE ###

A,B=map(int,input().split())
if A==B==1 :
    print("Draw")
elif A==1:
    print("Alice")
elif B==1 :
    print("Bob")
elif A<B:
    print("Bob")
elif A>B:
    print("Alice")
elif A==B:
    print("Draw")
a = list(map(int, input().split()))
 
p = [list(map(int, input().split())) for i in range(M)]
q = [list(map(int, input().split())) for i in range(Q)]
 
res = [[0]*N for i in range(N)]
 
def lsadd(L,R):
    L-=1
    R-=1
    for i in range(0,L+1):  
        res[i][R] += 1
 
for l,r in p:
    lsadd(l,r)
 
for l,r in q:
    print(sum(res[l-1][:r]))


### FIXED CODE ###

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

c = [[0 for i in range(a[0]+1)] for j in range(a[0]+1)]

for i in range(a[1]):
    n,m = map(int,input().split())
    c[n][m] += 1

d = [[0 for i in range(a[0]+4)] for j in range(a[0]+4)]

for i in range(a[0]+1):
    for j in range(a[0]+1):
        d[i][j+1] = d[i][j] + c[i][j]

for i in range(a[2]):
    n,m = map(int,input().split())
    s = 0
    for j in range(n,m+1):
        s += d[j][m+1] - d[j][j]
    print(s)
#create environment
import numpy as np
import pandas as pd
num = 1
i = 1
k = 1
df = pd.DataFrame()
count_num = 0
f = lambda x: (x**2)

#input1 N, D (numeric)
N, D = map(int, input().split())
#input2
for l in range(1, N):
  a = map(int, input().split())
  if a is none:
    break
  df[l] = a

# make combination
df_new = df.T
#print(df_new)
for i in range(0, len(df_new.index)):
  for j in range(k, len(df_new.index)):
#    print_str = str(i) + '-' + str(j)
#    print(print_str)
    k = k + 1
    df_new_ij = df_new.loc[[i,j],:]
    obj_num = np.sqrt(df_new_ij.apply(f).cumsum().iloc[1,:].cumsum()[len(df['a'])-1])
    
    if obj_num == round(obj_num):
      count_num = count_num + 1

#print
print(count_num)






### FIXED CODE ###

import math
n, d = map(int, input().split())
x = []
ans=0
for i in range(n):
        o = list(map(int, input().split()))
        x += [o]
for i in range(n):
        for j in range(i+1,n):
                dis_net = 0
                dis=0
                for u in range(d):
                        dis += (x[i][u] - x[j][u])** 2
                dis_net = math.sqrt(dis)
                if dis_net % 1 == 0 and dis_net>=1:
                        ans += 1
print(ans)
from queue import Queue
from collections import defaultdict
try:
    d = [[1, 0], [-1, 0], [0, 1], [0, -1]]
    H, W, N = map(int, input().split())
    G = []
    sx = sy = 0
    for i in range(H):
        G.append(input())
        for j, c in enumerate(G[i]):
            if c == 'S':
                sx, sy = i, j

    Q = Queue()
    Q.put((sx, sy, 0))
    visited = defaultdict(lambda: defaultdict(lambda: 0))
    # visited = [[False for _ in range(W)] for _ in range(H)]
    visited[sx][sy] = True
    target = 1

    while not Q.empty():
        x, y, step = Q.get()
        if G[x][y] == str(target):
            # visited = [[False for _ in range(W)] for _ in range(H)]
            # visited.clear()
            target += 1
            visited[x][y] = target
            while not Q.empty():
                Q.get()
            if target == N + 1:
                print(step)
                break
        for dx, dy in d:
            nx, ny = x + dx, y + dy
            if 0 <= nx < H and 0 <= ny < W and G[nx][ny] != 'X':
                if visited[nx][ny] != target:
                    visited[nx][ny] = target
                    Q.put((nx, ny, step + 1))

except BaseException as e:
    print(e)




### FIXED CODE ###

from collections import deque, defaultdict

d = [[1, 0], [-1, 0], [0, 1], [0, -1]]

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

G = []

sx = sy = 0
for i in range(H):
    G.append(input())
    for j, c in enumerate(G[i]):
        if c == 'S':
            sx, sy = i, j


Q = deque()
Q.append((sx, sy, 0))
visited = defaultdict(lambda: defaultdict(int))
visited[sx][sy] = 1

target = '1'

while len(Q):
    x, y, step = Q.popleft()
    if G[x][y] == target:
        visited.clear()
        Q.clear()
        target = str(int(target) + 1)
        if target == str(N + 1):
            print(step)
            break
    for dx, dy in d:
        nx, ny = x + dx, y + dy
        if 0 <= nx < H and 0 <= ny < W and G[nx][ny] != 'X':
            if not visited[nx][ny]:
                visited[nx][ny] = 1
                Q.append((nx, ny, step + 1))
n,k = list(map(int,input().split()))
A = list(map(int,input().split()))

if k == 1:exit(print(A[0]))
t = 0
dp = [-1] * n
dp[0] = 0
for i in range(1,k+1):
  t = A[t]-1
  if dp[t] != -1:break
  dp[t] = i
if k == 2:
  exit(print(t+1))
l = i - dp[t]
K = (k-dp[t])%l + dp[t]
print(dp)
for i in range(n):
  if dp[i] == K:exit(print(i+1))



### FIXED CODE ###

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

if k == 1:exit(print(A[0]))
t = 0
dp = [-1] * n
dp[0] = 0
flg = 0
for i in range(1,k+1):
  t = A[t]-1
  if dp[t] != -1:
    flg = 1
    break
  dp[t] = i
if flg == 0:
  exit(print(t+1))
elif k == 2:
  exit(print(t+1))

l = i - dp[t]
K = (k-dp[t])%l + dp[t]

for i in range(n):
  if dp[i] == K:exit(print(i+1))
a = input()
print(a if a % 2 == 0 else a * 2)

### FIXED CODE ###

a = input()
print(a if a % 2 == 0 else a * 2)
N = int(input())
v = list(map(int, input().split()))
answer = reduce(lambda x,y: x*y, v)
answer = answer if answer <= 1000000000000000000 else -1
print(answer)

### FIXED CODE ###

N = int(input())
v = list(map(int, input().split()))
limit = 10 ** 18

answer = 1
if 0 in v:
  answer = 0
else:
  for i in v:
    answer = answer * i
    if answer <= limit:
      continue
    else:
      answer = -1
      break
print(answer)
l,r =map(int,input().split())

minimum = l%2019
maximum = r%2019

ans = 10000
if r-l >= 673:
    print(0)    
elif r-l < 2019:
    for i in range(l,r):
        if i%673 ==0:
            flag = 1
        ans = min(i*(i+1)%2019,ans)
    
    if flag==1:
        print(0)
    else:
        print(ans)

### FIXED CODE ###

l,r =map(int,input().split())

ans = 10000
if r-l >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            ans = min(ans, i*j%2019)
    print(ans)
W, H, N = map(int, input().split())
maxX,minX,maxY,minY = W, 0, H ,0
for i in range(N):
    x, y, a = map(int, input().split())
    if a == 1 and x > minX:
        minX = x
    elif a == 2 and x < maxX:
        maxX = x
    elif a == 3 and y > minY:
        minY = y
    elif a == 4 and y < maxY:
        maxY = y
        
xl = maxX - minX
yl = maxY - minY
if x1 > 0 and y1 > 0:
    print(x1*y1)
else:
    print(0)

### FIXED CODE ###

W, H, N = map(int, input().split())
maxX,minX,maxY,minY = W, 0, H ,0
for i in range(N):
    x, y, a = map(int, input().split())
    if a == 1 and x > minX:
        minX = x
    elif a == 2 and x < maxX:
        maxX = x
    elif a == 3 and y > minY:
        minY = y
    elif a == 4 and y < maxY:
        maxY = y
        
x1 = maxX - minX
y1 = maxY - minY
if x1 > 0 and y1 > 0:
    print(x1*y1)
else:
    print(0)
import unittest

from A03 import solve
from A03 import parse_input

class TestA03Solve(unittest.TestCase):

    def test_solve(self):

        lines_as_string = """
5
1 1 2 2
"""

        r = parse_input(lines_as_string)
        for i, e in enumerate(r):
            print("e[%d]=%s" % (i, e))
        print("")
        self.assertEqual(solve(*r), [2,2,0,0,0])

        lines_as_string = """
10
1 1 1 1 1 1 1 1 1
"""

        r = parse_input(lines_as_string)
        for i, e in enumerate(r):
            print("e[%d]=%s" % (i, e))
        print("")
        self.assertEqual(solve(*r), [9,0,0,0,0,0,0,0,0,0]) 


if __name__ == '__main__':
    unittest.main()
                                         

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)


def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]
    
    (n, ) = [int(e) for e in lines[0].split(" ")]
    a = [int(e) for e in lines[1].split(" ")]

    return (n, a)


def solve(n, a):

    result = dict([(i, 0) for i in range(1, n+1)])

    for i in range(n-1):
        result[a[i]] = result[a[i]] + 1

    return  list(result.values())


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
N = int(input())
arr = list(map(int, input().split()))
 
ans = []
 
for idx1 in range(1, N+1):
	for idx2 in range(len(arr), 1, -1):
		if arr[idx2-1] == idx2:
			ans.append(arr.pop(idx2-1))
			break
		elif idx2 == 1:
			exit(-1)
 
for idx in range(0, N):
	print(ans.pop(-1))
  	print("\n")


### FIXED CODE ###

N = int(input())
arr = list(map(int, input().split()))
 
ans = []
 
for idx1 in range(1, N+1):
	for idx2 in range(len(arr), 0, -1):
		if arr[idx2-1] == idx2:
			tmp = arr.pop(idx2-1)
			ans.append(tmp)
			break
		elif idx2 == 1:
			print(-1)
			exit()

for idx in range(0, N):
	tmp = ans.pop(-1)
	print(tmp)
// B103.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int a[3];
	cin >> a[2] >> a[1] >> a[0];
	sort(a, a + 3);
	cout << abs(a[0] - a[1]) + abs(a[1] - a[2]) << endl;

	return 0;
}


### FIXED CODE ###

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

A.sort()
print(abs(A[1]-A[0])+ abs(A[2]-A[1]))
from functools import reduce
from fractions import gcd
n = input()
a = list(map(int,input().split()))
gd = reduce(gcd,a)
m = reduce(lambda a,b: a*b,a)/gd -1
sum = sum(map(lambda x: m%x,a))

print(int(sum))

### FIXED CODE ###

from functools import reduce
from fractions import gcd

n = input()
a = list(map(int,input().split()))
gd = reduce(gcd,a)
m = reduce(lambda a,b: a*b,a)//gd -1
sum = sum(map(lambda x: m%x,a))

print(int(sum))
h,w,d = map(int,input().split())
hw = {}
for i in range(h):
        check = list(map(int,input().split()))
        for j in range(w):
                hw[check[j]] = [i+1,j+1]
q = int(input())
for i in range(q):
        l,r = map(int,input().split())
        x,y = hw[l][0],hw[l][1]
        check = 0
        while True:
                if l == r:print(check);break
                l = (d + l)%(h*w)
                check += abs(hw[l][0]-x) + abs(hw[l][1]-y)
                x,y = hw[l][0],hw[l][1]

### FIXED CODE ###

h,w,d = map(int,input().split())
hw = [[-1,-1]]*(h*w)
for i in range(h):
        ls = list(map(int,input().split()))
        for j in range(len(ls)):
                hw[ls[j]-1] = [j,i]
check = [0]*(h*w)
for i in range(h*w):
        if i + d > h*w-1:break
        check[i] = abs(hw[i][0]-hw[i+d][0]) + abs(hw[i][1]-hw[i+d][1])
ios = [0]*(w*h)
for i in range(d):
        c = 0;beforj = 0
        for j in range(h*w-1-i,-1,-d):
                if c == 0:c = 1;beforj = j;continue
                ios[j] = ios[beforj] + check[j]
                beforj = j
q = int(input())
for i in range(q):
        l,r = map(int,input().split())
        print(ios[l-1]-ios[r-1])
h, n = map(int, input().split())
a = input().split()
b = 0
def has_duplicates(seq):
    return len(seq) != len(set(seq))

for i in range(n):
    b += int(a[i])
if (h > b):
    print("No")
else:
    print("Yes")

### FIXED CODE ###

a, b = map(int, input().split())
c = a//b
if (a%b == 0):
    d = c
else :
    d = c+1
print(d)
h, w = map(int, input().split())

grid = []
for _ in range(w):
    grid.append([x == '#' for x in input()])

maxd = 0
for i in range(h):
    for j in range(w):
        if grid[i][j] is False:
            mind = 10000000
            for ii in range(h):
                for jj in range(w):
                    if grid[ii][jj] is True:
                        d = abs(i - ii) + abs(j - jj)
                        if d < mind:
                            mind = d
            if mind > maxd:
                maxd = mind

print(maxd)


### FIXED CODE ###

h, w = map(int, input().split())

grid = [[True] * (w + 2)]
for _ in range(h):
    grid.append([True] + [x == '#' for x in input()] + [True])
grid.append([True] * (w + 2))

q = []

for i in range(1, h + 1):
    for j in range(1, w + 1):
        if grid[i][j] is True:
            q.append((i, j))

cnt = 0
while q:
    qq = []
    for i, j in q:
        if not grid[i + 1][j]:
            grid[i + 1][j] = True
            qq.append((i + 1, j))
        if not grid[i - 1][j]:
            grid[i - 1][j] = True
            qq.append((i - 1, j))
        if not grid[i][j + 1]:
            grid[i][j + 1] = True
            qq.append((i, j + 1))
        if not grid[i][j - 1]:
            grid[i][j - 1] = True
            qq.append((i, j - 1))

    cnt += 1
    q = qq

print(cnt - 1)
import numpy as np

n = int(input())
lst = []
for _ in range(n):
  lst.append(int(input()))
max_idx = np.argmax(lst)
max_ = lst[max_idx]
lst[max_idx] = 0
next_max_ = max(lst)

for i in range(lst):
  if i == max_idx:
    print(next_max_)
  else:
    print(max_)

### FIXED CODE ###

import numpy as np

n = int(input())
lst = []
for _ in range(n):
  lst.append(int(input()))
max_idx = np.argmax(lst)
max_ = lst[max_idx]
lst[max_idx] = 0
next_max_ = max(lst)

for i in range(len(lst)):
  if i == max_idx:
    print(next_max_)
  else:
    print(max_)
import math
def c(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N,K = [int(i) for i in input().split()]
for i in range(1,K+1):
    num1 = c(K-1,i-1) % (10**9+7)
    num2 = c(N-K+1,i) % (10**9+7)
    ans = (num1*num2) % (10**9+7)
    print(ans)

### FIXED CODE ###

def c(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 #出力の制限
N = 10**4
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 )

N,K = [int(i) for i in input().split()]
for i in range(1,K+1):
    num1 = c(K-1,i-1,mod)
    num2 = c(N-K+1,i,mod)
    ans = (num1*num2) % (10**9+7)
    print(ans)
N = int(input())
A = list(map(int, input().split()))
seen = [0]*(200000+1)
A.sort()
ans = 0
for a in A:
    if seen[a] == 0:
        ans += 1
        x = a
        j = 1
        while x <= 200000:
            seen[x] = 1
            j += 1
            x = a*j
print(ans)

### FIXED CODE ###

from collections import Counter
 
N = int(input())
A_raw = Counter(list(map(int, input().split())))
A = [x[0] for x in A_raw.items() if x[1] == 1]
A.sort()
B = [x[0] for x in A_raw.items() if x[1] > 1]
B.sort()
seen = [0]*(1000000+1)
for b in B:
    if seen[b] == 0:
        x = b
        j = 1
        while x <= 1000000:
            seen[x] = 1
            j += 1
            x = b*j
ans = 0
for a in A:
    if seen[a] == 0:
        ans += 1
        x = a
        j = 1
        while x <= 1000000:
            seen[x] = 1
            j += 1
            x = a*j
print(ans)
A,B = map(int, input().split())
count = 0
socketnumber = A
while socketnumber < B:
    socketnumber += (A-1)
    count += 1
count += 1
print (count)
    

### FIXED CODE ###

S = input()
T = input()
count = 0
forecastlist = []
realweatherlist = []
for forecast in S:
  forecastlist.append(forecast)
for weather in T:
  realweatherlist.append(weather)
  
for i in range(3):
  if forecastlist[i] == realweatherlist[i]:
    count += 1
print(count)
N,D = map(int,input().split())
lst = [[int(kk) for kk in input().split()] for aa in range(N)]
tot = 0
c = 0
for a in range(N):
	for b in range(a):
      	c = 0
        for i in range(D):
			c += (lst[a][i]-lst[b][i])**2
        if sqrt(c) == int(sqrt(c)):
          	tot += 1
print(tot)
    	 	 

### FIXED CODE ###

from math import *
N,D = map(int,input().split())
lst = [[int(kk) for kk in input().split()] for aa in range(N)]
tot = 0
c = 0

for a in range(1,N):
    for b in range(a):
        c = 0
        for i in range(D):
            c += (lst[a][i] - lst[b][i])**2
        if sqrt(c) == int(sqrt(c)):
            tot += 1
print(tot)
from sys import stdin
n = int(stdin.readline().rstrip())
li = list(int(stdin.readline().rstrip()) for _ in range(n))
one = max(li)
two = sorted(li)[-2]
for i in range(n):
    if max(li) == li[i]:
        print(two)
    else:
        print(max(one)

### FIXED CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]
a_m = max(a)
a_i = a.index(a_m)
a.sort()
for i in range(len(a)):
  if i == a_i:
    print(a[-2])
  else:
    print(a_m)
A, B, K = map(int, input().split())
AB = list(range(A, B+1))
for i in AB[:K]:
    print(i)
for i in AB[-K:]:
    print(i)

### FIXED CODE ###

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

if b-a+1 <= 2*k:
    for num in range(a, b+1):
        print(num)
else:
    for num in range(a, a+k):
        print(num)
    for num in range(b-k+1,b+1):
        print(num)
L, R = map(int, input().split())
l_mod = L % 2019
r_mod = R % 2019
result = 2019
if l_mod > r_mod:
    print(0)
else:
    print(L_mod*(L_mod+1)%2019)

### FIXED CODE ###

L, R = map(int, input().split())
l_mod = L % 2019
r_mod = R % 2019
if R >2019+L:
    print(0)
else:
    mod = (l_mod*(l_mod+1)) % 2019
    for i in range(l_mod,r_mod):
        for j in range(i+1,r_mod+1):
            if mod>(i*j)%2019:
                mod=(i*j)%2019
    print(mod)
def min_cost(stones, N):
    def jump(stones, index, N):
        if index == N:
            return 0

        if dp[index] != -1:
            return dp[index]

        left = abs(stones[index] - stones[index + 1]) + jump(stones, index + 1, N)

        right = 2 ** 31
        if index + 2 <= N:
            right = abs(stones[index] - stones[index + 2]) + jump(stones, index + 2, N)

        dp[index] = min(left, right)

        return dp[index]

    dp = [-1] * N
    return jump(stones, 0, N - 1)


if __name__ == '__main__':
    N = int(input())
    stones = list(map(int, input().strip().split()))
    print(min_cost(stones, N))


'''
    stones = [30, 10, 60, 10, 60, 50]
    N = 6
    print(min_cost(stones, N))

    stones = [10, 30, 40, 20]
    N = 4
    print(min_cost(stones, N))
'''


### FIXED CODE ###



def min_cost(stones, N):
    space = [0] * N

    for i in range(1, N):
        one = abs(stones[i] - stones[i - 1]) + space[i - 1]
        
        two = 2 ** 31

        if i - 2 >= 0:
            two = abs(stones[i] - stones[i - 2]) + space[i - 2]

        space[i] = min(one, two)

    return space[i]


if __name__ == '__main__':
    N = int(input())
    #stones = list(map(int, input().strip().split()))
    stones = [int(a) for a in input().strip().split()]
    print(min_cost(stones, N))
    
    '''
    stones = [30, 10, 60, 10, 60, 50]
    N = 6
    print(min_cost(stones, N))
    

    stones = [10, 30, 40, 20]
    N = 4
    print(min_cost(stones, N))
    '''
n,k = map(int,input().split())
h_L = list(map(int,input().split()))


dp = [float("inf")] * (20)
#dp = [float("inf")] * (10**5 + 1)
dp[0] = 0

for i in range(n):
    for j in range(1,k+1):
        #print(j,i+j)
        # i=1,j=1
        if i - j < 0:
            continue
        dp[i] = min(dp[i],dp[i-j]+abs(h_L[i] - h_L[i-j]))
        #print(i,j)
        #print(dp)

print(dp[n-1])

### FIXED CODE ###

n,k = map(int,input().split())
h_L = list(map(int,input().split()))


#dp = [float("inf")] * (20)
dp = [float("inf")] * (10**5 + 1)
dp[0] = 0

for i in range(n):
    for j in range(1,k+1):
        #print(j,i+j)
        # i=1,j=1
        if i - j < 0:
            continue
        dp[i] = min(dp[i],dp[i-j]+abs(h_L[i] - h_L[i-j]))
        #print(i,j)
        #print(dp)

print(dp[n-1])
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
# 各条件の入力
i = int(input())
# 答えの出力
print(l[i])


### FIXED CODE ###

l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
i = int(input())-1
print(l[i])
b = [0] * 9


def hantei():
    for i in range(3):
        if b[i * 3] == 1 and b[i * 3 + 1] == 1 and b[i * 3 + 2] == 1:
            return True
    for i in range(3):
        if b[i * 3] == 1 and b[(i+1) * 3 ] == 1 and b[(i+2) * 3 ] == 1:
            return True
    if b[0] == 1 and b[4] == 1 and b[8] == 1:
        return True
    if b[2] == 1 and b[5] == 1 and b[6] == 1:
        return True
    return False


a = [0] * 9
[a[0], a[1], a[2]] = input().split()
[a[3], a[4], a[5]] = input().split()
[a[6], a[7], a[8]] = input().split()
a = [int(i) for i in a]

n = int(input())

for i in range(n):
    c = int(input())
    for j in range(len(a)):
        if a[j] == c:
            b[j] = 1

if (hantei()):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

b = [0] * 9


def hantei():
    for i in range(3):
        if b[i * 3] == 1 and b[i * 3 + 1] == 1 and b[i * 3 + 2] == 1:
            return True
    for i in range(3):
        if b[i] == 1 and b[i + 3] == 1 and b[i + 6] == 1:
            return True
    if b[0] == 1 and b[4] == 1 and b[8] == 1:
        return True
    if b[2] == 1 and b[4] == 1 and b[6] == 1:
        return True
    return False


a = [0] * 9
[a[0], a[1], a[2]] = input().split()
[a[3], a[4], a[5]] = input().split()
[a[6], a[7], a[8]] = input().split()
a = [int(i) for i in a]

n = int(input())

for i in range(n):
    c = int(input())
    for j in range(len(a)):
        if a[j] == c:
            b[j] = 1

if (hantei()):
    print("Yes")
else:
    print("No")
A,B,C=[int(i) for i in input().split()]
list=[]
list.append(A)
list.append(B)
list.append(C)
max=max(list)
list.remove(max)

return 10*max+sum(list)


### FIXED CODE ###

A,B,C=[int(i) for i in input().split()]
list=[]
list.append(A)
list.append(B)
list.append(C)
max=max(list)
list.remove(max)

print(10*max+sum(list))
a = raw_input() . split()

S = a[0] * a[1]
O = 2 * (a[0] + a[1])

print S + O

### FIXED CODE ###

a , b= map(int,raw_input(). split())
S = a * b
O = 2 * a + 2 * b

print str(S) + ' ' +  str(O)