Harryxun/stf_run huggingface dataset:
n,m,x = map(int,input().split())
c_ = [list(map(int,input().split())) for i in range(n)]

cc_ = []
for i in range(n):
    cc_.append(c_[i][0])
# print(cc_)

import numpy as np
import itertools
l = np.arange(n)

res1_ = []
res2_ = []
res3_ = []
cc_r_ = []
resList = []
flag = False
for i in range(2,n+1):
    c = list(itertools.combinations(l, i))
    for j in c:
        # print(j)
        res1_ = []
        res2_ = []
        res3_ = []
        cc_r_ = []
        for k in range(len(j)):
            res1_.append(c_[j[k]][1])
            res2_.append(c_[j[k]][2])
            res3_.append(c_[j[k]][3])
            cc_r_.append(cc_[j[k]])
        res1 = sum(res1_)
        res2 = sum(res2_)
        res3 = sum(res1_)
        cc_r = sum(cc_r_)
        if res1 >= x and res2 >= x and res3 >= x:
            resList.append(cc_r)
            flag = True

print(min(resList) if flag else -1)


### FIXED CODE ###

n,m,x = map(int,input().split())
c_ = [list(map(int,input().split())) for i in range(n)]

# print(c_)
cc_ = []
for i in range(n):
    cc_.append(c_[i][0])
# print(cc_)

import numpy as np
import itertools
l_ = np.arange(n).tolist()

res_ = []
resList = []
flag = False
flag3 = True
if n == 1:
    for i in range(m):
        if c_[0][i+1] < x:
            # print(c_[0][i+1])
            flag3 = False
    print(cc_[0] if flag3 else -1)
else:
    for i in range(1,n+1):
        c = list(itertools.combinations(l_, i))
        for j in c:
            res_ = []
            flag2 = True
            for l in range(m):
                res = 0
                sum_money = 0
                for k in range(len(j)):
                    res += c_[j[k]][l+1]
                    sum_money += c_[j[k]][0]
                # print(res,sum_money)
                if res < x:
                    flag2 = False
            if flag2:
                resList.append(sum_money)
                flag = True
    # print(resList)
    print(min(resList) if flag else -1)
#import numpy as np
#import csv
import sys
#import time

def main():
  argv = sys.argv
  print(argv[2]+argv[1])


if __name__  == "__main__":
  try:
    main() #main
  #error IO Error
  except IOError as error:
    print("No file.")

### FIXED CODE ###

import sys

def main():
  ri=raw_input().split()
  if len(ri) > 0:
    print(str(ri[1]+ri[0]))


if __name__  == "__main__":
  try:
    main() #main
  #error IO Error
  except IOError as error:
    print("No file.")
def f(x):
    if len(glaph[x]) == 0:
        return dp[x]
    y = 0
    for i in glaph[x]:
        y = max(y,f(i)+1)
    dp[x] = y
    return dp[x]
