Harryxun/stf_run huggingface dataset:
S=str(input())
N=S.count('o')
if N>=8:
    pint('Yes')
else:
    print('No')


### FIXED CODE ###

S=str(input())
N=8-S.count('o')
n=15-len(S)
if n>=N:
    print('YES')
else:
    print('NO')
N, K = map(int,input().split())	
Se = input()

S = S.replace(S[K-1],S[K-1].lower())
print(S)

### FIXED CODE ###

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

#print(S[K-1])
S = (S[:K-1] + S[K-1].lower() + S[K:])
print(S)
list = raw_input().split(" ")
list.sort()
print(list)


### FIXED CODE ###

list = raw_input().split(" ")
list.sort()
print(" ".join(list))
s=input()
print('YES' if s=='5 5 7'||s=='5 7 5'||s=='7 5 5' else 'NO')

### FIXED CODE ###

s=input()
print('YES' if s=='5 5 7' or s=='5 7 5' or s=='7 5 5' else 'NO')
n=int(input())
a = list(map(int, input().split()))

t=[[0]*n for k in range(n)]
tt=[[0]*n for k in range(n)]

def search(i,j):
   if i==j or j==n or i==n-1:
      return
   if tt[i][j]==1:
      return
   if j-i==a[i]+a[j]:
      t[i][j]=1
      print(i,j)
   tt[i][j]=1

   search(i+1,j)
   search(i,j+1)
search(0,1)
result=0
for row in t:
    result += sum(row)

print(result)

### FIXED CODE ###

import collections
n=int(input())
a = list(map(int, input().split()))
an=0
ii=[]
jj=[]
for i in range(n):
    ii.append(i+a[i])
    jj.append(i-a[i])
jjj=collections.Counter(jj)
for i in range(n):
    an+=jjj[ii[i]]
print(an)
N, M = int(input().split())
list = str(input().split())
list.sort()
total = 0
for i in [0:M]:
  total += list[i]
print(total)



### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))
print(sum(sorted(p)[:K]))
n = input()
s = input()
flag = 0
for i in range(1,int(n)-1):
	if s[i-1]+s[i]+[i+1] = "ABC"
    	flag++
print(flag)      

### FIXED CODE ###

N = int(input())
S = input()
print(S.count("ABC"))
n = int(input())
a =list(map(int,input()))
b = []
for i range(n):
  b[i]= 1/a[i]
  B = sum(b)
print(1/B)

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
b=[]
for i in range(N):
  b.append(1.0/a[i])
  B = sum(b)
print(1.0/B)
n = int(input())
s = input()
j = 1
y = s[1:]
x = s[0]
result = [0]
end = n//2 + 2
for i in range(end):
    while (j < end) and (x in y):
        x = x+s[j]
        y = s[:i]+s[j+1:]
        j += 1
    result.append(j-i-1)
    y = s[:i+1] + s[j+1:]
    x = x[1:]
print(max(result))

### FIXED CODE ###

n = int(input())
s = input()
j = 1
result = [0]
end = n//2 + 1
for i in range(n):
    while (j < n-1) and (s[i:j] in s[:i]+"0"+s[j:]):
        j += 1
    result.append(j-i-1)
print(max(result))
import sys
import itertools
from copy import copy

def swap(i,P,Q):
    Q[i+1],Q[i],P[i+1],P[i]=P[i],P[i+1],Q[i],Q[i+1]
    return P,Q

def judge(P):
    for i in range(len(P)-1):
        if P[i]>P[i+1]:
            return False
    else:
        return True

N=int(input())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
flag=False
if judge(A):
    print(0)
    sys.exit()
for l in itertools.permutations(range(0,N-1)):
    if flag:
        break
    T=copy(A)
    Y=copy(B)
    count = 0
    for i in l:
        T,Y=swap(i,T,Y)
        count += 1
        if judge(T):
            ans = l
            flag=True
            print(count)
            break
else:
    print(-1)
    sys.exit()
