Harryxun/stf_run huggingface dataset:
# coding: utf-8
# Your code here!
import math

N = int(input())
count = 0
count2 = 0

al=[chr(ord('a') + i) for i in range(26)]

thresh = [26**i for i in range(1,12)]
for i in range(1,len(thresh)):
 thresh[i] = thresh[i] + thresh[i-1]

for i in range(len(thresh)):
    if thresh[i] <N:
        continue
    else:
        char_num = i+1#何文字
        name_str = ['a' for i in range(char_num)]
        if char_num > 1:
            count = N-thresh[i-1]#char_numの何個目か
            #print('char_num', char_num)
            for i in range(char_num):
                count2 = int(count/(26**(char_num-i-1)))
                if (count2 > 0)&(i!=(char_num-1)):
                    #print(count2)
                    name_str[i] = al[count2]
                    count = count - ((26**(char_num-i-1))*count2)
        else:
            count = N
        if count > 0:
            name_str[-1] = al[count-1]
        break
    
    
out = ""
for i in name_str:
    out = out + i
print(out)

### FIXED CODE ###

# coding: utf-8
# Your code here!
import math

N = int(input())
count = 0
count2 = 0

al=[chr(ord('a') + i) for i in range(26)]

thresh = [26**i for i in range(1,12)]
for i in range(1,len(thresh)):
 thresh[i] = thresh[i] + thresh[i-1]
 
for i in range(len(thresh)):
    if thresh[i] <N:
        continue
    else:
        char_num = i+1#何文字
        name_str = ['a' for i in range(char_num)]
        if char_num > 1:
            count = N-thresh[i-1]#char_numの何個目か
            #print('char_num', char_num)
            for i in range(char_num):
                count2 = int((count-1)/(26**(char_num-i-1)))
                if (count2 > 0)&(i!=(char_num-1)):
                    if count2 <= 25:
                        name_str[i] = al[count2]
                        count = count - ((26**(char_num-i-1))*count2)
                    else:
                        name_str[i] = al[count2-1]
                        count = count - ((26**(char_num-i-1))*count2)
        else:
            count = N
        if count > 0:
            name_str[-1] = al[count-1]
        break
    
    
out = ""
for i in name_str:
    out = out + i
print(out)
n,q = map(int, input().split())
s = input()
c = []
for i in range(n+1):
  c.add(s[:i].count("AC"))
  
for i in range(q):
  l,r = map(int,input().split())
  print(c[r]-c[l-1])

### FIXED CODE ###

n,q = map(int, input().split())
s = input()
c = []
pre = ""
count = 0
for i in range(n):
  if pre == "A" and s[i] == "C":
    count += 1
  pre = s[i]
  c.append(count)
  
for i in range(q):
  l,r = map(int,input().split())
  print(c[r-1]-c[l-1])
a = int(input())
b = int(input())
c = int(input())
print(c,a,b)

### FIXED CODE ###

X, Y, Z = map(int, input().split())
print(Z, X, Y)
n = int(input())
p = list(map(int,input().split()))

a = [0] * n
b = [0] * n
c = []

for i in range(n):
    a[i] = 30000*i
    b[i] = 30000*(n-i)

for i in range(n):
    k = p[i]
    b[k] += i

res = ''
ans = ''
for i in range(n):
    res += str(a[i]) + ' '
    ans += str(b[i]) + ' '
print(res)
print(ans)

### FIXED CODE ###

n = int(input())
p = list(map(int,input().split()))

a = [0] * n
b = [0] * n
c = []

for i in range(n):
    a[i] = 30000*(i+1)+5
    b[i] = 30000*(n-i-1)+5

for i in range(n):
    k = p[i]
    b[k-1] += i

res = ''
ans = ''
for i in range(n):
    if i == n-1:
        res += str(a[i])
        ans += str(b[i])
    else:
        res += str(a[i]) + ' '
        ans += str(b[i]) + ' '

