Harryxun/stf_run huggingface dataset:
a=int(input().split())
s=str(input().split())

if(a>=3200):
  print('red')
else:
  print(s)

### FIXED CODE ###

a=int(input())
s=str(input())

if(a>=3200):
  print(s)
else:
  print('red')
A, B = input().split()
A = int(A)
B = B.replace(".", "")
print(int(A * B / 100))

### FIXED CODE ###

A, B = input().split()
A = int(A)
# B = int(B.replace(".", ""))
B = (int(B[0]) - 0) * 100 + (int(B[2]) - 0) * 10 + (int(B[3]) - 0)
print(A * B // 100)
a, b, c = map(int,raw_input().split())
i = a
j = 0
for i in range(b-a+1):
  if c % i == 0:
    j = j + 1
print "%d" % (j)
    

### FIXED CODE ###

a, b, c = map(int,raw_input().split())
j = 0
for i in range(a, b+1):
  if c % i == 0:
    j = j + 1
print j
S = input()

S1 = 10*int(S[0]) + int(S[1])
S2 = 10*int(S[2]) + int(S[3])
SepS = [S1, S2]
MM = [True,True]

for i in range(2):
  if SepS[i] < 1 or SepS[i] > 12:
    MM[i] = False

if MM[0] and MM[1]:
  print("AMBIGUOUS")
elif MM[0]:
  print("MMYY")
elif MM[1]:
  print("YYMM")
else:
  print("NA")

### FIXED CODE ###

N, K = map(int, input().split())
S = input()
 
dummy = ""
 
for i in range(N):
  if i == K-1:
    dummy += S[i].lower()
  else:
    dummy += S[i]
    
print(dummy)
def solve(i, m):
  if dp[i][m]==1
    return dp[i][m]

  if m == 0:
    dp[i][m] = 1
  elif i >= n:
    dp[i][m] = 0
  elif solve(i+1, m):
    dp[i][m] = 1
  elif solve(i+1, m-A[i]):
    dp[i][m] = 1
  else:
    dp[i][m] = 0

  return dp[i][m]



n = input()
A = map(int, raw_input().split())
p = input()
m = map(int, raw_input().split())
for i in range(p):
  if solve(0, m[i]):
    print 'yes'
  else:
    print 'no'

### FIXED CODE ###

def solve(i, m):
  if dp[i][m] != -1:
    return dp[i][m]

  if m == 0:
    dp[i][m] = 1
  elif i >= n:
    dp[i][m] = 0
  elif solve(i+1, m):
    dp[i][m] = 1
  elif solve(i+1, m-A[i]):
    dp[i][m] = 1
  else:
    dp[i][m] = 0

  return dp[i][m]



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

dp = [[-1 for col in range(2000)] for row in range(n+1)]

for i in range(p):
  if solve(0, m[i]):
    print 'yes'
  else:
    print 'no'
N = input()
a = raw_input().split()
ans = 0
for i in xrange(N):
    if a[ a[i] - 1 ] == i+1:
       ans += 1
print ans

### FIXED CODE ###

N = input()
a = raw_input().split()
ans = 0
for i in xrange(N):
    target = int(a[i]) - 1
    if int(a[target]) == i+1:
       ans += 1
print ans/2
inp = input().split(" ")
A=int(inp[0])
B=int(inp[1])
M=int(inp[2])

if A!=0:
    a=input().split(" ")
else:
    a=[0]
if B!=0:
    b=input().split(" ")
else:
    b=[0]

s=[0]*(M+(1))
m=[[0]*3]*M
i=0
for x in m:
    x=input().split(" ")
    s[i]=int(a[int(x[0])-1])+int(b[int(x[1])-1])-int(x[2])
    i+=1

s[i]=int(min(a))+int(min(b))

print(min(s))


### FIXED CODE ###

a = input()
a=a.replace("hi","")
if(len(a)==0):
    print("Yes")
else:
    print("No")
n = input()
for i in range(len(n)):
    count += int(n[i])
if count%9 == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = input()
for i in range(len(n)):
    count += int(n[i])
if count%9 == 0:
    print("Yes")
else:
    print("No")
a = input()
s=0
s = int(a)
s = list(map(int, a))


if int(a)%9==0 or s%9==0:
    print('Yes')
else:
    print('No')




### FIXED CODE ###

a = input()
s = int(a)
s = list(map(int, a))
b=int(a)


if b%9==0 or sum(s)%9==0:
    print('Yes')
else:
    print('No')
import math
def lcm(x, y):
    return int((x * y) /math.gcd(x, y))

A,B = map( int ,input().split())
#print(math.gcd(A,B))
print(lcm(A,B))

### FIXED CODE ###

def gcd(m,n):
    x = max(m,n)
    y = min(m,n)
    while x%y != 0:
        z = x%y
        x = y
        y = z
    else:
        return y
def lcm(m,n):
    return int(m * n /gcd(m,n))

A,B = map( int ,input().split())
print(lcm(A,B))
N,K=map(int,input().split())

if N%K==0:
	print(0)
	else:
		print(1)

### FIXED CODE ###

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

if N%K==0:
	print(0)
else:
	print(1)
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


n,k = map(int,input().split())
print(max(m+k,n-k,n*k))

### FIXED CODE ###

#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))
 
 
n,k = map(int,input().split())
print(max(n+k,n-k,n*k))
from fastcache import clru_cache

def main(S):
    con = 10**9 + 7

    @clru_cache(maxsize=1024, typed=True)
    def get_c(iii):
        return [(j * iii) % 13 for j in l10]

    l10 = list(range(10))
    l13 = list(range(13))
    m13 = {i: {j: (i + j) % 13 for j in l13} for i in l13}
    c = []
    iii = 1
    for i in range(len(S)):
        s = S[len(S) - i - 1]
        if s != "?":
            c.append([(int(s) * iii) % 13])
        else:
            c.append(get_c(iii))
        iii = (iii * 10) % 13

    _tdp = {i: 0 for i in l13}
    it = iter(c)
    pdp = {i: 1 for i in next(it)}
    d = 1
    for v in it:
        tdp = _tdp.copy()
        for r in v:
            for _r, _v in pdp.items():
                tdp[m13[_r][r]] += _v
        if d == 0:
            for i in l13:
                tdp[i] = tdp[i] % con
        d = (d + 1) % 50
        pdp = tdp

    ans = pdp.get(5, 0)
    print(ans % con)

if __name__ == "__main__":
    S = input()
    main(S)

### FIXED CODE ###

S = input()
con = 10**9 + 7

T = [s if s != "?" else "0" for s in S]
T = int(''.join(T))
SS = T % 13

def get_mod(S):
    c = {}
    iii = 1
    for i in range(len(S)):
        if S[len(S) - i - 1] != "?":
            iii *= 10
            iii %= 13
            continue
        c[i] = {(j * iii) % 13: 1 for j in range(0, 10)}
        iii *= 10
        iii %= 13
    return c
c = get_mod(S)

def get_tdp(pdp):
    tdp = {i: 0 for i in range(13)}
    for r in v.keys():
        for _r, _v in pdp.items():
            tdp[(_r + r) % 13] += _v
    for i in range(13):
        tdp[i] %= con
    return tdp

pdp = {i: 0 for i in range(13)}
pdp[SS] += 1
for k, v in c.items():
    pdp = get_tdp(pdp)

ans = pdp[5]
print(ans)
from collections import deque
n,k=[int(i) for i in input().split()]
D=deque()
h=[int(i) for i in input().split()]
for i in h:
    D.append(i)
    
maxnum=0
times=min(n,k)
for limit in range(times):
    for a in range(limit+1):
        get=[]
        Dcopy=D.copy()

### FIXED CODE ###

#デックをインポート
from collections import deque

#前準備
n,k=[int(i) for i in input().split()]

#デックを用意
D=deque()
h=[int(i) for i in input().split()]
for i in h:
    D.append(i)   
    
#答え
maxnum=0

#繰り返す単位
times=min(n,k)

#aとbの操作の合計のlimitを設定
for limit in range(times+1):
#     print(D)
    
    #aの操作を決定
    for a in range(limit+1):
        get=[]
        Dcopy=deque()
        for i in range(n):
            Dcopy.append(D[i])
        b=limit-a
        for i in range(a):
            get.append(Dcopy.popleft())
        for i in range(b):
            get.append(Dcopy.pop())
        get.sort(reverse=True)
#         print(get)
        for i in range(k-limit):
            if len(get)==0:
                break
            if get[-1]>=0:
                break
            get.pop()
        sumnum=0
        for i in get:
            sumnum+=i
        if sumnum>maxnum:
            maxnum=sumnum
            
#         print(a,b,Dcopy,get,sumnum)
print(maxnum)
a,b = map(int,input().split)

print (max([a+b, a-b, a*b]))


### FIXED CODE ###

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

print (max([a+b, a-b, a*b]))
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

res, height = 0, 100001
for i in range(N) :
    if height > abs(A - tmp) :
        height = abs(A - tmp)
        res = i + 1

print(res)

### FIXED CODE ###

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

res, height = 0, 100001
for i in range(N) :
    tmp = T - H[i] * 0.006
    if height > abs(A - tmp) :
        height = abs(A - tmp)
        res = i + 1

print(res)
import numpy as np

N, M, C = map(int, input().split(' '))
B = np.array(tuple(map(int, input().split(' ')))).reshape((-1, 1))
A = np.zeros((N, M))
for i in range(N):
    A[i, :] = np.array(tuple(map(int, input().split(' '))))

print(np.where((np.matmul(A, B) + C) > 0, 1, 0).sum())

### FIXED CODE ###

N, M, C = map(int, input().split(' '))
B = list(map(int, input().split(' ')))
A = []
for i in range(N):
    A.append(list(map(int, input().split(' '))))
AB = []
for i in range(len(A)):
    matmul = C
    for j in range(len(B)):
        matmul += A[i][j] * B[j]
    AB.append(1 if matmul > 0 else 0)
print(sum(AB))
import re

S = input()
m = max(map(len, re.findall(r'[ACGT]+', S)))
print(m)


### FIXED CODE ###

S = input()
count, max_count = 0, 0
for s in S:
  if s in 'ACGT':
    count += 1
    if count > max_count:
      max_count = count
  else:
    count = 0
print(max_count)
s = input()
if s[0] == s[1] and s[1] = s[2] and s[2] == s[0]:
  print("No")
  exit()
  
print("Yes")

### FIXED CODE ###

s = input()
if s[0] == s[1] and s[1] == s[2] and s[2] == s[0]:
  print("No")
  exit()
  
print("Yes")
import functools
import math

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

max_koyaku_num = functools.reduce(math.gcd, a)

print(max_koyaku_num)

### FIXED CODE ###

import functools

def gcd(num1, num2):
    r = num1 % num2
    while (r > 0):
        num1 = num2
        num2 = r
        r = num1 % num2
    return num2

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

max_koyaku_num = functools.reduce(gcd, a)

print(max_koyaku_num)
for _ in[0]*int(input()):
 a,b,c,d,e,f=map(float,input().split())
 x=((a*a+b*b)*(d-f)+(c*c+d*d)*(f-b)+(e*e+f*f)*(b-d))/2/(a*(d-f)+c*(f-b)+e*(b-d))
 y=((a*a+b*b)*(c-e)+(c*c+d*d)*(e-a)+(e*e+f*f)*(a-c))/2/(b*(c-e)+d*(e-a)+f*(a-c))
 print('.3f %.3f %.3f'%(x,y,((x-a)**2+(y-b)**2)**.5))


### FIXED CODE ###

for _ in[0]*int(input()):
 a,b,c,d,e,f=map(float,input().split())
 s,t,u=a*a+b*b,c*c+d*d,e*e+f*f
 x=(s*(d-f)+t*(f-b)+u*(b-d))/2/(a*(d-f)+c*(f-b)+e*(b-d))
 y=(s*(c-e)+t*(e-a)+u*(a-c))/2/(b*(c-e)+d*(e-a)+f*(a-c))
 print(f'{x:.3f} {y:.3f} {((x-a)**2+(y-b)**2)**.5:.3f}')
n=int(input())
l=list(map(int,input().split()))
q=int(input())
before=[]
after=[]
for i in range(q):
    a,b=input().split()
    before.append(int(a))
    after.append(int(b))
    
for i in range(q):
  if before[i] in l:
    l=[after[i] if j == before[i] else j for j in l]
  print(sum(l))


### FIXED CODE ###

a=str(input())

if a.isupper()==True:
  print("A")

else:
  print("a")
import numpy as np

S      = input()
S      = S.split()
N      = int(S[0])
D      = int(S[1])
matrix = np.zeros([N, D])
count  = 0


for i in range(0, N, 1):
    X_vector = input()
    X_vector = X_vector.split()
    for j in range(0, D, 1):
        matrix[i][j] = int(X_vector[j])

for i in range(0, N, 1):
    a_vector = matrix[i]
    for j in range(i+1, N, 1):
        b_vector = matrix[j]
        length = np.linalg.norm(b_vector-a_vector)
        if float(length) / float(length) == 0.0:
            count++

print(count)


### FIXED CODE ###

import numpy as np

S      = input()
S      = S.split()
N      = int(S[0])
D      = int(S[1])
matrix = np.zeros([N, D])
count  = 0


for i in range(0, N, 1):
    X_vector = input()
    X_vector = X_vector.split()
    for j in range(0, D, 1):
        matrix[i][j] = int(X_vector[j])

for i in range(0, N, 1):
    a_vector = matrix[i]
    for j in range(i+1, N, 1):
        b_vector = matrix[j]
        length = np.linalg.norm(b_vector-a_vector)
        if length.is_integer():
            count = count + 1
print(count)
a,b=map(int,input().split())
print(b//(12//min(a, 13)+1)*min(1, a//6))


### FIXED CODE ###

a,b=map(int,input().split())
print(b//(13//min(a+1, 14)+1)*min(1, a//6))
import numpy as np

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

def list_primes(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

prime_list = list_primes(max(As))
max_prime = 0
max_prime_n = 0
for n,i in enumerate(prime_list):
    max_prime_now = max(list(map( lambda x: i if x % i == 0 else 0, As)))
    if max_prime_now > max_prime:
        max_prime = max_prime_now
        max_prime_n = n
As_np = np.array(As)
As_np[As_np%max_prime==0]=max(As_np)

sigma = 1
len_As = len(As_np)
for i in reversed(range(2,max(As_np)+1)):
    if (As_np % i).sum()==0:
        As_np = As_np/i
        sigma *= i

print(sigma)

### FIXED CODE ###

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

def count(s):
    a = int(s[0])
    b = int(s[1])
    t = int(s[2])
    a_now = a
    sum_ = 0
    while a_now< t+0.5:
        sum_ += b
        a_now += a
    
    return sum_

print(count(li))
import sys
sys.recursionlimit(10**6)
n,k = map(int,input().split())
a = [int(i)-1 for i in input().split()]
edg = [[] for i in range(n)]
for i in range(n):
  edg[a[i]].append(i)
ans = [0] * n
ans[0] = a[0] != 0
c = [1] * n
def dfs(now, time):
  c[now] = 0
  for e in edg[now]:
    if c[e]:
      if time == k:
        ans[e] = 1
        dfs(e, 1)
      else:
        dfs(e, time + 1)
dfs(0, 0)
print(sum(ans))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
n,k = map(int,input().split())
a = [int(i)-1 for i in input().split()]
edg = [[] for i in range(n)]
for i in range(1,n):
  edg[a[i]].append(i)
ans = [0] * n
ans[0] = a[0] != 0
def dfs(now):
  res = 0
  for e in edg[now]:
    res = max(res, dfs(e)+1)
  if res == k - 1 and a[now] != 0:
    ans[now] = 1
    res = -1
  return res
      
dfs(0)
print(sum(ans))
class Inv:
  def __init__(s, mod):
    s.MOD = mod
  def modpow(s, a, n):
    res = 1
    while n > 0:
      if n & 1:
        res = res * a % s.MOD
      a = a * a % s.MOD
      n >>= 1
    return res
  def invx(s, a):
    return s.modpow(a, s.MOD - 2)
  def invpowL(s, a, n): # a^-x (0 <= x <= n)リスト
    ia = s.invx(a)
    L = [1] * (n + 1)
    for i in range(1, n + 1):
      L[i] = L[i - 1] * ia % s.MOD
    return L
  def invL(s, n): # 0 <= x <= n 逆元リスト
    I = [0, 1]
    for i in range(2, n + 1):
      I.append(s.MOD - I[s.MOD % i] * (s.MOD // i) % s.MOD)
    return I


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

DP = [[0] * (S + 1) for _ in range(N + 1)]

inv = Inv(MOD)
v = inv.invx(2)

p = inv.modpow(2, N - 1)
for i in range(1, N + 1):
  a = A[i - 1]
  if a > S: 
    for j in range(S + 1):
      DP[i][j] = DP[i - 1][j]
  for j in range(a):
    DP[i][j] = DP[i - 1][j]
  DP[i][a] = (DP[i - 1][a] + p) % MOD
  for j in range(a + 1, S + 1):
    DP[i][j] = (DP[i - 1][j] + DP[i - 1][j - a] * v) % MOD

print(DP[-1][S])


### FIXED CODE ###

class Inv:
  def __init__(s, mod):
    s.MOD = mod
  def modpow(s, a, n):
    res = 1
    while n > 0:
      if n & 1:
        res = res * a % s.MOD
      a = a * a % s.MOD
      n >>= 1
    return res
  def invx(s, a):
    return s.modpow(a, s.MOD - 2)
  def invpowL(s, a, n): # a^-x (0 <= x <= n)リスト
    ia = s.invx(a)
    L = [1] * (n + 1)
    for i in range(1, n + 1):
      L[i] = L[i - 1] * ia % s.MOD
    return L
  def invL(s, n): # 0 <= x <= n 逆元リスト
    I = [0, 1]
    for i in range(2, n + 1):
      I.append(s.MOD - I[s.MOD % i] * (s.MOD // i) % s.MOD)
    return I


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

DP = [[0] * (S + 1) for _ in range(N + 1)]

inv = Inv(MOD)
v = inv.invx(2)

p = inv.modpow(2, N - 1)
for i in range(1, N + 1):
  a = A[i - 1]
  if a > S: 
    for j in range(S + 1):
      DP[i][j] = DP[i - 1][j]
    continue
  for j in range(a):
    DP[i][j] = DP[i - 1][j]
  DP[i][a] = (DP[i - 1][a] + p) % MOD
  for j in range(a + 1, S + 1):
    DP[i][j] = (DP[i - 1][j] + DP[i - 1][j - a] * v) % MOD

print(DP[-1][S])
n = int(input())
a = input().split()

for i in range(len(a)):
    a[i] = int(a[i])

x = 0
y = 0

operations = []

for i in range(n-2):
    a_sorted = sorted(a)
    x = a_sorted[0]
    y = a_sorted[1]

    a.remove(x)
    a.remove(y)
    a.append(x-y)
    operations.append(str(x) + " " + str(y))

a_sorted_reverse = sorted(a_sorted, reverse=True)
x = a_sorted_reverse[0]
a.remove(x)
y = sorted(a)[0]
operations.append(str(x) + " " + str(y))


a.remove(x)
if y in a:
    a.remove(y)
a.append(x-y)

print(sorted(a, reverse=True)[0])
for i in operations:
    print(i)


### FIXED CODE ###


input_data = input()
n,  k = input_data.split()

n = int(n)
k = int(k)

i  = n - k
max = i + 1
min = 1

if k == 1:
    print(0)
else:
    print(max - min)
nCr = {}
def combination(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

N, K = map(int, input().split())
for i in range(1, K+1):
	if i <= N-K+1:
        A = combination(N-K+1, i)
        P = combination(K-1, i-1)
        B = A * P
        print(B % (10**9+7))
	else:
		print(0)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000)

nCr = {}
def combination(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = combination(n-1,r) + combination(n-1,r-1)
    return nCr[(n,r)]

N, K = map(int, input().split())
for i in range(1, K+1):
	if i <= N-K+1:
		A = combination(N-K+1, i)
		P = combination(K-1, i-1)
		B = A * P
		print(B % (10**9+7))
	else:
		print(0)
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
N = int(input())
A = [int(i) for i in input().split()]
if N>2:
    GCD = [gcd(*[e for s,e in enumerate(A) if s!=i]) for i in range(N)]
    print(max(GCD))
else:print(math.gcd(*A))

### FIXED CODE ###

from fractions import gcd
N = int(input())
A = list(map(int,input().split()))
gcda = [A[0]]
gcdb = [A[-1]]
for i in range(N-2):
    gcda.append(gcd(gcda[-1],A[i+1]))
    gcdb.append(gcd(gcdb[-1],A[-(i+2)]))
gcdb.reverse()
GC = [gcdb[0]]
for i in range(N-2):
    GC.append(gcd(gcda[i],gcdb[i+1]))
else:
    GC.append(gcda[-1])
print(max(GC))
# -*- coding: utf-8 -*-
import math

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

digit_K = int(math.log(K, 2)) + 1 if not K == 0 else 0
d1s = [0]*digit_K
gain, Kgain = [], []

ans = sum(A)
for i in range(digit_K):
    for j in range(N):
        d1s[i] += A[j] % 2
        A[j] = A[j] // 2
    cK, dK = divmod(cK, 2)
    gain.append((N - digit1s[di] * 2) * 2**i if N - digit1s[di] * 2 else 0)
    Kgain.append((N - digit1s[di] * 2) * 2**i * dK)

maxgain = sum(Kgain)
for i in range(digit_K):
    K, dK = divmod(K, 2)
    if dK == 1:
        sumgain = sum(pgain[:i] + Kgain[i+1:])
    elif dK == 0:
        sumgain = sum(pgain[:i+1] + Kgain[i+1:])
    maxgain = max(maxgain, sumgain)

ans += maxgain

print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import math

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

digit_K = int(math.log(K, 2)) + 1 if not K == 0 else 0
d1s = [0]*digit_K
gain = []

ans = sum(A)
for i in range(digit_K):
    for j in range(N):
        d1s[i] += A[j] % 2
        A[j] = A[j] // 2
    gain.append((N - d1s[i] * 2) * 2**i)

pGain = [max(g, 0) for g in gain]
cK, kGain = K, []
for i in range(digit_K):
    cK, dK = divmod(cK,2)
    kGain.append(pGain[i] * dK)

maxgain = sum(kGain)
for i in range(digit_K):
    K, dK = divmod(K, 2)
    if dK == 1:
        sumgain = sum(pGain[:i] + kGain[i+1:])
        maxgain = max(maxgain, sumgain)

ans += maxgain
print(ans)
from collections import deque
N=int(input())
uvw=[[0,0,0] for _ in range(N-1)]
for i in range(N-1):
  u,v,w=list(map(int,input().split()))
  uvw[i]=[u,v,w]

d=deque()
d.append(1)
visited=[None]*N
visited[0]=0
def dfs(d,visited):
  l1=[]
  l2=[]
  s=d.pop()
  tmp=[]
  for i in range(len(uvw)):
    if uvw[i][0]==s:
      l1.append(i)
    if uvw[i][1]==s:
      l2.append(i)
  if l1!=[]:
    for i in l1:
      d.append(uvw[i][1])
      visited[uvw[i][1]-1]=(uvw[i][2]+visited[s-1])%2
      tmp.append([uvw[i][0],uvw[i][1],uvw[i][2]])
  if l2!=[]:
    for j in l2:
      d.append(uvw[j][0])
      visited[uvw[j][0]-1]=(uvw[j][2]+visited[s-1])%2
      tmp.append([uvw[j][0],uvw[j][1],uvw[j][2]])
  for lst in tmp:
    uvw.remove(lst)
  if len(d)==0 or (None not in visited):
    return visited
  return dfs(d,visited)

ans=dfs(d,visited)
for i in range(N):
  print(ans[i])

### FIXED CODE ###

N=int(input())
E=[[] for _ in range(N)]
for i in range(N-1):
  u,v,w=map(int,input().split())
  u-=1
  v-=1
  E[u].append((v,w))
  E[v].append((u,w))
color=[-1]*N
color[0]=0
stack=[0]
while stack:
  u=stack.pop()
  for v,w in E[u]:
    if color[v]==-1:
      stack.append(v)
      if w%2==0:
        color[v]=color[u]
      else:
        color[v]=1 if color[u]==0 else 0
for i in range(N):
  print(color[i])
#生徒の人数を取得
N = int(input())

# 生徒の人数を3で割った商の小数点以下を切り捨てた数値を変数に格納
groupnum = math.trunc(N / 3)

# 最大のグループ数の出力
print(groupnum)

### FIXED CODE ###

#生徒の人数を取得
N = int(input())
 
# 生徒人数を3で割った商の小数点を切り捨てた数値(最大のグループ数の出力)を変数に格納
print(N // 3)
N,k=map(int,input().split())
ans=0
for i in range(1,N+1):
  cnt=0
  while i < k:
    frag*(1/2)
    cnt+=1
    i*=2
  ans += (1/N)*i*((1/2)**cnt)
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
cnt = 0
for i in range(1, N+1):
	tmp = i
	x = 0
	while tmp < K:
		tmp *= 2
		x += 1
	cnt += (1 / N) * (0.5 ** x)
print(cnt)
n, h = map(int,input().split())
a = []
b = []
for i in range(n):
    ca, cb = map(int,input().split())
    a.append(ca)
    b.append(cb)

a.sort(reverse=True)
b.sort(reverse=True)
cnt = 0
while h > 0:
    if b[0] > a[0]:
        h -= b.pop(0)
        cnt += 1
    else:
        cnt += h//a[0]
        h -= a[0] * h//a[0]
        if h > 0:
            h -= a[0]
            cnt += 1
print(cnt)

### FIXED CODE ###

n, h = map(int,input().split())
a = []
b = []
for i in range(n):
    ca, cb = map(int,input().split())
    a.append(ca)
    b.append(cb)

amax = max(a)
b.sort(reverse=True)
cnt = 0
while h > 0:
    if b and b[0] > amax:
        h -= b.pop(0)
        cnt += 1
    else:
        cnt += h//amax
        h -= amax * (h//amax)
        if h > 0:
            h -= amax
            cnt += 1
print(cnt)
m=int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

l=factorization(m)
ans=0
for i in range(len(l)):
    a=1
    while(l[i][1]>=a):
        ans+=1
        l[i][1]-=a
        a+=1
if m=1:
    print("0")
else:
    print(ans)

### FIXED CODE ###

m=int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

l=factorization(m)
ans=0
for i in range(len(l)):
    a=1
    while(l[i][1]>=a):
        ans+=1
        l[i][1]-=a
        a+=1
if m==1:
    print("0")
else:
    print(ans)