#T=copy(A)
#Y=copy(B)
#print(T,Y)
#for i in ans:
#    T,Y=swap(i,T,Y)
#    print(T,Y)

### FIXED CODE ###

n=int(input())
itv=[]
for _ in range(n):
    x,l=map(int,input().split())
    itv.append((x+l,x-l))
itv.sort()
ass = 0
tt = -float("inf")
for i in range(n):
    if tt <= itv[i][1]:
        ass += 1
        tt = itv[i][0]
print(ass)
num = input()
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
ans=0
for i in range(num):
  if value[i] > cost[i]:
    ans = ans + value[i] - cost[i]
 
print(ans)

### FIXED CODE ###

num = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
ans = 0
for i in range(num):
  if value[i] > cost[i]:
    ans = ans + value[i] - cost[i]
 
print(ans)
A,B=map(int,input().split())
if B < A:
  A,B=B,A
for i in range B;
 print(A, end="")
print()

### FIXED CODE ###

A,B=map(int,input().split())
if B < A:
  A,B=B,A
for i in range(B):
 print(A, end="")
print()
N = int(input())
a = [input() for i in range(N)]
M = int(input())
b = [input() for i in range(M)]
 
k = []
 
for x in a:
	temp = a.count(x)-b.count(x)
    k.append(temp)
print(max(k))

### FIXED CODE ###

N = int(input())
a = [input() for i in range(N)]
M = int(input())
b = [input() for i in range(M)]
 
k = [0]
 
for x in a:
  temp = a.count(x)-b.count(x)
  k.append(temp)
for y in b:
  temp = a.count(y)-b.count(y)
  k.append(temp)
print(max(k))
x, y, a, b, c = map(int, input().split())
p =list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p = sorted(p)
q = sorted(q)

p = p[(len(p)-x):]
q = q[(len(q)-y):]
r.append(p)
r.append(q)
r = sorted(r)
print(sum(r[(len(r)-x-y):]))


### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
p =list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p = sorted(p)
q = sorted(q)

p = p[(len(p)-x):]
q = q[(len(q)-y):]
r = r + p
r = r + q
r = sorted(r)
print(sum(r[(len(r)-x-y):]))
N=int(input())
A=list(map(int,input().split()))

if A==[0]*N:
    print("Yes")
    exit()

T={}
for a in A:
    if a in T:
        T[a]+=1
    else:
        T[a]=1

F=True
for x in T:
    F&=(3*T[x]%N==0)

if not F:
    print("No")
    exit()

M=max(T,key=lambda x:T[x])
if 3*T[M]==N:
    x,y,z=list(T.keys())
else:
    x=y=M
    del T[M]
    z=tuple(T.keys())[0]

if x^y==z:
    print("Yes")
else:
    print("No")



### FIXED CODE ###

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

T={}
for a in A:
    if a in T:
        T[a]+=1
    else:
        T[a]=1

F=True
for x in T:
    F&=(3*T[x]%N==0)

if not F:
    print("No")
    exit()

M=max(T,key=lambda x:T[x])
if 3*T[M]==N:
    x,y,z=list(T.keys())
elif 3*T[M]==2*N:
    x=y=M
    del T[M]
    z=tuple(T.keys())[0]
else:
    x=y=z=M

if x^y==z:
    print("Yes")
else:
    print("No")
def solve():
    n = int(input())
    a = []
    b = []
    for _ in range(n):
        A, B = map(int, input().split())
        if B != 1:
            a.append(A)
            b.append(B)

    dis = b[-1] - a[-1]%b[-1]
    ans = [dis]
    for i in range(1, len(a)):
        c = a[-(i+1)]+ans[i-1]
        if c > b[-(i+1)]:
            dis = b[-(i+1)]-c%b[-(i+1)]
            ans.append(ans[i-1]+dis)
        elif c == b[-(i+1)]:
            ans.append(0)
        else:
            dis = c
            ans.append(dis)

    return max(0, ans[-1])
    