print(res)
print(ans)
input_ = inpur().split(",")
print(" ".join(str for i in input))

### FIXED CODE ###

input_ = input().split(',')
print(' '.join(input_))
nums = input().split()
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])

print(sort(a, b, c))

### FIXED CODE ###

nums = input().split()
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])

if a <= b <= c:
    print(a, b, c)

elif a <= c <= b:
    print(a, c, b)

elif b <= a <= c:
    print(b, a, c)

elif b <= c <= a:
    print(b, c, a)

elif c <= a <= b:
    print(c, a, b)

else:
    print(c, b, a)
while True:
   H, W = map(int, input().split())

   if H == 0 and W == 0:
      break

   for i in range(H/2):
      if H % 2 == 0:
         for j in range(W/2):
            if W % 2 == 0:
               print("#." * (W/2))
               print("")
               print(".#" * (W/2))
            else:
               print("#."*(W/2) + "#")
               print("")
               print(".#"*(W/2) + ".")
         print("")

      else:
         for j in range(W/2):
            if W % 2 == 0:
               print("#." * (W/2))
               print("")
               print(".#" * (W/2))
            else:
               print("#."*(W/2) + "#")
               print("")
               print(".#"*(W/2) + ".")
         if W % 2 == 0:
            print("#." * (W/2))
         else:
            print("#."*(W/2) + "#")
         print("")


### FIXED CODE ###

while True:
   H, W = map(int, input().split())
   if H == 0 and W == 0:
      break
   for i in range(int(H/2)):
      if W % 2 == 0:
         print("#." * int(W/2))
      else:
         print("#."*int(W/2) + "#")
      if W % 2 == 0:
         print(".#" * int(W/2))
      else:
         print(".#"*int(W/2) + ".")
   if H % 2 != 0:
      if W % 2 == 0:
         print("#." * int(W/2))
      else:
         print("#."*int(W/2) + "#")
   print("")
s=input()
print("Yes" if len(s)>=4 && s[:4]=="YAKI" else "No")

### FIXED CODE ###

s=input()
print("Yes" if len(s)>=4 and s[:4]=="YAKI" else "No")
N = int(input())

def yakusu(n):
	rn = int(n ** 0.5)
	ans = 0
	for i in range(1, int(n**0.5)):
		if n % i == 0:
			ans += 2
	if rn*rn == n:
		ret += 1
	return ret

#A = [True for i in range(10**6 + 1)]
ans = 1 # K = N
for i in range(2, min(N, 10**6+1)):
	if N % i > 0:
		continue
	if i == 2:
		ans += 1
		continue
	n = N
	while n % i == 0:
		n = n // i
	if n % i == 1:
		ans += 1
print(ans + yakusu(N-1) - 1)

### FIXED CODE ###

N = int(input())

if N == 2:
	print(1)
	exit()
if N == 3:
	print(2)
	exit()
def yakusu(n):
	rn = int(n ** 0.5)
	ret = 2
	for i in range(2, rn+1):
		if n % i == 0:
			ret += 2
	if rn*rn == n:
		ret -= 1
	return ret

#A = [True for i in range(10**6 + 1)]
ans = 1 # K = N
rn = int(N ** 0.5)
for i in range(2, rn+1):
	if N % i > 0:
		continue
	n = N
	while n % i == 0:
		n = n // i
	if n % i == 1:
		ans += 1
	n = N
	j = N // i
	if j <= i:
		continue
	while n % j == 0:
		n = n // j
	if n % j == 1:
		ans += 1
print(ans + yakusu(N-1) - 1)
a = list(map(int,input().split()))
ans = "No"
 
if a[0] == a[1]:
  a[0] != a[2]:
   	ans = "Yes"
else:
  a[0] == a[2]:
    ans = "Yes"
    
print(ans)

### FIXED CODE ###

a = list(map(int,input().split()))
ans = "No"

if a[0] == a[1]:
  if a[0] != a[2]:
   	ans = "Yes"
