Harryxun/stf_run huggingface dataset:
from collections import defaultdict
import sys


sys.setrecursionlimit(10 ** 6)


def find_path(adj, to_node, node, parent=None):
    if node == to_node:
        return [to_node]
    path = None
    for child in adj[node]:
        if child == parent:
            continue
        p = find_path(adj, to_node, child, node)
        if p is None:
            continue
        if path is None or len(path) > len(p):
            path = p
    return path + [node]


def depth(adj, node, parent=None):
    ret = 0
    for child in adj[node]:
        if child == parent:
            continue
        d = depth(adj, child, node) + 1
        ret = max(ret, d)
    return ret


def main():
    N, U, V = list(map(int, input().split(' ')))
    U -= 1
    V -= 1
    adj = defaultdict(list)
    for _ in range(N - 1):
        A, B = list(map(lambda x: int(x) - 1, input().split(' ')))
        adj[A].append(B)
        adj[B].append(A)
    path = find_path(adj, U, V)  # to U from V
    path.reverse()
    dist = len(path) - 1
    partial_depth = depth(adj, path[(dist // 2) + 1], path[dist // 2])
    print(partial_depth + (dist // 2))


if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import defaultdict
import sys


sys.setrecursionlimit(10 ** 6)


def depth(adj, node, parent=None):
    ret = 0
    for child in adj[node]:
        if child == parent:
            continue
        d = depth(adj, child, node) + 1
        ret = max(ret, d)
    return ret


def main():
    N, U, V = list(map(int, input().split(' ')))
    U -= 1
    V -= 1
    adj = defaultdict(list)
    for _ in range(N - 1):
        A, B = list(map(lambda x: int(x) - 1, input().split(' ')))
        adj[A].append(B)
        adj[B].append(A)

    path = [-1] * N

    def find_path_on_tree(to_node, node, parent=None, d=0):
        if node == to_node:
            path[d] = node
            return True
        for child in adj[node]:
            if child == parent:
                continue
            if not find_path_on_tree(to_node, child, node, d + 1):
                continue
            path[d] = node
            return True
        return False

    find_path_on_tree(U, V)  # to U from V
    path = [node for node in path if node != -1]
    dist = len(path) - 1
    partial_depth = depth(adj, path[(dist // 2) + 1], path[dist // 2])
    print(partial_depth + (dist // 2))


if __name__ == '__main__':
    main()
A, B, K = map(int, input().split())
ans = []
for i in range(A, min(A + K, B)):
  ans.append(i)

for i in range(max(ans[-1] + 1, B - K + 1), B + 1):
  ans.append(i)

for a in ans:
  print(a)

### FIXED CODE ###

A, B, K = map(int, input().split())
ans = []

if B + 1 - A < 2 * K:
  ans = [i for i in range(A, B + 1)]
else:
  ans = [i for i in range(A, A + K)] + [i for i in range(B + 1 - K, B + 1)]
for a in ans:
  print(a)
import numpy as np

x,k,d = np.array(list(map(int,input().split())))
#偶数回前後に移動したら0
#偶数回一方向に移動したら2D

for i in range(k):
  x = np.abs(x) - d

  if x < 0:
    break



if (k-i+1) % 2 == 0:
  #そのまま
  ans = np.abs(x)
else:
  ans = np.min(np.abs(x-d),np.abs(x+d))

print(ans)

### FIXED CODE ###


x,k,d = list(map(int,input().split()))
#偶数回前後に移動したら0
#偶数回一方向に移動したら2D

if x >= 0:
  capa_iter = x // d
  if capa_iter < k:
    if (k - capa_iter) % 2 == 0:
      print(x - capa_iter*d)
    else:
      print(min([abs(x - capa_iter*d-d),x - capa_iter*d+d]))
    exit()

  ans =x-d*k
  print(ans)

if x < 0:
  capa_iter = abs(-x // d)
  if capa_iter < k:
    if (k - capa_iter) % 2 == 0:
      print(abs(x + capa_iter*d))
    else:
      print(min([abs(x + capa_iter*d+d),abs(x + capa_iter*d -  d)]))
    exit()

  ans =abs(x+d*k)
  print(ans)
N = int(input())
edges = [[] for i in range(N-1)]
connected = [[] for i in range(N+1)]
for i in range(N-1):
    edges[i]=list(map(int, input().split()))
    connected[edges[i][0]].append([edges[i][1], edges[i][2]])
    connected[edges[i][1]].append([edges[i][0], edges[i][2]])

##print('edges=',edges)
'''def connected(v):
    children = []
    for edge in edges:
        if edge[0] == v:
            children.append([edge[1],edge[2]])
        elif edge[1] == v:
            children.append([edge[0],edge[2]])

    return children'''

Q,K = map(int, input().split())
##print('Q=',Q)
depth = [0]*(N+1)
def DFS(v, p, d):
    depth[v] = d
    for child in connected[v]:
        if child[0] == p:
            continue
        DFS(child[0], v, d+child[1])

DFS(K,-1,0)
for i in range(Q):
    xi, yi = map(int, input().split())
    print(depth[xi]+depth[yi])

    


### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)

N = int(input())
edges = []
connected = [[] for i in range(100010)]
for i in range(N-1):
    x=list(map(int, input().split()))
    x[0] -= 1
    x[1] -= 1
    edges.append(x)
    connected[x[0]].append([x[1], x[2]])
    connected[x[1]].append([x[0], x[2]])

Q,K = map(int, input().split())
K -= 1
depth = [0]*100010
def DFS(v, p, d):
    depth[v] = d
    for child in connected[v]:
        if child[0] == p:
            continue
        DFS(child[0], v, d+child[1])

DFS(K,-1,0)
for i in range(Q):
    xi, yi = map(int, input().split())
    print(depth[xi-1]+depth[yi-1])
N, K=map(int, input().split())
red=N-K

def cmb(n, r):
  m=1
  if(n==0 or r==0):
      return 1
  if(n<2*r):
      r=n-r
  for i in range(1,r+1):
      m=m*(n-i+1)/i
    
  return m

n = (N-K+1)
if(n>K):
  n=K
for i in range(1,n+1):
  ret = cmb(N-K+1,i)*cmb(K-1,i-1)
  print(int(ret)%(1000000007))

### FIXED CODE ###

from operator import mul
from functools import reduce


def cmb(n, r):
	if n < r:
		return 0
	r = min(n - r, r)
	if r == 0:
		return 1
	numer = reduce(mul, range(n, n - r, -1))
	denom = reduce(mul, range(1, r + 1))
	return numer // denom % INF


N, K = map(int, input().split())
INF = 10 ** 9 + 7

for i in range(1, K + 1):
	print(cmb(K - 1, i - 1) * cmb(N - K + 1, i) % INF)
import math
a, b = tuple(map(int,input().rstrip().split()))
print(a * b // math.gcd(a, b))

### FIXED CODE ###

def gcd(a, b):
    r = a % b
    if r == 0:
        return b
    else:
	    return gcd(b, r)
def lcm(a,b):
    return a * b // gcd(a, b)
a,b = tuple(map(int,input().rstrip().split()))
print(lcm(a, b))
N = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  # x番目がほしいときにchars[x-1]としたくないので、chars[0]は使わないことにします

n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = ""
while True:
  x = n_rem % 26
  if x == 0:
    x = 26
  res += chars[x]
  n_rem -= x
  
  if n_rem == 0:
    break
  n_rem //= 26
print(res[::-1])

### FIXED CODE ###

n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  # x番目がほしいときにchars[x-1]としたくないので、chars[0]は使わないことにします

n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = ""
while True:
  x = n_rem % 26
  if x == 0:
    x = 26
  res += chars[x]
  n_rem -= x
  
  if n_rem == 0:
    break
  n_rem //= 26
print(res[::-1])
s = input()

for i , v in enumerate(s):
    if v == 'A':
        apos = i + 1
        break

for i , v in enumerate(s[::-1]):
    if v == 'Z':
        zpos = len(s) - i 
        break

print( zpos - apos + 1)


### FIXED CODE ###

x, = map(int , input().split())
if( x < 1200 ):
    print('ABC')
else:
    print('ARC')
n,p= map(int,input().split())
if 2 >= int(p**(1/n))+2):
    print(1)
else: print(0)

### FIXED CODE ###

n,p= map(int,input().split())
for i in range(round(p**(1/n)),0,-1):
    if p%(i**n)==0:
        print(i)
        exit()
N,M,X = map(int, input().split(' '))
C=[]
maxNum=999999999
dmaxNum=999999999
for i in range(N):
  C.append(map(int, input().split(' ')))

for i in range(2**(N+1)-1):
  ar=[]
  for i in range(M):
    if (i & 2**i) == 0:
      ar = [x * y for (x, y) in zip(ar, C[i])]
  print(ar)
  for i in ar:
    if i < X:
      break


### FIXED CODE ###

import numpy as np

N,M,X = map(int, input().split(' '))
C=[]
maxNum=999999999
dmaxNum=999999999
for i in range(N):
  C.append(list(map(int, input().split(' '))))
for i in range(2**N):
  ar=[0]*(M+1)
  for j in range(N):
    if (i & 2**j) != 0:
      ar = [x + y for (x, y) in zip(ar, C[j])]
  if (np.array(ar[1:])>=X).all()>0:
    maxNum=min(maxNum,ar[0])
if maxNum==dmaxNum:
  print(-1)
else:
  print(maxNum)
n = int(input())
nine = []
six = []
i = 0
for i in range(1, 100000):
    if 9 ** i < n:
        nine.append(9 ** i)
    else:
        break
for i in range(1, 100000):
    if 6 ** i < n:
        six.append(6 ** i)
    else:
        break

count = 0
last = n
while last >= 9:
    if nine:
        while nine[-1] > last:
            nine.pop()
    if six:
        while six[-1] > last:
            six.pop()

    if nine:
        tmp9 = nine[-1]
        num9 = int(last / tmp9)
    if six:
        tmp6 = six[-1]
        num6 = int(last / tmp6)

    if num9 < num6:
        count += num9
        last %= tmp9
        nine.pop()
    elif num9 == num6 and last % tmp9 <= last % tmp6:
        count += num9
        last %= tmp9
        nine.pop()
    else:
        count += num6
        last %= tmp6
        six.pop()


count += int(last / 6)
last %= 6
print(count + last)


### FIXED CODE ###

n = int(input())
paySix = []
payNine = []
i = 0
while 6**i <= n:
   paySix.append(6**i)
   i += 1
i = 0
while 9**i <= n:
   payNine.append(9**i)
   i += 1

maxCount = n
sum = 0
for j in range(n+1):
    count = 0
    count6 = 0
    count9 = 0
    nine = j
    six = n - j
    for i in reversed(range(len(payNine))):
        count9 += int(nine/payNine[i])
        nine -= int(nine/payNine[i])*payNine[i]
    # print("\ndiv target:{} 9Count:{}".format(j, count9))
    for i in reversed(range(len(paySix))):
        count6 += int(six/paySix[i])
        six -= int(six/paySix[i])*paySix[i]
    # print("div target:{} 6Count:{}".format(n-j, count6))
    maxCount = min(maxCount, count9+count6)
print(maxCount)
"""
pay = [1]
i = 1
while 6**i <= n:
   pay.append(6**i)
   i += 1
i = 1
while 9**i <= n:
   pay.append(9**i)
print(i)
pay = sorted(pay)
print(len(pay))
count = 0
for i in reversed(range(len(pay))):
    # print(i)
    count += int(n/pay[i])
    n -= int(n/pay[i])*pay[i]
    if n == 0:
        print(count)
"""
""""
for i in range(1, 100000):
    if 9 ** i < n:
        nine.append(9 ** i)
    else:
        break
for i in range(1, 100000):
    if 6 ** i < n:
        six.append(6 ** i)
    else:
        break

count = 0
last = n
while last >= 9:
    if nine:
        while nine[-1] > last:
            nine.pop()
    if six:
        while six[-1] > last:
            six.pop()

    if nine:
        tmp9 = nine[-1]
        num9 = int(last / tmp9)
    if six:
        tmp6 = six[-1]
        num6 = int(last / tmp6)

    if num9 < num6:
        count += num9
        last %= tmp9
        nine.pop()
    elif num9 == num6 and last % tmp9 <= last % tmp6:
        count += num9
        last %= tmp9
        nine.pop()
    else:
        count += num6
        last %= tmp6
        six.pop()


count += int(last / 6)
last %= 6
print(count + last)
"""
n=int(input())

ans=count(n)

if ans>=1:
	print("Yes")
    
else:
	print("No")

### FIXED CODE ###

n=input()
 
ans=int(n.count("7"))
 
if ans>=1:
	print("Yes")
    
else:
	print("No")
import sys
input = sys.stdin.readline

n, a, b, c = map(int, input().split())
count = {
    'A': a,
    'B': b,
    'C': c
}
queries = []
for _ in range(n):
    query = tuple(input())
    queries.append(query)


def solve(plus, minus):
    count[plus] += 1
    count[minus] += 1
    ans.append(plus)


ans = []
for idx, (x, y) in enumerate(queries):
    if count[x] == count[y] == 0:
        print('No')
        exit()

    if count[x] == count[y] == 1:
        if idx == n-1:
            solve(x, y)
            break

        nex = queries[idx+1]
        if x in nex:
            solve(x, y)
        else:
            solve(y, x)
    
    elif count[x] >= count[y]:
        solve(x, y)
        
    else:
        solve(y, x)

print('Yes')
for c in ans:
    print(c)


### FIXED CODE ###

import sys
input = sys.stdin.readline

n, a, b, c = map(int, input().split())
count = {
    'A': a,
    'B': b,
    'C': c
}
queries = []
for _ in range(n):
    query = tuple(input().replace('\n', ''))
    queries.append(query)


def solve(plus, minus):
    count[plus] += 1
    count[minus] -= 1
    ans.append(plus)


ans = []
for idx, (x, y) in enumerate(queries):
    if count[x] == count[y] == 0:
        print('No')
        exit()

    if count[x] == count[y] == 1:
        if idx == n-1:
            solve(x, y)
            break

        nex = queries[idx+1]
        if x in nex:
            solve(x, y)
        else:
            solve(y, x)

    elif count[x] >= count[y]:
        solve(y, x)

    else:
        solve(x, y)

print('Yes')
for c in ans:
    print(c)
N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]
H.sort()
df = 0
min_h = H[K-1]-H[0]

for i in range(1, K):
    new_h = H[i+K-1]-H[i]
    if new_h < min_h:
        min_h = new_h

print(min_h)


### FIXED CODE ###

N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]
H.sort()
df = 0
min_h = H[K-1]-H[0]

for i in range(1, N-K+1):
    new_h = H[i+K-1]-H[i]
    if new_h < min_h:
        min_h = new_h

print(min_h)
import math

def perm(n, r):
    return math.factorial(n)//math.factorial(n-r)

def comb(n, r):
    if n == 1:
        return 0
    return perm(n, r)//math.factorial(r)

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

ans = comb(N,2) + comb(M,2)


print(int(ans))

### FIXED CODE ###

import math

def perm(n, r):
    return math.factorial(n)//math.factorial(n-r)

def comb(n, r):
    if n <= 1:
        return 0
    return perm(n, r)//math.factorial(r)

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

ans = comb(N,2) + comb(M,2)


print(int(ans))
import numpy as np
from itertools import product

D = int(input())
C = np.array(list(map(int, input().split())))
S = np.array([list(map(int, input().split())) for d in range(D)])

L = np.empty(26, int)
L[:] = -1

P2 = list(product(range(26), repeat=2))
P3 = list(product(range(26), repeat=3))

for d in range(0, D, 3):
    scores = []
    for t1, t2, t3 in P3:
        LL = L.copy()

        score = 0
        for dd in range(d, d+3):
            LL[t] = dd
            score += S[d, t] - np.dot(C, dd-LL)

        scores.append(score)

    smax = scores[0]
    tmax = 0
    for t, s in enumerate(scores):
        if s>smax:
            smax = s
            tmax = t

    for tt, dd in zip(P3[tmax], range(d, d+3)):
        L[tt] = dd
        print(tt+1)

d = 363
scores = []
for t1, t2 in P2:
    LL = L.copy()

    score = 0
    for dd in range(d, d+2):
        LL[t] = dd
        score += S[d, t] - np.dot(C, dd-LL)

    scores.append(score)

smax = scores[0]
tmax = 0
for t, s in enumerate(scores):
    if s>smax:
        smax = s
        tmax = t

for tt, dd in zip(P2[tmax], range(d, d+3)):
    L[tt] = dd
    print(tt+1)


### FIXED CODE ###

import numpy as np
from bisect import bisect_left

D = int(input())
C = np.array(list(map(int, input().split())))
S = np.array([list(map(int, input().split())) for d in range(D)])

L = np.empty(26, int)
L[:] = -1

X = [[-1] for _ in range(26)]
T = []

score = 0
for d in range(D):
    t = int(input())-1
    T.append(t)
    L[t] = d
    score += S[d, t] - np.dot(C, d-L)
    X[t].append(d)

for x in X:
    x.append(D)
    
M = int(input())
for _ in range(M):
    d, q = map(int, input().split())
    d-=1
    q-=1

    t = T[d]
    T[d] = q
    
    i = bisect_left(X[t], d)
    d_prev = X[t][i-1]
    d_next = X[t][i+1]
    
    dd = d-d_prev-1
    score += C[t]*(dd+1)*dd//2
    dd = d_next-d-1
    score += C[t]*(dd+1)*dd//2
    dd = d_next-d_prev-1
    score -= C[t]*(dd+1)*dd//2

    X[t].pop(i)
    
    i = bisect_left(X[q], d)
    d_prev = X[q][i-1]
    d_next = X[q][i]
    
    dd = d-d_prev-1
    score -= C[q]*(dd+1)*dd//2
    dd = d_next-d-1
    score -= C[q]*(dd+1)*dd//2
    dd = d_next-d_prev-1
    score += C[q]*(dd+1)*dd//2

    X[q].insert(i, d)

    score += S[d,q] - S[d,t]

    print(score)
N = int(input())

a = list(range(1, N+1))
sc = 0
print(sum(a)-a[-1])


### FIXED CODE ###

N = int(input())

a = list(range(1, N+1))

if N ==1:
    sc = 0
else:
    sc = int((N**2-N)/2)
print(sc)
import heapq
x,y,z,k = list(map(int, input().split())) 
a = sorted(list(map(int, input().split())),reverse=True)
b = sorted(list(map(int, input().split())),reverse=True)
c = sorted(list(map(int, input().split())),reverse=True)

ans = []
log = set()

total = (a[0] + b[0] + c[0]) * (-1)
heapq.heappush(ans, (total, 0, 0, 0))
log.add((0, 0, 0))

for i in range(k):
  (total, aa, bb, cc) = heapq.heappop(ans)
  print(total * (-1))
  if (aa+1, bb, cc) not in log:
    if aa+1 <= x:
      total = (a[aa+1] + b[bb] + c[cc]) * (-1)
      heapq.heappush(ans, (total, aa+1, bb, cc))
      log.add((aa+1, bb, cc))
  if (aa, bb+1, cc) not in log:
    if bb+1 <= y:
      total = (a[aa] + b[bb+1] + c[cc]) * (-1)
      heapq.heappush(ans, (total, aa, bb+1, cc))
      log.add((aa, bb+1, cc))
  if (aa, bb, cc+1) not in log:
    if cc+1 <= z:
      total = (a[aa] + b[bb] + c[cc+1]) * (-1)
      heapq.heappush(ans, (total, aa, bb, cc+1))
      log.add((aa, bb, cc+1))

### FIXED CODE ###

import heapq
x,y,z,k = list(map(int, input().split())) 
a = sorted(list(map(int, input().split())),reverse=True)
b = sorted(list(map(int, input().split())),reverse=True)
c = sorted(list(map(int, input().split())),reverse=True)

ans = []
log = set()

total = (a[0] + b[0] + c[0]) * (-1)
heapq.heappush(ans, (total, 0, 0, 0))
log.add((0, 0, 0))

for i in range(k):
  (total, aa, bb, cc) = heapq.heappop(ans)
  print(total * (-1))
  if (aa+1, bb, cc) not in log:
    if aa+1 < x:
      total = (a[aa+1] + b[bb] + c[cc]) * (-1)
      heapq.heappush(ans, (total, aa+1, bb, cc))
      log.add((aa+1, bb, cc))
  if (aa, bb+1, cc) not in log:
    if bb+1 < y:
      total = (a[aa] + b[bb+1] + c[cc]) * (-1)
      heapq.heappush(ans, (total, aa, bb+1, cc))
      log.add((aa, bb+1, cc))
  if (aa, bb, cc+1) not in log:
    if cc+1 < z:
      total = (a[aa] + b[bb] + c[cc+1]) * (-1)
      heapq.heappush(ans, (total, aa, bb, cc+1))
      log.add((aa, bb, cc+1))
m,n=map(int,raw_input().split())
a=[]*m
b=[]*n
p=0
q=0
while(q<m):
	q+=1
	a.append(raw_input())
while(p<n):
	p+=1
	b.append(raw_input())
flag=False
# print a
# print b
for i in xrange(n):
	if not b[i] in (a[i]):
		flag=True
		break
if flag:
	print "No"
else:
	print "Yes"

### FIXED CODE ###

a,b=map(int,raw_input().split())
if a==1:
	a=14
if b==1:
	b=14
 
def val():

	if(a>b):
		return "Alice"
	elif b>a:
		return "Bob"
	return "Draw"
print (val())
h = int(input())
w = int(input())
n = int(input())

num1 = n/h
num2 = n/w

if not num1.is_integer():
  num1 = int(num1) + 1
  
if not num2.is_integer():
  num2 = int(num2) + 1
  
return min(num1, num2)

### FIXED CODE ###

h = int(input())
w = int(input())
n = int(input())

num1 = n/h
num2 = n/w

if not num1.is_integer():
  num1 = int(num1) + 1
  
if not num2.is_integer():
  num2 = int(num2) + 1
  
num1 = int(num1)
num2 = int(num2)
print(min(num1, num2))
a, b, n = map(int, input().split())
ans = 0
for x in range(n+1):
 c = int(a*x/b)
 d = int(x/b)
 e = c - a*d
 ans = max(ans, e)
print(ans)


### FIXED CODE ###

k=int(input())
a, b=map(int, input().split())
c = True
for i in range(a, b+1):
  if i%k ==0:
    print("OK")
    c = False
    break
if c:
  print("NG")
s = input()
a = ""
for i in range(len(s)):
  if i == 1:
    a += 9
  elif i == 9:
    a += 1
print(a)

### FIXED CODE ###

s = input()

a = ""
for i in range(len(s)):
  if s[i] == str(1):
    a += str(9)
  elif s[i] == str(9):
    a += str(1)
print(a)
n, m = map(int, input().split())
s = [[int(x) for x in input().split()][1:] for y in range(m)]
p = [int(z) for z in range(m)]
ans = 0

for i in range(2**n):
    b = array([(i>>j)&1 for j in range(n)])
    if [sum(array(k) - 1) % 2 for k in s] == p:
        ans += 1
print(ans)

### FIXED CODE ###

from numpy import *
n,m = map(int, input().split())

s = [[int(j) for j in input().split()][1:] for i in range(m)]
p = [int(i) for i in input().split()]

ans = 0

for i in range(2**n):
    b = array([(i>>j)&1 for j in range(n)])
    if [sum(b[array(k)-1]) % 2 for k in s] == p:
        ans += 1
print(ans)
N, K = [int(item) for item in input().split()]
S = [item for item in input()]

def compress(arr):
    """圧縮して消えた人はhappy"""
    cnt_h = 0
    new_arr = []
    comp_arr = ['L']

    #最初は先頭をLにする　この回転はノーカン
    if arr[0] == 'R':
        for item in arr:
            if item == 'L':
                new_arr.append('R')
            else:
                new_arr.append('L')

            prev_item = item
    else:
        new_arr = arr
    # 圧縮操作と圧縮されたかずを数える

    for i in range(1, N):
        if new_arr[i - 1] == new_arr[i]:
            cnt_h += 1
        else:
            comp_arr.append(new_arr[i])

    return [comp_arr, cnt_h] 


def execute(arr, cnt_h, K):
    # 境界を全て反転するために必要な操作回数
    max_rotation = len(arr)//2
    # 全てLになるか反転回数がKに到達するかで終了
    if max_rotation <= K:
        cnt += len(arr) - 1
    else:
        cnt_h += 2*K

    return cnt_h

arr, cnt_h = compress(S)
print(execute(arr, cnt_h, K))


### FIXED CODE ###

print(int(input())**3)
from collections import Counter

n = int(input())
v = list(map(int, input().strip().split(" ")))
odd = []
even = []
for i in range(len(v)):
    if(i % 2 == 0):
        even.append(v[i])
    else:
        odd.append(v[i])


c_even = Counter(even).most_common()
c_odd = Counter(odd).most_common()

if(c_even[0][0] != c_odd[0][0]):
    print(n - c_even[0][1] - c_odd[0][1])
elif(len(c_even) != 1 and len(c_odd) != 1):
    second = max[c_even[1][1], c_odd[1][1]]
    print(n - c_even[0][1] - second)
else:
    print(min([c_even[0][1], c_odd[0][1]]))

### FIXED CODE ###

from collections import Counter
    
n = int(input())
v = list(map(int, input().split()))
odd = v[::2]
even = v[1::2]
    
c_even = Counter(even).most_common(2)
c_odd = Counter(odd).most_common(2)

    
if(c_even[0][0] != c_odd[0][0]):
    print(n - c_even[0][1] - c_odd[0][1])
else:
    if(len(c_even) == 1):
        print(n//2)
    else:
        # second = max[c_even[1][1], c_odd[1][1]]
        # print(n - c_even[0][1] - second)
        print(n - max(c_even[0][1] + c_odd[1][1], c_even[1][1] + c_odd[0][1]))
from math import pi
r = float(input())
print (format(r**2*pi, ':.6f'),format(r*pi*2, ':.6f'))

### FIXED CODE ###

from math import pi
r = float(input())
print (format(r**2*pi, '.6f'),format(r*pi*2, '.6f'))
N = int(input())
S = input()
K = int(input())

S = list(S)
c = S[K]
for i in range(N):
  if S[i] != c:
    S[i] = '*'

print(str.join('', S))

### FIXED CODE ###

N = int(input())
S = input()
K = int(input())

kc = S[K - 1]
ans = ''
for c in S:
  if c != kc:
    ans += '*'
  else:
    ans += c

print(ans)
a,b=input().split()
a=int(a)
b=b[0]+b[2:]
print(int(a*b/100))

### FIXED CODE ###

a,b=input().split()
a=int(a)
b=int(b[0]+b[2:])
print(a*b//100)
x,y = map(int, input().split())
print(int(x+y/2)

### FIXED CODE ###

x,y = map(int, input().split())
print(int(x+y/2))
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

import math
from functools import reduce
import itertools

K = intinp()

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

ans = 0
for i in range(1, K+1):
    if i ==1:
        ans += 1
        continue
    for j in range(1, K+1):
        if i ==1:
        ans += 1
        continue
        for k in range(1, K+1):
            if i ==1:
                ans += 1
                continue
            ans += gcd(i, j, k)

print(ans)


### FIXED CODE ###

def mapint_inp():
    return map(int, input().split())
 
def intinp():
    return int(input())
 
import math
import itertools
  
K = intinp()
 
ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        ij = math.gcd(i, j)
        for k in range(1, K+1):
            ans += math.gcd(ij, k)
 
print(ans)