Harryxun/stf_run huggingface dataset:
# input
X = int( input() )
maxA = 70
pow5 = list()
for aa in range(maxA):
    pow5.append( aa**5 )
    
# calc    
ans = False
a = 0
b = 0
for ii in range(maxA):  
    if( ans==False ):
        X1 = X - pow5[ii]
        X2 = X + pow5[ii]
        if( X1 in pow5 ):
            b = - ii
            a = pow5.index( X1 )
            ans = True
        
    if( ans==False ):
        if( X2 in pow5 ):
            b = ii
            a = pow5.index( X1 )
            ans = True

# out
print( str(a)+' '+str(b) )

### FIXED CODE ###

# input
X = int( input() )
maxA = 1000
pow5 = list()
for aa in range(maxA):
    pow5.append( aa**5 )
    
# calc    
ans = False
for ii in range(maxA):  
    if( ans==False ):
        X1 = X - pow5[ii]
        X2 = X + pow5[ii]
        if( X1 in pow5 ):
            b = - ii
            a = pow5.index( X1 )
            ans = True
        
    if( ans==False ):
        if( X2 in pow5 ):
            b = ii
            a = pow5.index( X2 )
            ans = True

# out
if(ans):
    print( str(a)+' '+str(b) )
import sys
print(sys.argv[0]**3)

### FIXED CODE ###

print(int(input())**3)
import math
N=int(input())
As=input().split()
As=[int(a) for a in As]
count=As[0]
for i in As:
    count=math.gcd(count,i)
print(str(count))


### FIXED CODE ###

import fractions
N=int(input())
As=input().split()
As=[int(a) for a in As]
count=As[0]
for i in As:
    count=fractions.gcd(count,i)
print(str(count))
D, N = list(map(int , input().split()))

if D == 0:
    ans = N
elif D == 1:
    ans ==100 * N
elif D == 2:
    ans ==10000 * N

print(ans)

### FIXED CODE ###

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

n = []
for i in range(1,1001):
    if D == 0:
        if i % 100 !=0:
            n.append(i)
        continue
    elif D == 1:
        if i % 100 !=0:
            n.append(100*i)
        continue      
    elif D == 2:
        if i % 100 !=0:
            n.append(10000*i)
        continue
print(n[N-1])
import numpy as np


def div(n, d):
    if d == 2:
        return format(n, "b")[::-1].find("1")
    cnt = 0
    while n % d == 0:
        n //= d
        cnt += 1
    return cnt


n = int(input())
arr = np.array([float(input()) for _ in range(n)], np.float64)
arr = np.rint(arr * 10**9).astype(np.int64)

f = np.vectorize(div)
arr2 = (f(arr, 2) + np.zeros([arr.shape[0], arr.shape[0]], np.int64)).astype(np.int32)
arr5 = (f(arr, 5) + np.zeros([arr.shape[0], arr.shape[0]], np.int64)).astype(np.int32)

arr2 = np.tril(arr2 + arr2.T)
arr2 -= arr2.T
arr5 = np.tril(arr5 + arr5.T)
arr5 -= arr5.T

result = (arr2 >= 18).astype(np.int32) + (arr5 >= 18).astype(np.int32)

print(np.sum(result >= 2))

### FIXED CODE ###

def div(n, d):
    cnt = 0
    while n % d == 0 and cnt < 18:
        n //= d
        cnt += 1
    return cnt


n = int(input())
dp = [[0]*19 for _ in range(19)]

ans = 0
for _ in range(n):
    x = round(float(input()) * pow(10, 9))
    two = div(x, 2)
    five = div(x, 5)
    ans += dp[18 - two][18 - five]
    for i in range(two + 1):
        for j in range(five + 1):
            dp[i][j] += 1

print(ans)
a,b=input().split("\n")
n,k=a.split(" ")
x=b.split(" ")
t=0
tmin=2*(x[n-1]-x[0])
for i in range (0,n-k+1):
    if x[i]>=0:
        t=x[i+k-1]
    else:
        if x[i+k-1]<=0:
            t=abs(x[i])
        else:
            if -1*x[i]<x[i+k-1]:
                t=-2*x[i]+x[i+k-1]
            else:
                t=-1*x[i]+2*x[i+k-1]
    if t<tmin:
        tmin=t