else:
  if a[0] == a[2] or a[1] == a[2]:
    ans = "Yes"
    
print(ans)
while True:
  x = input()
  y = input()
  if x == y == 0:
    break
  print min(x,y), max(x,y)

### FIXED CODE ###

while True:
  x,y = map(int,raw_input().split())
  if x == y == 0:
    break
  print min(x,y), max(x,y)
import sys
param=sys.argv
menseki=int(param[1])*int(param[2])
nagasa=int(param[1])*2+int(param[2])*2
print menseki nagasa

### FIXED CODE ###

import sys
param=input().split()
menseki=int(param[0])*int(param[1])
nagasa=int(param[0])*2+int(param[1])*2
print(menseki,nagasa)
def frog1(a,n):
  dp=[0]*(n)
  dp[0]=0
  dp[1]=abs(a[1],a[0])
  for i in range(2,n):
    dp[i]=min(dp[i-2]+abs(a[i]-a[i-2]),dp[i-1]+abs(a[i]-a[i-1]))
  return dp[-1]

def main():
  n=int(input())
  a=list(map(int,input().split()))
  print(frog1(a,n))
 
if __name__ == '__main__':
    main()

### FIXED CODE ###

def frog1(a,n):
  dp=[0]*(n)
  dp[0]=0
  dp[1]=abs(a[1]-a[0])
  for i in range(2,n):
    dp[i]=min(dp[i-2]+abs(a[i]-a[i-2]),dp[i-1]+abs(a[i]-a[i-1]))
  return dp[-1]
 
def main():
  n=int(input())
  a=list(map(int,input().split()))
  print(frog1(a,n))
 
if __name__ == '__main__':
    main()
import sys
sys.setrecursionlimit(10000)
N,M=list(map(int,input().split()))
graph=[[False]*N for i in range(N)]
for i in range(N):
    a,b=list(map(int, input().split()))
    graph[a-1][b-1]=True
    graph[b-1][a-1]=True
visited=[False]*N
def dfs(v,visited):
    if all(visited):
        return 1
    ret=0
    for i in range(N):
        if not graph[v][i]:
            continue
        if visited[i]:
            continue
        visited[i]=True
        ret+=dfs(i,visited)
        visited[i]=False
    return ret
visited[0]=True
print(dfs(0,visited))

### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(10000)
N,M=list(map(int,input().split()))
links=defaultdict(list)
for i in range(M):
    a,b=list(map(int, input().split()))
    links[a].append(b)
    links[b].append(a)
ct=0
visited=[False]*N
def DFS(idx):
    global visited
    if all(visited):
        global ct
        ct+=1
        return
    for i in links[idx]:
        if visited[i-1]:
            continue
        visited[i-1]=True
        DFS(i)
        visited[i-1]=False
visited[0]=True
DFS(1)
print(ct)
import itertools
import numpy as np
N = int(input())

U = 300000
is_prime = np.full(U+1, True)
is_prime[:2] = False
primes = set()
for p in range(2, U+1):
    if p*p > U:
        break
    if is_prime[p]:
        primes.add(p)
        is_prime[p*p::p] = False


ans = [2, 3, 5, 7, 11]
i = 13
while len(ans) < N:
    if i in primes:
        flg = True
        for p4 in itertools.combinations(ans, 4):
            if sum(p4)+i in primes:
                flg = False
        if flg:
            ans.append(i)
    i += 1
print(*ans)


### FIXED CODE ###

import numpy as np
N = int(input())

U = 10**5
is_prime = np.full(U+1, True)
is_prime[:2] = False
for p in range(2, U+1):
    if p*p > U:
        break
    if is_prime[p]:
        is_prime[p*p::p] = False

ans = []
for c in range(11, 55556, 5):
    if is_prime[c]:
        ans.append(c)
        if len(ans) == N:
            print(*ans)
            exit()