n,m = map(int,input().split())
glaph = [[] for i in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    glaph[x].append(y)
dp = [0]*(n+1)
ans = 0
for i in range(1,n+1):
    ans = max(ans,f(i))
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
def f(x):
    if flg[x]:
        flg[x] = 0
        p = 0
        for y in glaph[x]:
            p = max(p,f(y)+1)
        dp[x] = p
    return dp[x]
n,m = map(int,input().split())
flg = [1]*(n+1)
dp = [0]*(n+1)
glaph = [[] for i in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    glaph[x].append(y)
ans = 0
for i in range(1,n+1):
    ans = max(ans,f(i))
print(ans)
s = input()
t = input()
m, n = len(s), len(t)
dp = [[0 for _ in range(n+1)] for _ in range(m+1)]

for i in range(1, m+1):
  for j in range(1, n+1):
    if s[i-1] == t[j-1]:
      dp[i][j] = d[i-1][j-1] + 1
    else:
      dp[i][j] = max(dp[i-1][j], dp[i][j-1])

res = ''
i, j = m, n
while i > 0 and j > 0:
  if dp[i][j] == dp[i-1][j]:
    i -= 1
  elif dp[i][j] == dp[i][j-1]:
    j -= 1
  else:
    i -= 1
    j -= 1
    res = s[i] + res
print(res)

### FIXED CODE ###

s = input()
t = input()
m, n = len(s), len(t)
dp = [[0 for _ in range(n+1)] for _ in range(m+1)]

for i in range(1, m+1):
  for j in range(1, n+1):
    if s[i-1] == t[j-1]:
      dp[i][j] = dp[i-1][j-1] + 1
    else:
      dp[i][j] = max(dp[i-1][j], dp[i][j-1])

res = ''
i, j = m, n
while i > 0 and j > 0:
  if dp[i][j] == dp[i-1][j]:
    i -= 1
  elif dp[i][j] == dp[i][j-1]:
    j -= 1
  else:
    i -= 1
    j -= 1
    res = s[i] + res
print(res)
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    A=LI()
    ans=[0]*N
     
     
    for i in range(N):
        ans[A[i]-1]+=1
        
    for i in range(N):
        print(ans[i])

main()


### FIXED CODE ###

import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    A=LI()
    ans=[0]*N
     
     
    for i in range(N-1):
        ans[A[i]-1]+=1
        
    for i in range(N):
        print(ans[i])

main()
from decimal import *
x=int(input())

for i in range (100):
  h=Decimal(x)-Decimal(i)**Decimal('5')
  if h<0:
    bh=Decimal(h)**Decimal('0.2')
    if Decimal(bh)%1==0:
      print(i,int(bh))
      exit()
  else:
    hh=abs(h)
    bh=Decimal(h)**Decimal('0.2')
    if Decimal(bh)%1==0:
      print(i,(-1)*int(bh))
      exit()

### FIXED CODE ###

x=int(input())

for i in range (200):
  for j in range (-200,200):
    if (i**5-j**5)==x:
      print(i,j)
      exit()
i = list(map(int,input().split()))
K = i[0]
X = i[1]
print(int(range(X-K+1,X+K)))

### FIXED CODE ###

i = list(map(int,input().split()))
K = i[0]
X = i[1]
C = range(X-K+1,X+K)
print(' '.join(map(str,list(C))))
N_s = input()
N = int(N_s)
ans = 0
for i in range(1, len(N_s)):
	if i % 2 == 1:
    	ans += 10**i - 10**(i - 1)
if len(N_s) % 2 == 1:
  	ans += 1 - 10**(len(N_s)) + N
print(ans)


### FIXED CODE ###

n = int(input())
cnt = 0
for i in range(1, n + 1):
  if len(str(i)) % 2 == 1:
    cnt +=1
print(cnt)
def main():
    n, a, b, c, d = list(map(lambda x: int(x) - 1, input().split()))
    n += 1
    s = list(input())
    s = s[a:d + 1]
    for i in range(len(s) - 1):
        if s[i] == '#' and s[i + 1] == '#':
            print('No')
            exit()
    if c < d:
        print('Yes')
    else:
        ch = False
        for i in range(b, d + 1):
            if s[i - 1] == s[i] == s[i + 1] == '.':
                ch = True
        if ch:
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, a, b, c, d = list(map(lambda x: int(x) - 1, input().split()))
    n += 1
    s = list(input())
    s = s[a:max(c, d) + 1]
    for i in range(len(s) - 1):
        if s[i] == '#' and s[i + 1] == '#':
            print('No')
            exit()
    if c < d:
        print('Yes')
    else:
        ch = False
        for i in range(b, d + 1):
            if s[i - 1] == s[i] == s[i + 1] == '.':
                ch = True
        if ch:
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()
n = int(input())
print(str(2*math.pi*n))

### FIXED CODE ###

import math

n = int(input())
print(str(2*math.pi*n))
n, k = map(int, input().split())
num = [0] * n
for i in range(1, n+1):
    num[i % k] += 1
ans = 0
for a in range(k):
    b = (k-a) % k
    c = (k-a) % k
    if ((b+c) % k != 0):
        continue
    ans += num[a] * num[b] * num[c]
print(ans)


### FIXED CODE ###

n, k = map(int, input().split())
num = [0] * k
for i in range(1, n+1):
    num[i % k] += 1
ans = 0
for a in range(k):
    b = (k-a) % k
    c = (k-a) % k
    if ((b+c) % k != 0):
        continue
    ans += num[a] * num[b] * num[c]
print(ans)
a, b, c = map(int(), input().split())
if a + b >= c:
  print("Yes\n")
else :
  print("No\n")

### FIXED CODE ###

a, b, c = map(int, input().split())
if a + b >= c:
  print("Yes\n")
else :
  print("No\n")
a = input()
x = 0
while 2**x <=a:
    boxs = 2 ** x
    x += 1
print(boxs)

### FIXED CODE ###


N=int(input())
k=0
while 2**k <= N:
    ans = 2**k
    k += 1
print(ans)
def min_steps_v2(n, a, b):
    if (b - a) % 2 == 0:
        return int((b - a) / 2)
 
    # odd case
    a_diff = a - 1
    b_diff = n - b
 
    if a_diff > b_diff:
      steps_to_even = n - b + 1
      remain_steps = min_steps_v2(n, A + (N - B) + 1, N)
    else:
      steps_to_even = a
      remain_steps = min_steps_v2(n, 1, b - a)
 
    return int(steps_to_even + remain_steps)
 
numbers = input().split(' ')
 
n = int(numbers[0])
a = int(numbers[1])
b = int(numbers[2])
 
print(min_steps_v2(n, a, b))


### FIXED CODE ###

import numpy as np

def min_steps_v2(n, a, b):
    n = np.int64(n)
    a = np.int64(a)
    b = np.int64(b)

    if (b - a) % 2 == 0:
        return np.int64(int(b - a) // 2)
 
    # odd case
    a_diff = a - 1
    b_diff = n - b
 
    if a_diff > b_diff:
      steps_to_even = n - b + 1
      remain_steps = min_steps_v2(n, a + (n - b) + 1, n)
    else:
      steps_to_even = a
      remain_steps = min_steps_v2(n, 1, b - a)
 
    return steps_to_even + remain_steps

numbers = input().split(' ')
 
n = int(numbers[0])
a = int(numbers[1])
b = int(numbers[2])
 
print(min_steps_v2(n, a, b))
n,q = map(int,input().split())

v = [[] for i in range(n)] # []のn個配列
for i in range(n-1):
  a,b = map(int,input().split())
  a -= 1 # listのindex参照をそのまま使いたいので頂点id(1から始まっている)を-1しておく
  b -= 1 # aと同様
  v[a].append(b)
  v[b].append(a)

f = [0]*n
for i in range(q):
  p,x = map(int,input().split())
  p -= 1 # aと同様
  f[p] += x

def dfs(x,d,s): # x:計算する頂点（上側）, d:計算済み(0)か否か(1), s:頂点xの値
  for y in v[x]: # 頂点xとつながる各頂点yの計算を行う
    if d[y]: # 頂点yが計算未了の場合
      s += f[y] # 頂点xの値sに頂点yの値を足す
      ans[y] = s # 頂点yの値はsに確定
      d[y] = 0 # 頂点yの計算は終わったのでd[y]=0とする
      dfs(y,d,s) # 頂点yの下層についても再帰的に計算
      s -= f[y] # 頂点yの下層の計算が終わったので、sを頂点xの値に戻す

ans = [0]*n
d = [1]*n
d[0] = 0
ans[0] = f[0]
s = f[0]

dfs(0,d,s)
print(*ans) #ansの中身を展開

### FIXED CODE ###

from collections import deque
 
# BFSで通す
N, Q = map(int, input().split())  # N頂点, Q個の命令
 
G = [[] for _ in range(N)]
count = [0]*N
for i in range(N-1):  # 辺はN-1本
    a, b = map(lambda x: int(x)-1, input().split())
    G[a].append(b)
    G[b].append(a)
 
for i in range(Q):  # Q個の操作について
    p, x = map(int, input().split())
    count[p-1] += x
 
q = deque([0])
flag = [False]*N
 
while len(q):
    v = q.pop()
    flag[v] = True
    for e in G[v]:  # vを親にもつノードについてループを回す
        if flag[e]:  # 頂点eに到達済みであれば
            continue
        count[e] += count[v]  # それぞれの子たちに親の値を伝播させる
        q.append(e)
 
print(*count)
h,w=map(int,input().split())

ans=[[0]*w for i in range(h)]
s=[[""]*w for i in range(h)]
for i in range(h):
  s[i]=input()
  for j in range(w):
    if (s[i][j]=="#"):
      ans[i][j]="#"
      if (i-1>=0 and j-1>=0):
        ans[i-1][j-1]+=1
      if (i-1>=0):
        ans[i-1][j]+=1
      if (i-1>=0 and j+1<w):
        ans[i-1][j+1]+=1
      if (j-1>=0):
        ans[i][j-1]+=1
      if (j+1<w):
        ans[i][j+1]+=1
      if (i+1<h and j-1>=0):
        ans[i+1][j-1]+=1
      if (i+1<h):
        ans[i+1][j]+=1
      if (i+1<h and j+1<w):
      	ans[i+1][j+1]+=1
    

for i in range(h):
  answer=""
  for j in range(w):
    answer+=str(ans[i][j])
  print(answer)
    

### FIXED CODE ###

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

ans=[[0]*w for i in range(h)]
s=[[""]*w for i in range(h)]
for i in range(h):
  s[i]=input()

for i in range(h):
  for j in range(w):
    if (s[i][j]=="#"):
      ans[i][j]="#"
      if (i-1>=0 and j-1>=0):
        if (ans[i-1][j-1]!="#"):
            ans[i-1][j-1]+=1
      if (i-1>=0):
         if (ans[i-1][j]!="#"):
            ans[i-1][j]+=1
      if (i-1>=0 and j+1<w):
        if (ans[i-1][j+1]!="#"):
          ans[i-1][j+1]+=1
      if (j-1>=0):
        if (ans[i][j-1]!="#"):
          ans[i][j-1]+=1
      if (j+1<w):
        if (ans[i][j+1]!="#"):
          ans[i][j+1]+=1
      if (i+1<h and j-1>=0):
        if (ans[i+1][j-1]!="#"):
          ans[i+1][j-1]+=1
      if (i+1<h):
        if (ans[i+1][j]!="#"):
          ans[i+1][j]+=1
      if (i+1<h and j+1<w):
        if (ans[i+1][j+1]!="#"):
          ans[i+1][j+1]+=1
    

for i in range(h):
  answer=""
  for j in range(w):
    answer+=str(ans[i][j])
  print(answer)
from math import ceil
L = int(input())
A = [int(input()) for _ in range(L)]
even = 0
start, end = 0, L-1
if A[0] == 0:
	for i in range(1, L):
		if A[i] != 0:
			start = i
			break
if A[-1] == 0:
	for i in reversed(range(L-1)):
		if A[i] != 0:
			end = i
			break
for a in A[start:end+1]:
	if a % 2 == 0:
		even += 1
if A[start] % 2 == 0 and A[start+1] % 2 == 1:
	even -= 1
if A[end-1] % 2 == 1 and A[end] % 2 == 0:
	even -= 1
		
print(ceil(even/2))

### FIXED CODE ###

L = int(input())
A = [int(input()) for _ in range(L)]
INF = 10**20
DP = [[INF for i in range(5)] for _ in range(L)]
DP[0][0] = A[0]
DP[0][1] = (2 if A[0] == 0 else 1 if A[0] % 2 == 1 else 0)
DP[0][2] = (1 if A[0] % 2 == 0 else 0)
DP[0][3] = (2 if A[0] == 0 else 1 if A[0] % 2 == 1 else 0)
DP[0][4] = A[0]

for i in range(1, L):
    a = A[i]
    DP[i][0] = DP[i-1][0] + a
    DP[i][1] = min(DP[i-1][:2]) + (2 if a == 0 else 1 if a % 2 == 1 else 0)
    DP[i][2] = min(DP[i-1][:3]) + (1 if a % 2 == 0 else 0)
    DP[i][3] = min(DP[i-1][:4]) + (2 if a == 0 else 1 if a % 2 == 1 else 0)
    DP[i][4] = min(DP[i-1]) + a

print(min(DP[L-1]))
numbers = list(map(int, input().split()))
k = int(input())
sum = 0
for i in range(3):
  if i == numbers.index(max(numbers)):
    sum += max(numbers) * (2 ** k) 
  else:
    sum += numbers[i]
print(sum)

### FIXED CODE ###

a, b = map(int,input().split())
if a <= b:
  print(a)
elif a > b:
  print(a-1)
K = int(input())
if K%2 = 0:
    A = (K/2)*(K/2)
else:
    A = ((K-1)/2)*((K+1)/2)

print(A)

### FIXED CODE ###

K = int(input())
if K%2 == 0:
    A = (K/2)*(K/2)
else:
    A = ((K-1)/2)*((K+1)/2)

print(int(A))
n = int(input())
uvw = [list(map(int,input().split())) for _ in range(n-1)]

uvw =sorted(uvw,key = lambda x:(x[0],x[1]))
tree={}
tree[uvw[0][0]]=0  

for i in range(n-1):
  # treeと一致しているやつ
  if uvw[i][0] in tree:
    left = uvw[i][1]
    right = uvw[i][0]
  else:
    left = uvw[i][0]
    right = uvw[i][1]    
      
  if uvw[i][2]%2==0:
    tree[left] = tree[right]
  else:
    tree[left] = abs(tree[right]-1) 

if sum(tree.values())==0:
  tree[uvw[0][0]]=1

for item in sorted(tree.items()):
  print(item[1])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

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

e =[[] for _ in range(n)]
color = [-1]*n
dw = {}

for u,v,w in uvw:
  e[u-1].append(v-1)
  e[v-1].append(u-1)
  dw[(u-1,v-1)] = dw[(v-1,u-1)] = w

def dfs(i,c)  :
  color[i] = c
  for ei in e[i]:
    if color[ei] != -1:
      continue
    dfs(ei, c+dw[(i,ei)])

dfs(0,0)   

for c in color:
  print(c%2)
a,b,c,d = map(int,input())

if a+b+c+d == 7:
    print(a+"+"+b+"+"+c+"+"+d+"=7")
elif a+b+c-d == 7:
    print(a+"+"+b+"+"+c+"-"+d+"=7")
elif a+b-c-d == 7:
    print(a+"+"+b+"-"+c+"-"+d+"=7")
elif a-b-c-d == 7:
    print(a+"-"+b+"-"+c+"-"+d+"=7")
elif a-b+c-d == 7:
    print(a+"-"+b+"+"+c+"-"+d+"=7")
elif a-b-c+d == 7:
    print(a+"-"+b+"-"+c+"+"+d+"=7")
elif a-b+c-d == 7:
    print(a+"-"+b+"+"+c+"-"+d+"=7")

### FIXED CODE ###

a,b,c,d = map(int,input())

if a+b+c+d == 7:
    print(str(a) + "+" + str(b) + "+" + str(c) + "+" + str(d) + "=" + "7")
elif a+b+c-d == 7:
    print(str(a) + "+" + str(b) + "+" + str(c) + "-" + str(d) + "=" + "7")
elif a+b-c+d == 7:
    print(str(a) + "+" + str(b) + "-" + str(c) + "+" + str(d) + "=" + "7")
elif a+b-c-d == 7:
    print(str(a) + "+" + str(b) + "-" + str(c) + "-" + str(d) + "=" + "7")
elif a-b-c-d == 7:
    print(str(a) + "-" + str(b) + "-" + str(c) + "-" + str(d) + "=" + "7")
elif a-b-c+d == 7:
    print(str(a) + "-" + str(b) + "-" + str(c) + "+" + str(d) + "=" + "7")
elif a-b+c-d == 7:
    print(str(a) + "-" + str(b) + "+" + str(c) + "-" + str(d) + "=" + "7")
elif a-b+c+d == 7:
    print(str(a) + "-" + str(b) + "+" + str(c) + "+" + str(d) + "=" + "7")
import itertools as it  
n=int(input())
li=[i for i in range(1,n+1)]
li=li*3
print(len(set(itertools.combinations(li,3))))


### FIXED CODE ###

import itertools
n=input()
n=int(n)
if n>=1 and n<=9:
	li=[i for i in range(1,n+1)]
	li=li*3
	print(len(set(itertools.combinations(li,3))))
else:
  pass
import math
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
def function(m, a):
  count = 0
  for i in a:
    count += m%i
  return count
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
max_num = lcm(*a)-1
print(function(max_num, a))


### FIXED CODE ###

import math
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
def function(m, a):
  count = 0
  for i in a:
    count += m%i
  return count
def lcm_base(x, y):
    return (x * y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
max_num = lcm(*a)-1
print(function(max_num, a))
N=input().replace(""," ").split()
N=set(N)
if len(N)<=2:
    print("Yes")
elif len(N)>=3
    print("No")


### FIXED CODE ###

n=list(input())
if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
    print("Yes")
else:
    print("No")
n = int(raw_input())
h = list(map(int, raw_input().split()))
memo = {}

def get_cost(i, j):
    return abs(h[i] - h[j])

def get_min_cost_for_postion(i):
    if i >= n-1:
        return 0
    if i == n - 2:
        return get_cost(n-2, n-1)
    if i == n - 3:
        return min(get_cost(n-3, n-2), get_cost(n-3, n-1))

    if i in memo:
        return memo[i]

    ans = min(
        get_cost(i, i+1) + get_min_cost_for_postion(i+1),
        get_cost(i, i+2) + get_min_cost_for_postion(i+2))

    memo[i] = ans
    return ans

ans = get_min_cost_for_postion(0)

print ans


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

n = int(raw_input())
h = list(map(int, raw_input().split()))
memo = {}

def get_cost(i, j):
    if j >= n:
        return 0
    return abs(h[i] - h[j])

def get_min_cost_from_postion(i):
    if i >= n-1:
        return 0
    if i in memo:
        return memo[i]
    k = min(2, (n-1)-i)
    ans = min(
        get_cost(i, i+x) + get_min_cost_from_postion(i+x) for x in range(1,k+1))

    memo[i] = ans
    return ans

ans = get_min_cost_from_postion(0)

print ans
a,b,c,x = map(int,input().split())
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*a + 100*b + 50*c == x:
                ans += 1
print(ans)




  

### FIXED CODE ###

a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)
c = input()

p = {}
p["A"] = "T"
p["G"] = "C"

print(p[c])

### FIXED CODE ###

c = input()

p = {}
p["A"] = "T"
p["G"] = "C"
p["T"] = "A"
p["C"] = "G"

print(p[c])
import numpy as np

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


#W1=[i for i in Wd if i<=N]
#W2=[i for i in Wd if i>N]
for i in range(N):
	S1=sum(W[:i])
	S2=sum(W[i:])
	print(f'S1={S1}')
	print(f'S2={S2}')
	
	S.append(abs(S1-S2))
	print(S)
	S1=0
	S2=0

print(min(S))

### FIXED CODE ###

import numpy as np

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


#W1=[i for i in Wd if i<=N]
#W2=[i for i in Wd if i>N]
for i in range(N):
	S1=sum(W[:i])
	S2=sum(W[i:])
	#print(f'S1={S1}')
	#print(f'S2={S2}')
	
	S.append(abs(S1-S2))
	#print(S)
	S1=0
	S2=0

print(min(S))
a, b, k = map(int, input().split())
x = 0

for i in range(k):
    x = a + i
    if x > b:
        break
    print(x)


for i in range(k-1, -1, -1):
    y = b - i
    if y <= x:
        continue
    print(y)


### FIXED CODE ###

s = input()
a, b, c = 0, 0, 0

for i in s:
    if i == "a" and a == 0:
        a += 1
    elif i == "b" and b == 0:
        b += 1
    elif i == "c" and c == 0:
        c += 1
    else:
        print("No")
        break
else:
    print("Yes")
def bfs(k):
    p=k
    frontier=[1]
    visited={1:1}
    while frontier:
        next=[]
        for u in frontier:
            if u==1:
                l=k-1
            else:
                l=k-2
            i=0
            if u in adj:
            	for v in adj[u]:
                	if v not in visited:
                    	visited[v]=1
                    	p=(p*(l-i))%(10**9+7)
                    	i+=1
                    	next.append(v)
        frontier=next
    return p
  
n,k=map(int,input().split())
adj={}
for w in range(n-1):
    a,b=map(int,input().split())
    if a not in adj:
        adj[a]=[b]
    else:
        adj[a].append(b)
    if b not in adj:
        adj[b]=[a]
    else:
        adj[b].append(a)
print(bfs(k))

### FIXED CODE ###

def bfs(k):
    p=k
    level={1:1}
    frontier=[1]
    while frontier:
        next=[]
        for u in frontier:
            if u==1:
                l=k-1
            else:
                l=k-2
            i=0
            for v in adj[u]:
                if v not in level:
                    level[v]=1
                    p=(p*(l-i))%(10**9+7)
                    i+=1
                    next.append(v)
        frontier=next
    return p
n,k=map(int,input().split())
adj={}
for i in range(n-1):
    a,b=map(int,input().split())
    if a not in adj:
        adj[a]=[b]
    else:
        adj[a].append(b)
    if b not in adj:
        adj[b]=[a]
    else:
        adj[b].append(a)
if n==1:
  print(k)
else:
  print(bfs(k))
from bisect import bisect_left, bisect, insort

def dfs(v, p):
    i = bisect_left(dp, a[v])
    dp[i], old = a[v], dp[i]
    ans[v] = i
    if p != -1:
        ans[v] = max(ans[v], ans[p])
    for u in to[v]:
        if u == p:
            continue
        dfs(u, v)

if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))
    to = [[] for _ in range(n)]
    ans = [None]*n
    INF = 10**10
    for _ in range(n-1):
        u, v = map(int, input().split())
        u -= 1
        v -= 1
        to[u].append(v)
        to[v].append(u)
    dp = [INF]*n
    dp[0] = -INF
    dfs(0, -1)
    print("\n".join(list(map(str, ans))))

### FIXED CODE ###

from bisect import bisect_left
import sys
sys.setrecursionlimit(1000000)


def dfs(v, p):
    i = bisect_left(dp, a[v])
    dp[i], old = a[v], dp[i]
    ans[v] = bisect_left(dp, INF)-1
    for u in to[v]:
        if u == p:
            continue
        dfs(u, v)
    dp[i] = old

if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))
    to = [[] for _ in range(n)]
    ans = [0]*n
    INF = 10**20
    for _ in range(n-1):
        u, v = map(int, input().split())
        u -= 1
        v -= 1
        to[u].append(v)
        to[v].append(u)
    dp = [INF]*(n+1)
    dp[0] = -INF
    dfs(0, -1)
    print("\n".join(list(map(str, ans))))