print(tmin)

### FIXED CODE ###

n,k=list(map(int, input().split()))
x=list(map(int, input().split()))
t=0
tmin=2*(x[n-1]-x[0])
for i in range (0,n-k+1):
    if x[i]>=0:
        t=x[i+k-1]
    else:
        if x[i+k-1]<=0:
            t=abs(x[i])
        else:
            if -1*x[i]<x[i+k-1]:
                t=-2*x[i]+x[i+k-1]
            else:
                t=-1*x[i]+2*x[i+k-1]
    if t<tmin:
        tmin=t
print(tmin)
N,S = map(int,input().split())
A = list(map(int,input().split()))
mod = 998244353
P = []

def BFS(now,i,pattern):
    if now == S:
        P.append(pattern)
    else:
        if i < N:
            if now + A[i] <= S:
                BFS(now+A[i],i+1,pattern+"1")

            BFS(now,i+1,pattern+"0")

BFS(0,0,"")

ans = 0
n = len(P)
for i in range(n):
    l = 0
    for p in P[i]:
        if p == "1":
            l += 1
    ans += 2**(N-l)
    ans %= mod
print(ans)



### FIXED CODE ###

N,S = map(int,input().split())
A = list(map(int,input().split()))
mod = 998244353

dp = [[0]*3005 for _ in range(3005)]
dp[0][0] = 1
for i in range(0,N):
    for s in range(0,S+1):
        if s-A[i] >= 0:
            dp[i+1][s] = dp[i][s]*2 + dp[i][s-A[i]]
        else:
            dp[i+1][s] = dp[i][s]*2
        dp[i+1][s] %= mod

print(dp[N][S])
Q = int(input())
isPrime = [-1 for x in range(10001)]
isPrime[1],isPrime[2] = False,True
for i in range(Q):
    ans = 0
    l,r = map(int,input().split())
    for c in range(l,r+1,2):
        other = (c+1)//2
        if isPrime[c] == -1:
            for j in range(2,int(c**0.5)+1):
                if c % j == 0:
                    isPrime[c] = False
                    break
            else:
                isPrime[c] = True
        if isPrime[other] == -1:
            for j in range(2,int(other**0.5)+1):
                if other % j == 0:
                    isPrime[other] = False
                    break
            else:
                isPrime[other] = True
                
        if isPrime[c] and isPrime[other]:
            ans += 1
    print(ans)
    


### FIXED CODE ###

Q = int(input())
isPrime = [True] * 100001
for p in range(2, 100001):
    if isPrime[p]:
       for i in range(p * p, 100001, p):
           isPrime[i] = False
isPrime[1],isPrime[2] = False,True

like_2017 = [0] * 100002
for i in range(1,100001):
    if isPrime[i] and isPrime[(i+1)//2]:
        like_2017[i] = like_2017[i-1] + 1
    else:
        like_2017[i] = like_2017[i-1]
        
for i in range(Q):
    l,r = map(int,input().split())
    print(like_2017[r] - like_2017[l-1])
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    n = int(input())
    a = input().split()

    bob = 0
    alice = 0
    sort_a = sorted(a, reverse=True)
    count = 0
    for m in sort_a:
        if m % 2 == 0:
            alice = alice + int(m)
        else:
            bob = bob + int(m)

    print(alice - bob)


### FIXED CODE ###

N = int(input())
a = sorted([int(i) for i in input().split()], reverse=True)

Alice, Bob = 0, 0

for i in range(len(a)):
    if i % 2 == 0:
        Alice += a[i]
    else:
        Bob += a[i]

print(Alice - Bob)
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split(" "))))

M = np.zeros((100, A.shape[0]))

for i in range(100):
    M[i, :] = A - (i + 1)

t = M * M


t1 = np.sum(t, axis=1)


print(int(np.min(t1)))

### FIXED CODE ###