N = int(input())
x, y, h = [[0]*N, [0]*N, [0]*N]
for n in range(N):
  x[n], y[n], h[n] = map(int, input().split())
  if h[n] > 0:
    hi = n

def f():
  for xx in range(101):
    for yy in range(101):
      height = abs(xx-x[hi])+abs(yy-y[hi])+h[hi]
      flag = 1
      for n in range(N):
        if max(height-abs(xx-x[n])-abs(yy-y[n]), 0) is not h[n]:
          flag = 0
      if flag == 1:
        return [xx, yy, height]
print(*f())

### FIXED CODE ###

N = int(input())
x, y, h = [[0]*N, [0]*N, [0]*N]
for n in range(N):
  x[n], y[n], h[n] = map(int, input().split())
  if h[n] > 0:
    hi = n

def g(xx, yy, height):
  for n in range(N):
    if max(height-abs(xx-x[n])-abs(yy-y[n]), 0) != h[n]:
      return False
  return True

def f():
  for xx in range(101):
    for yy in range(101):
      height = abs(xx-x[hi])+abs(yy-y[hi])+h[hi]
      if g(xx, yy, height) is True:
        return [xx, yy, height]
print(*f())
import math
a, b, x = map(int, input().split())
h = x/a**2

if h >= b/2:
    tanth = a / (b - h) / 2
else:
    tanth = 2 * a * h / b**2

theta = math.degrees(math.atan(tanth))
print(90 - theta)


### FIXED CODE ###

import math
a, b, x = map(int, input().split())
h = x/a**2

if b == h:
    print(0)
elif h >= b/2:
    tanth = a / (b - h) / 2
    theta = math.degrees(math.atan(tanth))
    print(90 - theta)
else:
    tanth = 2 * a * h / b**2
    theta = math.degrees(math.atan(tanth))
    print(90 - theta)
import re

s = input()
s = re.sub("dreamer","",s)
s = re.sub("dream","",s)
s = re.sub("eraser","",s)
s = re.sub("erase","",s)

if int(s) == 0:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

import re

s = input()
s = re.sub("eraser","",s)
s = re.sub("erase","",s)
s = re.sub("dreamer","",s)
s = re.sub("dream","",s)

if len(s) == 0:
    print("YES")
else:
    print("NO")
a = x*x*x
print(a)

### FIXED CODE ###

x = int(input())
print(x*x*x)
N,Q=map(int,input().split())
l=[[]*N for i in range(N)]
ans=[0]*N


def add(index,value):
    ans[index]+=value
    for i in range(N):
        if l[index][i]==1:
            add(i,value)
    return    

for i in range(N-1):
    a,b=map(int,input().split())
    l[a-1].append(b-1)

for i in range(N-1)[::-1]:
    for item in l[i]:
        l[i]=l[i]+l[item]

print(l)

for i in range(Q):
    p,x=map(int,input().split())
    add(p-1,x)

print(*ans)


### FIXED CODE ###

# coding: utf-8
# Your code here!
#パクリゆるして
#グラフのようななにか

import sys
input=sys.stdin.readline
sys.setrecursionlimit(1000000)

from collections import deque


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

tree=[[]*(N+1) for i in range(N+1)]
point=[0]*(N+1)

for _ in range(N-1):
    a,b=map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)
    
for _ in range(Q):
    p,x=map(int,input().split())
    point[p]+=x
#print(point)

d=deque([[1,0]])

while d:
    node,parent=d.popleft()
    point[node]+=point[parent]
    lis=tree[node]
    for child in lis:
        if child==parent:
            continue
        d.append([child,node])
    #print(d)

print(*point[1:])
N = int(input())
L = int(input())
ans = {}
for i in range(N):
    A = input()
    ans[A]=1
ans = sorted(ans)
print("".join(ans))

### FIXED CODE ###

N, L = map(int, input().split())
ans = []
for i in range(N):
    A = input()
    ans.append(A)
ans = sorted(ans)
print("".join(ans))
#!/usr/bin/env python3
 