print(solve())


### FIXED CODE ###

def solve():
    n = int(input())
    a = []
    b = []
    for _ in range(n):
        A, B = map(int, input().split())
        a.append(A)
        b.append(B)

    ans = b[-1] - a[-1]%b[-1]
    if a[-1]%b[-1] == 0: ans = 0

    for i in range(1, n):
        c = a[-(i+1)]+ans
        if c%b[-(i+1)] == 0: continue
        
        if c > b[-(i+1)]:
            dis = b[-(i+1)]-c%b[-(i+1)]
            ans += dis
        else:
            dis = b[-(i+1)] - c
            ans += dis

    return max(0, ans)
    

print(solve())
N,M=map(int.input().split())
print("yes"if N==M else"no")

### FIXED CODE ###

N,M=map(int,input().split())
print("Yes" if N==M else "No")
str_list = list(input().split()
i = len(str_list) - 1

a=0
b=0
c=0                
d=0                
                
for num in range(i)
    if str_list[num] == 'AC':
                a += 1
    elif str_list[num] == 'WA':
                b += 1
    elif str_list[num] == 'TLE':
                c +=1
    elif str_list[num] == 'RE':
                d +=1
    	continue;

print('AC x'+ a)
print('WA x'+ b)
print('TLE x'+ c)
print('RE x'+ d)

### FIXED CODE ###

n = int(input())
str_list = [input() for _ in range(n)]


a=0
b=0
c=0                
d=0                
                
for i in range(n):
    if str_list[i] == 'AC':
    	a += 1
    elif str_list[i] == 'WA':
    	b += 1
    elif str_list[i] == 'TLE':
    	c +=1
    else :
    	d +=1

print('AC x '+ str(a))
print('WA x '+ str(b))
print('TLE x '+ str(c))
print('RE x '+ str(d))
import fraction
n = int(input())
a = list(map(int,input().split()))
ans = a[0]

for i in range(1,len(a)):
  ans =fraction.gcd(ans,a[i])
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
ans = a[0]

def gcd(x,y):
    d = 0
    if max(x,y) == x:
        x,y = y,x
    while True:
        if y%x == 0:
            return x
        else:
            d = y%x
            y,x = x,d

for i in range(1,len(a)):
  ans = gcd(ans,a[i])
print(ans)
a,b = map(int,input().split())

if a % 2 == 0 and b % 2 != 0:
	print('Impossible')
    exit()
if a % 2 != 0 and b % 2 == 0:
  	print('Impossible')
    exit()
print((a + b) // 2)

### FIXED CODE ###

a,b = map(int,input().split())
 
if a % 2 == 0 and b % 2 != 0:
  print('IMPOSSIBLE')
  exit()
if a % 2 != 0 and b % 2 == 0:
  print('IMPOSSIBLE')
  exit()
print((a + b) // 2)
S = input()
N = len(S)
ans = 0
for i in range(N):
for j in range(i, N):
if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
print(ans)
ans = max(ans, j - i + 1)

### FIXED CODE ###

S = list(input())
M = 0
count = 0
for x in S:
  if x =="A" or x =="C" or x =="T" or x =="G":
    count += 1
  else:
    count = 0
  if M<count:
    M = count
print(M)
N=int(input())
a=0

for i in range(1,N):
  if i*(i+1)//2 >= N:
    break
    
c = i*(i+1)//2 - N

for j in range(1,i+1):
  if j!=c:
    print(j)

### FIXED CODE ###

N=int(input())
k=1

for i in range(1,N+1):
  if i*(i+1)//2 >= N:
    k=i
    break
    
c = int(k*(k+1)//2 - N)

for j in range(1,k+1):
  if j!=c:
    print(j)
A1, A2, A3 = map(int, input().split())

if sum(A1, A2, A3) >= 22:
	print('bust')
else:
	print('win')


### FIXED CODE ###

A1, A2, A3 = map(int, input().split())

if A1 + A2 + A3 >= 22:
	print('bust')
else:
	print('win')
N, M = map(int, input().split())
l_same = [-1, -1, -1]
if N == 1:
  s_num = '0'
else:
	s_num = '1' + '0' * (N - 1)
for i in range(M):
  s, c = map(int, input().split())
  if N != 1 and (s == 1 and c == 0):
    ans = -1
    break
  elif l_same[s - 1] != -1 and l_same[s - 1] != c:
    ans = -1
    break
  else:
    l_same[s - 1] = c
    s_num = s_num[0:s - 1] + str(c) +  s_num[s:]
    ans = int(s_num)
print(ans)
  

### FIXED CODE ###

N, M = map(int, input().split())
l_same = [-1, -1, -1]
if N == 1:
  s_num = '0'
else:
  s_num = '1' + '0' * (N - 1)
ans = int(s_num)
for i in range(M):
  s, c = map(int, input().split())
  if N != 1 and (s == 1 and c == 0):
    ans = -1
    break
  elif l_same[s - 1] != -1 and l_same[s - 1] != c:
    ans = -1
    break
  else:
    l_same[s - 1] = c
    s_num = s_num[0:s - 1] + str(c) +  s_num[s:]
    ans = int(s_num)
print(ans)
N,K = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse=True)

P = []
M = []
Ans = []
p = 0
m = 0

for i in range(N):
    if 0 <= A[i]:
        P.append(A[i])
    else:
        M.append(A[i])

if K % 2 == 1 and len(P) != 0:
    Ans.append(P[p])
    p += 1

while len(Ans) < K:

    #Mのストックがもうない時
    if m+1 >= len(M):
        Ans.append(P[p])
        if len(Ans) == K:
            break
        Ans.append(P[p + 1])
        p += 2
    elif p+1 >= len(P):
        Ans.append(M[m])
        if len(Ans) == K:
            break
        Ans.append(M[m + 1])
        m += 2
    else:
        if P[p]*P[p+1] < M[m]*M[m+1]:
            Ans.append(M[m])
            Ans.append(M[m+1])
            m += 2
        else:
            Ans.append(P[p])
            Ans.append(P[p + 1])
            p += 2

answer = 1
for i in range(K):
    answer = (answer * Ans[i]) % 1000000007

print(answer)

### FIXED CODE ###

import sys

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

A.sort(reverse=True)

P = []
M = []
Ans = []
p = 0
m = 0

for i in range(N):
    if 0 <= A[i]:
        P.append(A[i])
    else:
        M.append(A[i])

M.sort()

if K % 2 == 1 and len(P) != 0:
    Ans.append(P[p])
    p += 1
elif K % 2 == 1 and len(P) == 0:
    M.sort(reverse=True)
elif len(M) == 0:
    answer = 1
    for i in range(K):
        answer = (answer * P[i]) % 1000000007

    print(answer)
    sys.exit()

while len(Ans) < K:

    #Mのストックがもうない時
    if m+1 >= len(M) and p < len(P):
        Ans.append(P[p])
        if len(Ans) == K:
            break
        if p + 1 < len(P):
            Ans.append(P[p + 1])
            p += 2
        else:
            p += 1
        
    elif p+1 >= len(P) and m < len(M):
        Ans.append(M[m])
        if len(Ans) == K:
            break
        Ans.append(M[m + 1])
        m += 2
    elif m >= len(M) and p < len(P):
        Ans.append(P[p])
        p += 1
    elif p >= len(P) and m < len(M):
        Ans.append(M[m])
        m += 1
    else:
        if P[p]*P[p+1] < M[m]*M[m+1]:
            Ans.append(M[m])
            Ans.append(M[m+1])
            m += 2
        else:
            Ans.append(P[p])
            Ans.append(P[p + 1])
            p += 2

answer = 1
for i in range(K):
    answer = (answer * Ans[i]) % 1000000007

print(answer)
import statistics
import math
N, A, B = map(int, input().split())
v = [int(x) for x in input().split()]
v.sort()

base = v[N-A:]
rem = v[:N-A]
mean_max = statistics.mean(base)
cnb = 0
while mean_max == statistics.mean(base):
    if len(rem) == 0: break
    same = base.count(base[0])
    extra = rem.count(base[0])
    cnb += math.factorial(same+extra)/math.factorial(same)/math.factorial(extra)
    base.append(rem[len(rem)-1])
    rem = rem.pop
print(mean_max)
print(math.floor(cnb))

### FIXED CODE ###

N, A, B = map(int, input().split())
V = sorted([int(x) for x in input().split()],reverse=True)
from statistics import mean
from math import comb
maxmean = mean(V[:A])
if V[0] != V[A-1]:
    n = V.count(V[A-1])
    k = V[:A].count(V[A-1])
    way = comb(n, k)
else:
    n = V.count(V[A-1])
    way = sum(comb(n, k) for k in range(A, min(n,B)+1))
print(maxmean)
print(way)
# -*- coding: utf-8 -*-
import math
N = int(input())
X = list(map(int, input().split()))

def solver(N,X):
    r = X[1:]
    result = sum(r)/len(r) * math.factorial(N-1)
    return result

print(solver(N,X))

### FIXED CODE ###

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

mod = 10**9 +7
N = int(input())
X = list(map(int, input().split()))

factorial=[1]
for i in range(1,N):
    factorial.append(factorial[-1] *i %mod)

ans=0
for i in range(1,N):
    ans = (ans*i + (X[-1]-X[i-1])*factorial[i-1]) %mod

print(ans)
n = int(input())
ns= int(input.spit())
for i in range(n):
    asum = sum(ns)
    amin = min(ns)
    amax = max(ns)

print(amin, amax, asum)


### FIXED CODE ###

n=int(input())
ns=input().split()
for i in range(len(ns)):
    ns[i]=int(ns[i])
asum=sum(ns)
amin=min(ns)
amax=max(ns)
print(amin,amax,asum)
import copy
def dfs(cur_node, pre_node, Node_num, map, l):
    #全てのノードを見たとき

    if Node_num == N-1 or cur_node <= 0 or cur_node >= N-1:
        return
    elif l[pre_node][cur_node]==0: #飛んだ先が、Trueの時
        return
    elif map[cur_node]==True:
        return

    map[cur_node]=True

    for i in range(N):
        if i != cur_node:
            dfs(i, cur_node, Node_num+1, map, l)


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

N = S[0]
M = S[1]


map = [False]*N
map[0] = True
map[N-1] = True
lst = []

for i in range(N):
    lst.append([0]*N)

for i in range(N):
    S = input()
    S = list(S.split())
    idx1 = int(S[0])
    idx2 = int(S[1])
    lst[idx1-1][idx2-1] = 1

graph_count = 0
#全探索
for i in range(1, N, 1):
    map_copy = copy.copy(map)
    lst_copy = copy.copy(lst)

    dfs(i, 0, 0, map_copy, lst_copy)
    count = 0
    for i in map_copy:
        if i == True:
            count = count + 1
    if count == N-1:
        graph_count = graph_count + 1

print(graph_count)


### FIXED CODE ###

import itertools
N,M=map(int,input().split())
edges={tuple(sorted(map(int,input().split()))) for i in range(M)}
ans=0
for i in itertools.permutations(range(2,N+1),N-1):
    l=[1]+list(i)
    ans+=sum(1 for edge in zip(l,l[1:]) if tuple(sorted(edge)) in edges)==N-1
print(ans)
import math
r = 9999
sqrt = int(math.sqrt(r))
p = [1*r]
p[0] = 0
for i in range(sqrt):
    if p[i]:
        p[2*i+1::i+1] = [0 for j in range(2*i+1,r,i+1)]
prime = []
for i in range(r):
    if p[i]:
        prime.append(i)

while True:
    try:
        n = int(raw_input())
        count = 0
        for i in prime:
            if i > n-1:
                break
            if p[n-i-1] == 1:
                count += 1
        print count
    except:
        break

### FIXED CODE ###

import math
r = 9999
sqrt = int(math.sqrt(r))
p = [1 for i in range(r)]
p[0] = 0
for i in range(sqrt):
    if p[i]:
        p[2*i+1::i+1] = [0 for j in range(2*i+1,r,i+1)]
prime = []
for i in range(r):
    if p[i]:
        prime.append(i)

while True:
    try:
        n = int(raw_input())
        count = 0
        for i in prime:
            if i > n-1:
                break
            if p[n-i-1] == 1:
                count += 1
        print count
    except:
        break
n, k = map(int, input().split())
s = input()
s = list(s)
ans = s
len = []
for i in range(n):
  l = 0
  if s[i] == '0':
    l += 1
    j = i
    while s[j+1] != '0':
      l += 1
  len.append(l)
print(len)

### FIXED CODE ###

n, k = map(int, input().split())
a = input()
l = []
if a[0] == '0':
    l.append(0)
sum = []
i = 0
while i < len(a):
    j = i
    while j < len(a) and a[j] == a[i]:
        j += 1
    l.append(j-i)
    i = j
if a[-1] == '0':
    l.append(0)
num = [0]*(len(l)+1)
for i in range(0, len(l)):
    num[i+1] = num[i]+l[i]
ans = -1
for i in range(0, len(num), 2):
    j = i + k*2+1
    if j >= len(num):
        j = len(num)-1
    ans = max(ans, num[j] - num[i])
print(ans)
import numpy as np
def binary(_x):
    x = _x
    l = int(np.log2(x) + 1)
    res = [0] * l
    
    for i in range(l):
        res[i] += x%2
        x = int(x/2)
    return res


def a_xor(lis, i, sub, sub_max):
    return lis[i] * ( ( sub_max - sub + 1 ) % 2 )


def b_xor(lis, i, sub, sub_max):
    return lis[i] * ( ( sub_max - sub ) % 2 )


def main():
    A, B = map(int, input().split())
    bin_a = binary(A)
    bin_b = binary(B)
    odd_even_vec = [0] * len(bin_b)

    print("a")
    sub = 0
    sub_max = 0
    for i, bit in enumerate(bin_a):
        if i == 0:
            odd_even_vec[i] += bit%2
        else:
            k = i-1
            sub += bit * 2**k
            sub_max += 2**k
            odd_even_vec[i] += a_xor(bin_a, i, sub, sub_max)
        print(odd_even_vec, sub, sub_max)

    print("b")
    sub = 0
    sub_max = 0
    for i, bit in enumerate(bin_b):
        if i == 0:
            odd_even_vec[i] += bit%2
        else:
            k = i-1
            sub += bit * 2**k
            sub_max += 2**k
            odd_even_vec[i] += b_xor(bin_b, i, sub, sub_max)
            
        print(odd_even_vec, sub, sub_max)
        
    res = 0
    for i, bit in enumerate(odd_even_vec):
        res += bit%2 * 2**i

    print (res)

    
main()


### FIXED CODE ###

def F(n):
    res = 0
    if n % 4 == 0:
        res = n
    elif n % 4 == 1:
        res = 1
    elif n % 4 == 2:
        res = 1^n
    else:
        res = 0
        
    return res

def main():
    A, B = map(int, input().split())
    ans = F(A-1) ^ F(B)

    #print(A, B, F(A-1), F(B))

    print(ans)

main()
from sys import stdin
from sys import setrecursionlimi
setrecursionlimit(10 ** 7)

s = stdin.readline().rstrip()
k = int(stdin.readline().rstrip())

def main():
    finish = set()
    S = len(s)
    for i in range(S):
        for j in range(i+1,S+1):
            finish.add(s[i:j])

    finish = list(finish)
    finish.sort()
    print(finish[k-1])

if __name__ == "__main__":
    main()

### FIXED CODE ###

from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

s = stdin.readline().rstrip()
k = int(stdin.readline().rstrip())


finish = set()
S = len(s)

for i in range(S):
    for j in range(1,6):
        finish.add(s[i:i+j])

finish = list(finish)
finish.sort()

print(finish[k-1])
import itertools
N = int(input())

ans = [0]*(10**4)
for i1 in range(1, 50):
    i2 = i1+1
    i3 = i1+2
    L = list(itertools.combinations_with_replacement((i1, i2, i3), 3))
    for i in L:
        i = list(i)
        x = i[0]
        y = i[1]
        z = i[2]
        n = (x**2)+(y**2)+(z**2)+(x*y)+(y*z)+(z*x)
        if n > 10**4:
            break
        if len(list(set(i))) == 1:
            ans[n] += 1
        if len(list(set(i))) == 2:
            ans[n] += 3
        if len(list(set(i))) == 3:
            ans[n] += 6
        
for k in range(1, N+1):
    print(ans[k])

### FIXED CODE ###

n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v = i*i+j*j+k*k+i*j+j*k+k*i
            if v<10050:
                ans[v]+=1
for i in range(n):
    print(ans[i+1])
n,m,p = map(int,input().split())
E1 = [[] for i in range(n)]
E2 = [[] for i in range(n)]
edge = []
for i in range(m):
    a,b,c = map(int,input().split())
    c = p-c
    a -= 1
    b -= 1
    E1[a].append(b)
    E2[b].append(a)
    edge.append((a,b,c))

dis1 = [False]*n
def dfs(x,dis,E):
    if dis[x] == True:
        return
    dis[x] = True
    for nex in E[x]:
        dfs(nex,dis,E)

dis2 = [False]*n

dfs(0,dis1,E1)
dfs(n-1,dis2,E2)

ok = []
for i,j in zip(dis1,dis2):
    if i == True and j == True:
        ok.append(True)
    else:
        ok.append(False)

def belw():
    dis = [float("INF")]*n
    dis[0] = 0
    count = 0
    check = True

    while check:
        check = False
        for a,b,c in edge:
            if (not ok[a]) or (not ok[b]):
                continue
            if dis[b] > dis[a]+c:
                check = True
                dis[b] = dis[a]+c
        count += 1

        if count > n:
            return float("INF")
    
    return -dis[-1]

ans = belw()
if ans == float("INF"):
    print(-1)
else:
    print(max(ans,0))











### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
n,m,p = map(int,input().split())
E1 = [[] for i in range(n)]
E2 = [[] for i in range(n)]
edge = []
for i in range(m):
    a,b,c = map(int,input().split())
    c = p-c
    a -= 1
    b -= 1
    E1[a].append(b)
    E2[b].append(a)
    edge.append((a,b,c))

dis1 = [False]*n
def dfs1(x):
    if dis1[x] == False:
        dis1[x] = True
        for nex in E1[x]:
            dfs1(nex)

dis2 = [False]*n
def dfs2(x):
    if dis2[x] == False:
        dis2[x] = True
        for nex in E2[x]:
            dfs2(nex)

dfs1(0)
dfs2(n-1)

ok = []
for i in  range(n):
    if dis1[i] and dis2[i]:
        ok.append(True)
    else:
        ok.append(False)
nedge = []
for a,b,c in edge:
    if ok[a] and ok[b]:
        nedge.append((a,b,c))

def belw():
    dis = [float("INF")]*n
    dis[0] = 0
    count = 0
    check = True

    while check:
        check = False
        for a,b,c in nedge:
            
            if dis[a] != float("INF") and dis[b] > dis[a]+c:
                check = True
                dis[b] = dis[a]+c
        count += 1

        if count > n+1 and check:
            return float("INF")
    
    return -dis[-1]

ans = belw()
if ans == float("INF"):
    print(-1)
else:
    print(max(ans,0))