import numpy as np
N = int(input())
A = np.array(list(map(int, input().split(" "))))

M = np.zeros((100, A.shape[0]))

for i in range(100):
    M[i, :] = A - (i + 1)

t = M * M


t1 = np.sum(t, axis=1)


print(int(np.min(t1)))
from itertools import accumulate
enum = enumerate

R = lambda: map(int, input().split())
*_, k = R()
a = accumulate(R())
b = tuple(accumulate(R()))
print(max(i + j for i, x in enum(a, 1) for j, y in enum(b, 1) if x + y <= k))


### FIXED CODE ###

from itertools import accumulate
from bisect import bisect_right

R = lambda: map(int, input().split())
*_, k = R()
a = accumulate(R())
b = list(accumulate(R()))
r = bisect_right(b, k)
for i, x in enumerate(a, 1):
  if x > k:
    break
  j = bisect_right(b, k - x)
  r = max(r, i + j) 
print(r)
N = int(input())

if int(N) % 10 = 3:
 print('bon')
elif int(N) % 10 = 0:
 print('pon')
elif int(N) % 10 = 1:
 print('pon')
elif int(N) % 10 = 6:
 print('pon')
elif int(N) % 10 = 8:
 print('pon')
else:
 print('hon')


### FIXED CODE ###

N = int(input())

if N % 10 == 3:
 print('bon')
elif N % 10 == 0:
 print('pon')
elif N % 10 == 1:
 print('pon')
elif N % 10 == 6:
 print('pon')
elif N % 10 == 8:
 print('pon')
else:
 print('hon')
from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

setrecursionlimit(10000)

(R, C) = reads()
N = read()

d = defaultdict(list)
V = set()

for _ in range(N):
  (r, c, a) = reads()
  d["R", r-1].append((("C", c-1), a))
  d["C", c-1].append((("R", r-1), a))
  V.add(("R", r-1))
  V.add(("C", c-1))

def walk(v):
  for (w, a) in d[v]:
    wcol = a - col[v]
    if w in col:
      if col[w] != wcol:
        print("No"); exit()
    else:
      col[w] = wcol
      V.remove(w)
      walk(w)

while len(V) > 0:
  col = dict()
  v = V.pop()
  col[v] = 0
  walk(v)
  rcol = min(a for (v, a) in col.items() if v[0] == "R")
  ccol = min(a for (v, a) in col.items() if v[0] == "C")
  if rcol + ccol < 0:
    print("No"); exit()

print("Yes")


### FIXED CODE ###

from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

setrecursionlimit(1000000)

(R, C) = reads()
N = read()

d = defaultdict(list)
V = set()

for _ in range(N):
  (r, c, a) = reads()
  (r, c) = (r-1, c-1)
  d["R", r].append((("C", c), a))
  d["C", c].append((("R", r), a))
  V.add(("R", r))
  V.add(("C", c))

def walk(v):
  V.discard(v)
  for (w, a) in d[v]:
    wcol = a - col[v]
    if w in col:
      if col[w] != wcol:
        print("No"); exit()
    else:
      col[w] = wcol
      walk(w)

while len(V) > 0:
  v = V.pop()
  col = dict()
  col[v] = 0
  walk(v)
  rcol = min(a for (v, a) in col.items() if v[0] == "R")
  ccol = min(a for (v, a) in col.items() if v[0] == "C")
  if rcol + ccol < 0:
    print("No"); exit()