k, n = map(int, input().split())
A = list(map(int, input().split()))
A += [A[0] + K]
max_gap = max(y - x for x, y in zip(A, A[1:]))
print(K - max_gap)

### FIXED CODE ###

#!/usr/bin/env python3
 
K, N = map(int, input().split())
A = list(map(int, input().split()))
A += [A[0] + K]
max_gap = max(y - x for x, y in zip(A, A[1:]))
print(K - max_gap)
import sys
lis = list('abcdefghijklmnopqrstuvwxyz')
s = sorted(set(input()))
for i in range(26):
    if s[i] != lis[i]:
        print(lis[i])
        sys.exit()
print("None")

### FIXED CODE ###

import sys
lis = list('abcdefghijklmnopqrstuvwxyz')
s = sorted(set(input()))
for i in lis:
    if i not in s:
        print(i)
        sys.exit()
print("None")
N, A = int(input()), list(map(int, input().split()))
X = []
for i in range(N):
	P = -1
	for j in range(N):
		if (P == -1 or A[j] > A[P]): P = j
	X.append(P + 1)
	A[P] = 0
X.reverse()
print(' '.join([str(x) for x in X]))

### FIXED CODE ###

a = int(input())
if a % 2 == 0:
  print(a/(2*a))
else:
  print((a+1)/(2*a))
A,B,C,D = map(int, input().split())
if B < C or D < A:
  print('No')
else:
  print('Yes')

### FIXED CODE ###

K = int(input())
ans = ''
for i in range(K):
  ans += 'ACL'
print(ans)
mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
import numpy as np
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a,b=mi()
dp=[0]*(b+1)
for i in range(a):
  x,y=mi()
  for i in range(b-x,-1,-1):
      dp[i+x]=max(dp[i]+y,dp[i+x])
print(max(dp))

### FIXED CODE ###

mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a,b=mi()
dp=[0]*(b+1)
for i in range(a):
  x,y=mi()
  for i in range(b-x,-1,-1):
      dp[i+x]=max(dp[i]+y,dp[i+x])
print(max(dp))
#  ABC 088 B - Card Game for Two
N = int(input())
an = list(map(int, input().split()))

Alice = []
Bob = []
while len(an) > 0:
    Alice.append(max(an))
    del an[an.index(max(an))]
    Bob.append(max(an))
    del an[an.index(max(an))]

k = 0
j = 0
for i in range(len(Alice)):
    k += Alice[i]
for i in range(len(Bob)):
    j += Bob[i]

print(str(k-j))

### FIXED CODE ###

#  ABC 088 B - Card Game for Two
N = int(input())
an = list(map(int, input().split()))

Alice = []
Bob = []
while len(an) > 0:
    Alice.append(max(an))
    del an[an.index(max(an))]
    if len(an) > 0:
        Bob.append(max(an))
        del an[an.index(max(an))]
    else:
        break

k = 0
j = 0
for i in range(len(Alice)):
    k += Alice[i]
for i in range(len(Bob)):
    j += Bob[i]

print(str(k-j))
n = int(input())
a = list(map(int, input().split()))
even = []
odd = []
for i in range(n):
    if i % 2:
        even.append(a[i])
    else:
        odd.append(a[i])
if n % 2 == 0:
    print(*even[::-1], *odd)
else:
    print(*odd[::-1], *even)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
even = []
odd = []
for i in range(n):
    if i % 2:
        even.append(a[i])
    else:
        odd.append(a[i])
if n % 2 == 0:
    print(*even[::-1], end=" ")
    print(*odd)
else:
    print(*odd[::-1], end=" ")
    print(*even)
Import sys
n, m = map(int, input().split())
x = list(map(int, input().split()))
a = []

if m == 1:
    print(0)
    sys.exit()

#x.sort()
list.sort(x)
#print(x)

for i in range(1, m):
    a.append(x[i] - x[i-1])

list.sort(a, reverse=True)
#print(a)