n = int(input())
s = list(map(int,input().split()))
if 0 in s:
  print(0)
  exit()
for _ in range(n):
  ans *= s[_]
  if ans > 10**18:
    print(-1)
    exit()
else:
  print(ans)



### FIXED CODE ###

n = int(input())
s = list(map(int,input().split()))
ans = 1
if 0 in s:
  print(0)
  exit()
for _ in range(n):
  ans *= s[_]
  if ans > 10**18:
    print(-1)
    exit()
else:
  print(ans)
x,a = map(int,input().split())
if x < a:
  print(0)
else:
  print(10)

### FIXED CODE ###

r = int(input())
print(3*r**2)
N, X = map(int, input().split())
listx = list(map(int, input().split()))
subx = []

for i in range(N):
  subx.append(abs(listx[i] - X))

def gcd(a,b):
  if a < b:
    a, b = b, a
  while a % b != 0:
    a, b = b, a % b
  return b

ans = gcd(subx[0], subx[1])

for i in range(2, N-1):
  ans = gcd(ans, subx[i])
  
print(ans)

### FIXED CODE ###

import fractions
from functools import reduce
N, X = map(int, input().split())
listx = list(map(int, input().split()))
subx = []
for i in range(N):
  subx.append(abs(listx[i] - X))
  
def lcm_list(numbers):
    return reduce(fractions.gcd, numbers)

ans = lcm_list(subx)

print(ans)