print("Yes")
a,b=list(map(int, input().split()))
print((a*b)//1)

### FIXED CODE ###

a,b=list(map(float, input().split()))
a=int(a)
b=round(b*100)
print((a*b)//100)
a,b=map(int,input().split())

def prime(n):
    is_prime=[True]*(n+1)
    is_prime[0],is_prime[1]=False,False
    for i in range(2,int(n**0.5)+1):
        if not is_prime[i]:continue
        for j in range(i*2,n+1,i):
            is_prime[j]=False
    return [i for i in range(n+1) if is_prime[i]]

prime_num=prime(min(a,b))

count=1
min_num=min(a,b)
for i in prime_num:
    if i>min_num//2:break
    elif a%i==0 and b%i==0:
        count +=1

print(count)

### FIXED CODE ###

from collections import Counter
def prime_fact(n):
    a=[]
    while n%2==0:
        a.append(2)
        n //=2
    f=3
    while f**2<=n:
        if n%f==0:
            a.append(f)
            n //=f
        else:f +=2
    if n!=1:a.append(n)
    return a

a,b=map(int,input().split())
a_key=Counter(prime_fact(a))
b_key=Counter(prime_fact(b))
print(len(a_key&b_key)+1)
def cross(a, b):
    return a.real * b.imag - a.imag * b.real


def cross_point(c, d):
    l = d - c
    v1 = cross(lv, l)
    v2 = cross(lv, lt - c)
    return c + v2 / v1 * l


n = int(input())
points = [complex(*map(int, input().split())) for _ in range(n)]
point0 = points.pop(0)
points.append(point0)

q = int(input())
while q:
    x1, y1, x2, y2 = map(int, input().split())
    ls, lt = (x1 + 1j * y1, x2 + 1j * y2)
    lv = lt - ls

    area = 0
    prev = point0
    prev_flag = cross(lv, prev - ls) >= 0
    cp1, cp2 = None, None
    for p in points:
        curr_flag = cross(lv, p - ls) >= 0
        if prev_flag and curr_flag:
            area += cross(prev, p)
        elif prev_flag != curr_flag:
            cp = cross_point(prev, p)
            if prev_flag:
                area += cross(prev, cp)
                cp1 = cp
            else:
                area += cross(cp, p)
                cp2 = cp
        prev, prev_flag = p, curr_flag
    area += cross(cp1, cp2)
    print(area / 2)
    q -= 1

### FIXED CODE ###

def cross(a, b):
    return a.real * b.imag - a.imag * b.real


def cross_point(c, d):
    l = d - c
    v1 = cross(lv, l)
    v2 = cross(lv, lt - c)
    return c + v2 / v1 * l


n = int(input())
points = [complex(*map(int, input().split())) for _ in range(n)]
point0 = points.pop(0)
points.append(point0)

q = int(input())
while q:
    x1, y1, x2, y2 = map(int, input().split())
    ls, lt = (x1 + 1j * y1, x2 + 1j * y2)
    lv = lt - ls

    area = 0
    prev = point0
    prev_flag = cross(lv, prev - ls) >= 0
    cp1, cp2 = None, None
    for p in points:
        curr_flag = cross(lv, p - ls) >= 0
        if prev_flag and curr_flag:
            area += cross(prev, p)
        elif prev_flag != curr_flag:
            cp = cross_point(prev, p)
            if prev_flag:
                area += cross(prev, cp)
                cp1 = cp
            else:
                area += cross(cp, p)
                cp2 = cp
        prev, prev_flag = p, curr_flag
    if cp1 is not None and cp2 is not None:
        area += cross(cp1, cp2)
    print(area / 2)
    q -= 1
s1,s2,s3 = map(int, input().split())

count = 0

mapList = [s1,s2,s3]

for map in mapList:
  if map == 1:
    count += 1

print(count)

### FIXED CODE ###

print(input().count("1"))
import math

r = float(input())

s = r**2*math.pi
v = 2*math.pi*r

print("{0:.6f} {1:.6f}'.format(s, V)

### FIXED CODE ###

import math

r = float(input())

s = r*r*math.pi
v = 2*math.pi*r

S = round(s, 6)
V = round(v, 6)

print(S, V)
a,b,c = map(int,input().split())
d = a*b
if d>c:
print('c')
else if:
print('d')


### FIXED CODE ###

a,b,c = map(int,input().split())
d = a*b
if d>c:
	print(c)
else:
	print(d)
import sys
sys.setrecursionlimit(10000000)
MOD = 998244353
INF = 10 ** 15

def main():
    N,S = map(int,input().split())
    A = list(map(int,input().split()))

    dp = [[0]*(1 + S) for _ in range(N + 1)]
    dp[0][0] = pow(2,N,MOD)
    inv2 = pow(2,MOD - 2,MOD)
    for i,a in enumerate(A):
        for j in range(a):
            dp[i + 1][j] = dp[i][j]
        for j in range(a,S + 1):
            dp[i + 1][j] = (dp[i][j] + dp[i][j - a] * inv2)%MOD
    print(dp[N][S])
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
MOD = 998244353
INF = 10 ** 15

def main():
    N,S = map(int,input().split())
    A = list(map(int,input().split()))

    dp = [[0]*(1 + S) for _ in range(N + 1)]
    dp[0][0] = pow(2,N,MOD)
    inv2 = pow(2,MOD - 2,MOD)
    for i,a in enumerate(A):
        for j in range(S + 1):
            if j < a:
                dp[i + 1][j] = dp[i][j]
            else:
                dp[i + 1][j] = (dp[i][j] + dp[i][j - a] * inv2)%MOD
    print(dp[N][S])
if __name__ == '__main__':
    main()
print(a + a*a + a*a*a)

### FIXED CODE ###

def main():
    a = int(input())
    print(a + a*a + a*a*a)
    
if __name__ == "__main__":
    main()
s=t=0
for _ in[0]*int(input()):a=int(input());s+=(a+t)//2;t=(a+t)%2&(i>0)
print(s)

### FIXED CODE ###

t=c=0
for _ in[0]*input():i=input();c+=(i+t)/2;t=(i+t)%2&(i>0)
print c
s = input()
num = len(s)

dp = [0]*num
temp = [0]*2019
for i in range(num):
    temp[i] += 1

ans = temp[0]
for t in temp:
    if t > 1:
        ans += t*(t-1)/2

print(int(ans))

### FIXED CODE ###

S=input()
N=len(S)
M=2019

remainder=[0]*M
val=0
for i in range(N):
  val=(int(S[N-1-i])*pow(10,i,M)+val)%M
  remainder[val]+=1

ans=remainder[0]
for i in range(2019):
  ans+=remainder[i]*(remainder[i]-1)//2
print(ans)
num_list = map(input().split())
a = int(num_list[0])
b = float(num_list[1])
print(int(a*b))


### FIXED CODE ###

from decimal import Decimal
num_list = list(input().split())
a = Decimal(num_list[0])
b = Decimal(num_list[1])

print(int(a*b))
a = input().split()

N = int(a[0])
S = a[1]

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""
o = []
for c in S:
    # print(c)
    n = alpha_dict[c]
    n = n + N
    if (n > 26):
        n = n - 26
    # print(n)
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    #o.append(keys)
    # print(alpha_dict[n])


print(st)

### FIXED CODE ###

a = input()
b = input()

N = int(a)
S = b

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""

for c in S:
    n = alpha_dict[c]
    n = n + N
    if (n > 26):
        n = n - 26
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    
print(st)
def insertionSort(A,n,g):
	cnt = 0
	for i in range(int(g),n):
		v = A[i]
		j = i - g
		while j >= 0 and A[j] > v:
			A[j+g] = A[j]
			j = j - g
			cnt += 1
		A[j+g] = v

def shellsort(A,n):
	cnt = 0
	h = 0
	while(h <= n / 9): h = 3*h + 1
	G = []
	while h > 0:
		G.append(h)
		h /= 3
	print("-----")
	print(len(G))

	print(" ".join(map(str,G)))
	for i in range(len(G)):
		insertionSort(A,n,G[i])
	for i in A:
		print(i)	
n = int(input())
A = []
for _ in range(n):
	A.append(int(input()))
shellsort(A,n)




### FIXED CODE ###

def insertionSort(A,n,g):
    cnt = 0
    for i in range(g,n):
        v = A[i]
        j = i - g
        while j >= 0 and A[j] > v:
            A[j+g] = A[j]
            j = j - g
            cnt += 1
            A[j+g] = v
    return cnt
    
def shellsort(A,n):
    cnt = 0
    h = 1
    G = []
    while h <= n:
        G.append(h)
        h = 3*h + 1
    G.reverse()
    m = len(G)
    print(m)

    print(" ".join(map(str,G)))
    for i in range(m):
        cnt += insertionSort(A,n,G[i])
    print(cnt)
    for i in A:
        print(i)
        
n = int(input())
A = []
for _ in range(n):
    A.append(int(input()))
shellsort(A,n)
for p in P:
    # 期待値
    # 累積和
    exp += (1+p)/2
    p_e.append(exp)  
if n == k:
    print(p_e[-1])
else:
    # 初期値
    maxv = p_e[k-1] - 0
    for i in range(1, n-k):
        # 隣接するk個の期待値の和
        p_sum = p_e[k+i] - p_e[i]
        maxv = max(maxv, p_sum)
    print(maxv)

### FIXED CODE ###

def main():
    n, k = map(int, input().split())
    P = [int(x) for x in input().split()]
    p_e = list()
    exp = 0
    for p in P:
        # 期待値
        # 累積和
        exp += (1+p)/2
        p_e.append(exp)  
    if n == k:
        print(p_e[-1])
    else:
        # 初期値
        maxv = p_e[k-1] - p_e[0]
        for i in range(1, n-k):
            # 隣接するk個の期待値の和
            p_sum = p_e[k+i] - p_e[i]
            maxv = max(maxv, p_sum)
        print(maxv)

if __name__ == '__main__':
    main()
N,K = map(int,input().split())
height_list = list(map(int,input().split()))
print(sum(1 for i in height_list if i >= K]))

### FIXED CODE ###

N,K = map(int,input().split())
height_list = list(map(int,input().split()))
print(sum([1 for i in height_list if i >= K]))
a=list(map(int,input().split()))
b=[]
ans=0
c=[]
for _ in range(a[2]):
    b.append(list(map(int,input().split())))

for i in range(1,a[1]+1):
    for j in range(i,a[1]+1):
        for k in range(j,a[1]+1):
            c=[i,j,k]
            for l in range(a[2]):
                if c[b[l][1]-1]-c[b[l][0]-1]==b[l][2]:
                    ans+=b[l][3]
            d.append(ans)
            ans=0
print(max(d))

### FIXED CODE ###

import itertools
a=list(map(int,input().split()))
b=[]
ans=0
c=range(1,a[1]+1)
d=[]
for _ in range(a[2]):
    b.append(list(map(int,input().split())))


for i in itertools.combinations_with_replacement(c,a[0]):
    for l in range(a[2]):
        if i[b[l][1]-1]-i[b[l][0]-1]==b[l][2]:
            ans+=b[l][3]
    d.append(ans)
    ans=0
print(max(d))
a,b,c = input()

print(a if b==c else b if a==c else c)

### FIXED CODE ###

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

print(a if b==c else b if a==c else c)
n, k = map(int, input().split())
l = list(map(int, input().split()))
l = sorted(l)
if n<=k :
    print(0)
else :
    sm = 0
    for i in range(n-k):
        sm += l[i]
    pritn(sm)

### FIXED CODE ###

n, k = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
if n<=k :
    print(0)
else :
    sm = 0
    for i in range(n-k):
        sm += l[i]
    print(sm)
import numpy as np

N, M, X = map(int, input().split())
C = np.zeros(N)
A = np.zeros((N, M))


for n in range(N):
    s = list(map(int, input().split()))
    C[n] = s[0]
    A[n] = s[1:]

C_MIN = -1
for i in range(2 ** N):
    C_SUM = 0
    A_SUM = np.zeros(M)
    for j in range(N):
        if ((i >> j) & 1):
            C_SUM += C[j]
            A_SUM += A[j]
    if np.all(A_SUM >= X):
        if C_SUM < C_MIN and not C_MIN == -1:
            C_MIN = C_SUM
            
if C_MIN == -1:
    print("-1")
else:
    print(int(C_MIN))

### FIXED CODE ###

S = input()
T = input()

if S == T[:-1]:
    print("Yes")
else:
    print("No")
k=int(input())
nums=[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]
print(nums[k])

### FIXED CODE ###

k=int(input())
nums=[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]
print(nums[k-1])
N,M = list(map(int,input().split()))

edges = [[] for _ in range(N)]

for i in range(M):
    L,R,D = list(map(int,input().split()))
    edges[L - 1].append((R -1,D))
    edges[R - 1].append((L-1, -D))


visited = [None] * N
place = [0] * N
inf = 10 ** 10


def walk(i):
    if visited[i]:
        return (place[i], place[i])
    visited[i] = True
    (n,m) = (inf, - inf)
    for j,d in edges[i]:
        #print(j,d)
        if visited[j] and place[j] != place[i] + d:
            print("No")
            exit()
        place[j] = place[i] + d
        (x,y) = walk(j)
        (n,m) = (min(n,x),max(m,y))
    return (n,m)

  '''
for i in range(N):
    if not visited[i]:
        place[i] = 0
    # 連結成分のminとmax
        (n,m) = walk(i)
        if m - n > 10 ** 9:
            print("No")
            exit()
            '''
print("Yes")

### FIXED CODE ###

from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

setrecursionlimit(1000000)
N,M = list(map(int,input().split()))

edges = [[] for _ in range(N)]

for i in range(M):
    L,R,D = list(map(int,input().split()))
    edges[L - 1].append((R -1,D))
    edges[R - 1].append((L-1, -D))


visited = [None] * N
place = [0] * N
inf = 10 ** 10


def walk(i):
    if visited[i]:
        return (place[i], place[i])
    visited[i] = True
    (n,m) = (inf, - inf)
    for j,d in edges[i]:
        #print(j,d)
        if visited[j] and place[j] != place[i] + d:
            print("No")
            exit()
        place[j] = place[i] + d
        (x,y) = walk(j)
        (n,m) = (min(n,x),max(m,y))
    return (n,m)


for i in range(N):
    if not visited[i]:
        place[i] = 0
    # 連結成分のminとmax
        (n,m) = walk(i)
        if m - n > 10 ** 9:
            print("No")
            exit()

print("Yes")
input_a = ()
input_b = ()
input_c = ()
input_d = ()
input_e = ()
input_k = ()
if (input_a - input_e) < input_k:
  print("Yay!")
else:
  print(":(")

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if (e - a) <= k:
  print("Yay!")
else:
  print(":(")
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

step = [0] * (N+1)
if 1 in A:
  step[1] = 0
else:
  step[1] = 1
if 2 in A:
  step[2] = 0
else:
  step[2] = step[1] + 1

for i in range(3, N+1):
  if i in A:
    step[i] = 0
  else:
    step[i] = step[i-1] + step[i-2]
print(step[N])
  
  


### FIXED CODE ###

N, M = map(int, input().split())
A = [True] * (N+1)
for _ in range(M):
  idx = int(input())
  A[idx] = False

step = [0] * (N+1)
step[0] = 1
for i in range(1, N+1):
  if A[i]:
    step[i] = step[i-1] + step[i-2]
  else:
    step[i] = 0
print(step[N]%(10**9+7))
r, g, b = map(int, input.split())
if 100 * r + 10 * g + b % 4 = 0:
	print("Yes")
else:
	print("No")


### FIXED CODE ###

r, g, b = map(int, input().split())
if (100 * r + 10 * g + b) % 4 == 0:
	print("YES")
else:
	print("NO")
N = int(input())
H = list(map(int,input().split()))
inf = 10**9+7
dp = [inf] * (N+10)
import numpy as np
for i,h in enumerate(H[:N-1]):
    dp[i+1] = min(dp[i+1],dp[i] + np.abs(h[i]-h[i+1]))
    if i<N-2: dp[i+2] = min(dp[i+2],dp[i] + np.abs(h[i]-h[i+2]))
    
print(dp[N-1])

### FIXED CODE ###

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

dp = [0] * 100010

dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2,N):
    dp[i] = min(abs(h[i]-h[i-1])+dp[i-1],abs(h[i]-h[i-2])+dp[i-2]) 
    
print(dp[N-1])