count = max(x) - min(x)
for i in range(n-1):
    if len(a) == 0:
        break
    count -= a[i]

print(count)


### FIXED CODE ###

import sys
n, m = map(int, input().split())
x = list(map(int, input().split()))
a = []

if m == 1:
    print(0)
    sys.exit()

#x.sort()
list.sort(x)
#print(x)

for i in range(1, m):
    a.append(x[i] - x[i-1])

#list.sort(a, reverse=True)
a.sort()
#print(a)

count = max(x) - min(x)
for i in range(n-1):
    if len(a) == 0:
        break
    a.pop()
#    count -= a[i]

#print(count)
print(sum(a))
N = int(input())
n=[]
for i in range(N):
    n.append(input())
M = int(input())
m=[]
for i in range(M):
    m.append(input())
max=0
for i in n:
    max=max((n.count(i)-m.count(i)), max)
print(max)

### FIXED CODE ###

N=int(input())
n=[str(input()) for i in range(N)]
M=int(input())
m=[str(input()) for i in range(M)]
print(max(0, max(n.count(n[i])-m.count(n[i]) for i in range(N))))
import numpy as np

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

H = np.array(list(map(int, input().split())))

dp = np.zero(N, dtype=int)

for i in range(1, N):
    start = max(0, i-K)
            dp[i] = min(dp[start:i]+np.abs(H[i]-H[start:i]))

print(dp[N-1])

### FIXED CODE ###

import numpy as np

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

H = np.array(list(map(int, input().split())))

dp = np.zeros(N, dtype=int)

for i in range(1, N):
    start = max(0, i-K)
    dp[i] = min(dp[start:i]+np.abs(H[i]-H[start:i]))

print(dp[N-1])
S = list(map(int, input()))

count = 0
for i in range(len(S)):
  if S[i]!=S[i+1]:
  	del S[i],S[i+1]
    count +=2
  	continue  
  elif S[len(S)]==S[len(S)+1]
  	break
  else:
  	continue
    
print(count)

### FIXED CODE ###

S = list(map(int, input()))

S_1 = [S[i] for i in range(len(S)) if S[i]==1]
S_0 = [S[i] for i in range(len(S)) if S[i]==0]

S_min = min(len(S_1), len(S_0))

print(2*S_min)
n=int(input())
mod=10**9+7
for i in range(1,n+1):
  ans=ans*i%mod
print(ans)

### FIXED CODE ###

n=int(input())
mod=10**9+7
ans=1
for i in range(1,n+1):
  ans=ans*i%mod
print(ans)
r=int(input())
print(int(r**2)

### FIXED CODE ###

r=int(input())
print(int(r**2))
def a():
    s, t  = input().split()
    print(s)
    print(t)
    s_n, t_n = input().split()
    u = input()
    print(u)
    if u == s:
        s_n = int(s_n) - 1
    elif t == u:
        t_n = int(t_n) - 1
    return f"{s_n} {t_n}"
a()

### FIXED CODE ###

def a():
    s, t  = input().split()
    s_n, t_n = input().split()
    u = input()
    if u == s:
        s_n = int(s_n) - 1
    elif t == u:
        t_n = int(t_n) - 1
    return str(s_n) + " " + str(t_n)
print(a())
S = input()
leng = len(S)

count = [0] * 2019
count[0] = 1

for i in range(leng):
    remainder = int(S[i:]) % 2019
    count[remainder] += 1

res = 0
for cnt in count:
    res += cnt * (cnt - 1) // 2
    
print(res)


### FIXED CODE ###

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

if W >= S:
  print('unsafe')
else:
  print('safe')
k = int(input())
a, b = map(int, input().split())

if k == 1:
  print("OK")
  exit()
else:
  for i in range(a, b):
    if i % k == 0:
      ans = "OK"
      break
    else:
      ans = "NG"
print(ans)

### FIXED CODE ###

k = int(input())
a, b = map(int,input().split())
for i in range(a, b + 1):
  if i % k == 0:
    print("OK")
    exit()

print("NG")
n, q = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n-1)]
px = [list(map(int, input().split())) for _ in range(q)]

node = [0] * n
par = [-1] * n
for a, b in ab:
    par[b-1] = a-1
for p, x in px:
    node[p-1]+=x
def dfs(i, count=0):
    count+=node[i]
    if par[i] == -1:
        return count
    else:
        return dfs(par[i], count)
print(' '.join([str(dfs(i)) for i in range(n)]))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
n, q = map(int, input().split())
node = [0] * n
to = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    to[b-1].append(a-1)
    to[a-1].append(b-1)
for _ in range(q):
    p, x = map(int, input().split())
    node[p-1]+=x

def dfs(i, source, count=0):
    node[i]+=count
    for next_node in to[i]:
        if next_node == source: continue 
        dfs(next_node, i, node[i])
dfs(0, -1, 0)

print(' '.join(list(map(str, node))))
SUM = 0
N = int(input())
for num in range(N):
	P[num] = int(input())

P.sort(reverse=True)
P[0] = P[0]//2

for num in range(N):
	SUM += P[num]

print(SUM)

### FIXED CODE ###

S = 0
N = int(input())
P=[]
for num in range(N):
	P.append(int(input()))

P.sort(reverse=True, key=int)
P[0] = P[0]//2

for num in range(N):
	S += P[num]

print(S)
A, B=map(int, input().split())
ans=a-2*b if a-2*b>0 else 0
print(ans)

### FIXED CODE ###

a, b=map(int, input().split())
ans=a-2*b if a-2*b>0 else 0
print(ans)
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]

cnt = 0
di = 0
while di <= x:
  cnt += 1
  di += l[cnt-1]

print(cnt)

### FIXED CODE ###

n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]

cnt = 0
di = 0

if sum(l) < x or sum(l) is x:
  print(n + 1)
else:
  for i, li in enumerate(l, 1):
    di += li
    if di > x:
      i -= 1
      break
    if di is x:
      break
    
  print(i+1)
import sys
dp=[0]+[1<<20]*10000
n=int(input())
a=list(map(int,sys.stdin.readlines()))
for i in range(1,n):
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a[i-1]),(dp[i-j],dp[j]+a[i-1])])
print(dp[n//2])

### FIXED CODE ###

dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])
n=raw_input()
A=map(raw_input.split())
q=raw_input()
m=map(raw_input.split())

def solve(i, m)
  if m == 0:
    return true
  if i >= n:
    return false
  res = solve(i + 1, m) || solve(i + 1, m - A[i])
  return res

for i range(0,q):
  if solve(0,m[i])==1:
    return yes
  else:
    return no

### FIXED CODE ###

n=int(raw_input())
A=map(int, raw_input().split())
q=int(raw_input())
m=map(int, raw_input().split())

def solve(j, m):
  if m == 0:
    return 1
  if j >= n or m > sum(A):
    return 0
  res = solve(j + 1, m) or solve(j + 1, m - A[j])
  return res

for i in range(0,q):
  if solve(0,m[i]):
    print "yes"
  else:
    print "no"
n, k ,s = map(int, input().split())
ans = []

if s<10**9:
    for i in range(n):
        if i <= k-1:
            ans.append(s)
        else:
            ans.append(s+1)
elif s==10**9:
    for j in range(n):
        if i <= k-1:
            ans.append(s)
        else:
            ans.append(1)
ans = map(str, ans)
print(' '.join(ans))


### FIXED CODE ###

n, k ,s = map(int, input().split())
ans = []

if s<10**9:
    for i in range(n):
        if i <= k-1:
            ans.append(s)
        else:
            ans.append(s+1)
elif s==10**9:
    for j in range(n):
        if j <= k-1:
            ans.append(s)
        else:
            ans.append(1)
ans = map(str, ans)
print(' '.join(ans))