Harryxun/stf_run huggingface dataset:
input = int(input())
hour = input / 3600
minute = hour / 60
second = minute / 60
print("%1:%2:%3") % (hour,minute,second)

### FIXED CODE ###

input = int(input())
if 0 <= input < 86400:
    hour = input / 3600
    minute = (input / 60) % 60
    second = input % 60
    print("%d:%d:%d" % (hour,minute,second))
import sys

sys.stdin = open('c1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_int():
    return int(input())


def read_str_list():
    return input().split()


def read_str():
    return input()


H, W, h, w = read_int_list()


def solve(H, W, h, w):
    if H % h == 0 and W % w == 0:
        return False, None
    a = [[0] * W for _ in range(H)]
    m = 10 ** 9 - 1
    M = m + 1
    for i in range(H, h):
        for j in range(W, w):
            a[i][j] = m
    for i in range(h - 1, H, h):
        for j in range(w - 1, W, w):
            a[i][j] = -M

    return True, a


possible, res = solve(H, W, h, w)
if possible:
    print('Yes')
    for row in res:
        print(' '.join(map(str, row)))
else:
    print('No')


### FIXED CODE ###

import sys

# sys.stdin = open('c1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_int():
    return int(input())


def read_str_list():
    return input().split()


def read_str():
    return input()


H, W, h, w = read_int_list()


def solve(H, W, h, w):
    if H % h == 0 and W % w == 0:
        return False, None
    a = [[0] * W for _ in range(H)]
    m = 10 ** 9 - 1
    M = m + 1
    for i in range(0, H, h):
        for j in range(0, W, w):
            a[i][j] = m
    for i in range(h - 1, H, h):
        for j in range(w - 1, W, w):
            a[i][j] = -M
    return True, a


possible, res = solve(H, W, h, w)
if possible:
    print('Yes')
    for row in res:
        print(' '.join(map(str, row)))
else:
    print('No')
from statistics import mode
N = int(input())
arr = [list(map(int,input().split())) for _ in range(N)]
arr = sorted(arr,key=lambda x:(x[0],x[1]))
diff_arr = [str(arr[i+1][0]-arr[i][0])+'_'+str(arr[i+1][1]-arr[i][1]) for i in range(N-1)]
mode = mode(diff_arr)
print(N - diff_arr.count(mode))

### FIXED CODE ###

import collections

N = int(input())
arr = [list(map(int,input().split())) for _ in range(N)]
if N==1:
  print(1)
else:
  arr = sorted(arr,key=lambda x:(x[0],x[1]))
  diff_arr = []
  for j in range(N):
    for k in range(1,N-j):
      diff_arr.append(str(arr[j+k][0]-arr[j][0])+'_'+str(arr[j+k][1]-arr[j][1]))
  c = collections.Counter(diff_arr)
  print(N-max(c.values()))
a,b,c=map(int,input().split())
d=max(a,max(b,c))
if 2*d=(a+b+c):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c=map(int,input().split())
d=max(a,max(b,c))
if 2*d==(a+b+c):
  print("Yes")
else:
  print("No")
def main():
    _ = input()
    A = map(int, input())
 
    B = tuple(map(abs, A))
    C = tuple(a for a in A if a < 0)
    print(sum(B) - min(B)*2*(len(C)%2))
 
 
if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import stdin

readline = stdin.readline

_, *aa = map(int, open(0).read().split())
r = 0
mi = 1000000000
m = 0
for a in aa:
    if a < 0:
        m += 1
    b = abs(a)
    r += b
    mi = min(b, mi)
print(r - mi * 2 * (m % 2))
n=int(input())
dp=[0,0,0]
for i in range(n):
    a,b,c=map(int,input().split())
    dp=[max(dp[1],dp[2])+a,max(dp[0],dp[2])+b,max(dp[0],dp[1])+c]
print(max(dp[n-1]))

### FIXED CODE ###

n=int(input())
dp=[0,0,0]
for i in range(n):
    a,b,c=map(int,input().split())
    dp=[max(dp[1],dp[2])+a,max(dp[0],dp[2])+b,max(dp[0],dp[1])+c]
print(max(dp))
import math
def lcm(x,y):
  return x*y/math.gcd(x,y)
def numantidiv(a,b,c):
    r=a-math.floor(a/b)-math.floor(a/c)+math.floor(a/lcm(b,c))
    return r

a,b,c,d=(int(x) for x in input().split())
ans=numantidiv(b,c,d)-numantidiv(a-1,c,d)
print(ans)

### FIXED CODE ###

S=input()
for i in range(3):
  if S[i]==S[i+1]:
    print("Bad")
    exit()
print("Good")
import functools
import numpy as np
H, W = map(int, input().split())
mat = np.array([list(input()) for _ in range(H)])


def get_bool(x, value, axis):
    return np.where(x == value, True, False).all(axis=axis)


custom_get_bool = functools.partial(mat, '.')
mat = mat[:, ~custom_get_bool(0)]
mat = mat[~custom_get_bool(1)]
print('\n'.join([''.join(row) for row in mat]))


### FIXED CODE ###

H, W = map(int, input().split())
mat = [input() for _ in range(H)]

# 列から確認
ans = []
for i in range(H):
    row = mat[i]
    if all(['.' == r for r in row]):
        continue
    ans.append(row)

columns = [''.join([a[w] for a in ans]) for w in range(W)]
tmp = len(ans)
columns = [c for c in columns if '.' * tmp != c]

ans = [''.join([c[i] for c in columns]) for i in range(len(columns[0]))]
print('\n'.join(ans))
n = int(input())
for i in range(1,10):
  fof j in range(1,10):
    if i * j == n:
      print("Yes")
      exit(0)
print("No")

### FIXED CODE ###

n = int(input())
for i in range(1,10):
  for j in range(1,10):
    if i * j == n:
      print("Yes")
      exit(0)
print("No")
class dset:
    def __init__(self,n):
        self.par = [-1]*n

    def size(self,n):
        return -self.par[self.root(n)]

    def root(self,n):
        return self.par[n] if self.par[n]>=0 else n

    def same(self, a, b):
        return self.root(a) == self.root(b)

    def __link__(self,a,b):
        if a == b:
            return 
        
        if self.size(a) < self.size(b):
            a,b = b,a
        
        self.par[a] += self.par[b]
        self.par[b] = a

    def unite(self,a,b):
        self.__link__(
            self.root(a)
            ,self.root(b)
            )


def main():
    n, m = map(int, input().split() ) 


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

    ds = dset(n)

    ans = [0]*m
    ans[-1] = n*(n-1)//2
    for i in range(m-1,0,-1):
        ans[i-1] = ans[i]

        a,b = ins[i]
        a-=1
        b-=1

#        print(ins[i])
       # print( (ds.root(a),ds.root(b)) ) 
        if not ds.same(a,b):
            x = ds.size(a)
            y = ds.size(b)
            #print((x,y))
            ans[i-1] -= x*y
            ds.unite(a,b)

    for e in ans:
        print(e)

if __name__ == '__main__':
    main()

### FIXED CODE ###




class dset:
    def __init__(self,n):
        self.par = [-1]*n

    def size(self,n):
        return -self.par[self.root(n)]

    def root(self,n):
        if self.par[n]<0:
            return n
        else:
            self.par[n] = self.root(self.par[n])
            return self.par[n]

    def same(self, a, b):
        return self.root(a) == self.root(b)

    def __link__(self,a,b):
        if a == b:
            return 
        
        if self.size(a) < self.size(b):
            a,b = b,a
        
        self.par[a] += self.par[b]
        self.par[b] = a

    def unite(self,a,b):
        self.__link__(
            self.root(a)
            ,self.root(b)
            )


def main():
    n, m = map(int, input().split() ) 


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

    ds = dset(n)

    ans = [0]*m
    ans[-1] = n*(n-1)//2
    for i in range(m-1,0,-1):
        ans[i-1] = ans[i]

        a,b = ins[i]
        a-=1
        b-=1

#        print(ins[i])
       # print( (ds.root(a),ds.root(b)) ) 
        if not ds.same(a,b):
            x = ds.size(a)
            y = ds.size(b)
            #print((x,y))
            ans[i-1] -= x*y
            ds.unite(a,b)

    for e in ans:
        print(e)

if __name__ == '__main__':
    main()
#11
n = int(input())
a = list(map(int, input().split()))

f = [-1]*(n+1)
p = 0
for i in range(n+1):
    t = a[i]
    if ( f[t] == -1 ):
        f[t] = i
    else:
        p = i - f[t] - 1
        break

g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
mod = 10**9 + 7
for i in range( 2, n + 2 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

def combination(n, r):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod


for i in range(n+1):
    if ( p>=i ):
        c = combination(n+1, i+1) - combination(p, i)
    else:
        c = combination(n+1, i+1)
    print( int(c) )

### FIXED CODE ###

# ringing
a = list(map(int, input().split()))
a = sorted(a)
print( a[0]+a[1] )
#!/usr/bin/env python3
import numpy as np
import math
import re

S = input()
K = input()

if S[0] == '1':
    print(S[1])
else:
    print(S[0])

### FIXED CODE ###

#!/usr/bin/env python3
import numpy as np
import math
import re

S = input()
K = input()

for i in range(int(K)):
    if(S[i] != '1'):
        print(S[i])
        exit()
print(S[i])
X,A = (int(x) for x in input().split())
L = list(map(int,input().split()))
cnt = 0
idx = 0
ans = 0
while(ans <= A):
  ans += L[idx]
  idx += 1
  cnt += 1
  
print(cnt)

### FIXED CODE ###

X,A = (int(x) for x in input().split())
L = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(X):
    ans += L[cnt]
    if(ans <= A):
        cnt += 1

print(cnt + 1)
a,b,x = map(int,input().split())
ans = b//x - a//x
if a%x == 0:
  ams += 1
print(ans)

### FIXED CODE ###

a,x,c = input().split()
X = x[0]
list = ['A',X,'C']
ans = ''.join(list)
print(ans)
n = int(input())
n_list = list(map(int,input().split())
n_list.sort()
print(n_list[-1] - n_list[0])

### FIXED CODE ###

n = int(input())
n_list = list(map(int,input().split()))
n_list.sort()
print(n_list[-1] - n_list[0])
S = str(input())

if S = 'A':
  print('T')
elif S = 'G':
  print('C')
elif S = 'T':
  print('A')
else:
  print('G')

### FIXED CODE ###

S = str(input())
 
if S == 'A':
  print('T')
elif S == 'G':
  print('C')
elif S == 'T':
  print('A')
else:
  print('G')
a=int(input())
p=int(input())
print(int((3*a+p)/2))

### FIXED CODE ###

L = list(map(int,input().split()))
print((int(L[0]*3+L[1])//2))
n, k = map(int, input().split())
s = [0] * (n+1)
a = [0] * k
for i in range(k):
    d = int(input())
    aa = [int(_) for _ in input().split()]
    a[i] = aa

for i in range(k):
    l = len(a[i])
    for j in range(l):
        s[a[i][j]] += 1

ans = 0
for i in range(1, k+1):
    if s[i] == 0:
        ans += 1
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
s = [0] * (n+1)
a = [0] * k
for i in range(k):
    d = int(input())
    aa = [int(_) for _ in input().split()]
    a[i] = aa

for i in range(k):
    l = len(a[i])
    for j in range(l):
        s[a[i][j]] += 1

ans = 0
for i in range(1, n+1):
    if s[i] == 0:
        ans += 1
print(ans)
import itertools
N = int(input())
A = [int(_) for _ in input().split()]
if A[0] != 0:
    if N == 0 and A[0] == 1:
        print(1)
    else:
        print(-1)
    exit()
ans = 1
n = 1
if A[0] > 1:
    print(-1)
    exit()
cumr = list(itertools.accumulate(A[::-1]))[::-1]
for i in range(1, N):
    minn = n - A[i - 1]
    n = min(2 * (n - A[i - 1]), cumr[i])
    ans += n
    if 0 <= minn <= n:
        continue
    print(-1)
    exit()
if n <= A[-1] <= 2 * n:
    ans += A[-1]
    print(ans)
else:
    print(-1)
    exit()


### FIXED CODE ###

a, b, c, d, e = [int(_) for _ in input().split()]
print(c * 60 + d - a * 60 - b - e)
def update(M, S, i, j, H, W, cluster):
    for i_n in [i - 1, i, i + 1]:
        for j_n in [j - 1, j, j + 1]:
            if i_n >= H or i_n < 0:
                continue
            if j_n >= W or j_n < 0:
                continue

            if i_n == i and j_n == j:
                continue
            if abs(i - i_n) + abs(j - j_n) == 2:
                continue

            if S[i][j] != S[i_n][j_n] and M[i_n][j_n] == 0:
                # print(M)
                M[i_n][j_n] = cluster
                update(M, S, i_n, j_n, H, W, cluster)


H, W = list(map(int, input().split()))
S = []
for i in range(H):
    S.append(input().strip())

cluster = 1
counts_B = {}
counts_W = {}
M = [[0 for j in range(W)] for i in range(H)]
for i in range(H):
    for j in range(W):
        if M[i][j] == 0:
            M[i][j] = cluster
            update(M, S, i, j, H, W, cluster)
            cluster = cluster + 1
        counts_B[M[i][j]] = 0
        counts_W[M[i][j]] = 0


for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            counts_B[M[i][j]] += 1
        else:
            counts_W[M[i][j]] += 1

    #     print(M[i][j], end=" ")
    # print("")

total = 0
for k in counts_B.keys():
    if k in counts_W:
        total += counts_B[k] * counts_W[k]
    # print(counts[k])

print(total)


### FIXED CODE ###

import sys

sys.setrecursionlimit(2000000)


def update(M, S, i, j, H, W, cluster):
    for i_n in [i - 1, i, i + 1]:
        for j_n in [j - 1, j, j + 1]:
            if i_n >= H or i_n < 0:
                continue
            if j_n >= W or j_n < 0:
                continue

            if i_n == i and j_n == j:
                continue
            if abs(i - i_n) + abs(j - j_n) == 2:
                continue

            if S[i][j] != S[i_n][j_n] and M[i_n][j_n] == 0:
                # print(M)
                M[i_n][j_n] = cluster
                update(M, S, i_n, j_n, H, W, cluster)


H, W = list(map(int, input().split()))
S = []
for i in range(H):
    S.append(input().strip())

cluster = 1
counts_B = {}
counts_W = {}
M = [[0 for j in range(W)] for i in range(H)]
for i in range(H):
    for j in range(W):
        if M[i][j] == 0:
            M[i][j] = cluster
            update(M, S, i, j, H, W, cluster)
            cluster = cluster + 1
        counts_B[M[i][j]] = 0
        counts_W[M[i][j]] = 0


for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            counts_B[M[i][j]] += 1
        else:
            counts_W[M[i][j]] += 1

    #     print(M[i][j], end=" ")
    # print("")

total = 0
for k in counts_B.keys():
    if k in counts_W:
        total += counts_B[k] * counts_W[k]
    # print(counts[k])

print(total)
a, b, c = map(int, input().split())
k = int(input())
i = 0

if k > 1:
  for t in range(1, k):
    if a<b*2*t and b*2*t<c*2*(k-t):
      i += 1
    elif a<b and b<c*2*k:
      i += 1
    elif a<b*2*k and b*2*k<C:
      i += 1
    else:
      i += 0
    t += 1
elif k == 1:
  if a<b*2 and b*2<c:
    i = 1
  elif a<b and b<c*2:
    i = 1
  else:
    i = 0
  
if i > 0:
  print('Yes')
elif i == 0:
  print('No')

### FIXED CODE ###

x = int(input())
if x >= 400 and x <= 599:
  print(8)
elif x >= 600 and x <= 799:
  print(7)
elif x >= 800 and x <= 999:
  print(6)
elif x >= 1000 and x <= 1199:
  print(5)
elif x >= 1200 and x <= 1399:
  print(4)
elif x >= 1400 and x <= 1599:
  print(3)
elif x >= 1600 and x <= 1799:
  print(2)
elif x >= 1800 and x <= 1999:
  print(1)
def resolve():
    n = int(input())
    action = []
    for i in range(n):
        action.append([int(i) for i in input().split()])
    df = []
    df.append(max(action[0]))
    prev = action[0].index(max(action[0]))
    for i in range(1, n):
        tgt = max([action[i][j] for j in range(len(action[i])) if j != prev])
        prev = action[i].index(tgt)
        df.append(tgt)
    print(sum(df))

if __name__ = "__main__":
    resolve()


### FIXED CODE ###

n = int(input())
action = []
for i in range(n):
    action.append([int(i) for i in input().split()])
dp = [[0 for _ in range(3)] for _ in range(n+1)]

for i in range(n):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i+1][k] = max(dp[i+1][k], dp[i][j] + action[i][k])
print(max(dp[n]))
N, K = map(int, input().split())
h = sorted([int(input()) for i in range(N)])
res = []
for i in range(N-K+1):
    res.append(tmp[i+K-1] - tmp[i])
print(min(res))

### FIXED CODE ###

N, K = map(int, input().split())
h = sorted([int(input()) for i in range(N)])
res = []
for i in range(N-K+1):
    res.append(h[i+K-1] - h[i])
print(min(res))
p=print
r=range
def a(i,j,k,l=0):p("+<"[l],i,j,k)
def b(i):a(i,i,i+1)
def d(x,i,j):
	for t in r(30):b(p:=j+t-1);a(q:=j+t,n,q);[*map(b,r(q,j+29))];a(j+29,x,i+t,1);b(p);a(q,i+t,q)
p(3933)
a(0,1,n:=97)
a(2,n,n,1)
a(0,n,3)
a(1,n,4)
d(3,5,36)
d(4,36,67)
for t in r(59):a(2,2,2);[t-30<s<30<(a(5+t-s,36+s,98),a(n,98,99,1),a(2,99,2))for s in r(t+1)]

### FIXED CODE ###

n=97
def c(i,j,k):print('<',i,j,k)
def a(i,j,k):print('+',i,j,k)
def m(i,j,k):
	for t in range(59):
		a(k,k,k)
		for s in range(t+1):
			if t-30<s<30:a(i+t-s,j+s,98);c(n,98,99);a(k,99,k)
def d(x,i,j):
	for t in range(30):
		a(j+t-1,j+t-1,j+t)
		a(j+t,n,j+t)
		for s in range(j+t,j+29):a(s,s,s+1)
		c(j+29,x,i+t)
		a(j+t-1,j+t-1,j+t)
		a(j+t,i+t,j+t)
print(3933)
a(0,1,n)
c(2,n,n)
a(0,n,3)
a(1,n,4)
d(3,5,36)
d(4,36,67)
m(5,36,2)
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import heapq
import fractions
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0

for i in range(N):
    if A[i]>B[i]:
        if A[i] >= B[i+1]+B[i]:
            ans += B[i]+B[i+1]
            B[i+1] = 0
        else:
            B[i+1] -= A[i]-B[i]
            ans += A[i]
    else:
        ans += A[i]

print(ans)

### FIXED CODE ###

#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import heapq
import fractions
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0

for i in range(N):
    if B[i]>A[i]:
        if B[i] >= A[i+1]+A[i]:
            ans += A[i]+A[i+1]
            A[i+1] = 0
        else:
            A[i+1] -= B[i]-A[i]
            ans += B[i]
    else:
        ans += B[i]

print(ans)
import math

c  = raw_input()

for var in range(0, int(c)) :
	n1 = raw_input()
	n2 = raw_input()
	sum = int(n1) + int(n2)

	if int(math.log10(sum)) + 1 > 80 :
		print("overflow")
	else :
		print(sum)

### FIXED CODE ###

for _ in range(int(input())) :
    n = int(input()) + int(input())
    if (n >= 10 ** 80) :
        print("overflow")
    else :
        print(n)
n=int(input())
i=int(list(str(n))[0])+int(list(str(n))[1])
if n%i==0:print("Yes")
else:print("No")

### FIXED CODE ###

n=int(input())
l=list(str(n))
i=0
for x in l:
    i+=int(x)
if n%i==0:print("Yes")
else:print("No")
N,Q=map(int,input().split())
S=input()
L=[tuple(map(int, input().split())) for _ in range(Q)]
print("\n".join([str(len(S[nS-1:nE])-len(S[nS-1:nE].replace("AC", "|"))) for nS, nE in L]))


### FIXED CODE ###

S=input()

c=m=0
for x in S:
  #print((m,c,x,"ACGT".find(x)))
  if "ACGT".find(x)>=0:
    c+=1
    m = max(m, c)
  else:
    c = 0

print(m)
# using sort

n = int(input())
count = 0
a = [[0 for i in range(n)] for i in range(3)]

for i in range(3):
    a[i] = [int(x) for x in input().split()]
    a[i].sort()

# Brute force
for i in a[0]:
    for j in a[1]:
        if i < j:
            index = 0
            for k in a[2]:
                if j < k:
                    count += n - index
                    break
                else:
                    index += 1

print(count)

### FIXED CODE ###

a = [0,0]
temp = [0,0]

for k in range(2):
    temp[k] = input()
    a[1-k] = temp[k][::-1]

if (temp[0] == a[0]) and (temp[1] == a[1]):
    print('YES')
else:
    print('NO')
class Node(object):
    def __init__(self, N):
        self.p = [-1 for i in range(N)]
        self.l = [-1 for i in range(N)]
        self.r = [-1 for i in range(N)]
        self.D = [-1 for i in range(N)]

    def set_depth(self, u, p):
        self.D[u] = p
        if self.r[u] is not -1:
            self.set_depth(self.r[u], p)
        if self.l[u] is not -1:
            self.set_depth(self.l[u], p+1)

    def print_children(self, u):
        children = []
        flag = self.l[u]
        while flag is not -1:
            children.append(flag)
            flag = self.r[flag]
            
        return children

N = int(input())
T = Node(N)

for j in range(N):
    A = [int(i) for i in input().readline().split()]
    
    if len(A) > 2:
        T.l[j] = A[2]
    else:
        T.l[j] = -1

    for index, i in enumerate(A[2:]):
        if(A[-1] == i):
            T.p[i], T.r[i] = A[0], -1
        else:
            T.p[i], T.r[i] = A[0], A[index+3]

T.set_depth(0, 0)

for i in range(N):
    if T.p[i] is -1:
        node = "root"
    elif T.l[i] is -1:
        node = "leaf"
    else:
        node = "internal node"
        
    print("node {0}: parent = {1}, depth = {2}, {3}, {4}".format(i, T.p[i], T.D[i], node, T.print_children(i)))

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(100000)
class Node(object):
    # left????????¨??????????????????(leaf), right???s?????¨??????????????????????????????
    # ???????????????????????????????????¨???????????´??????parent???-1?????????
    def __init__(self, N):
        self.p = [-1 for i in range(N)]
        self.l = [-1 for i in range(N)]
        self.r = [-1 for i in range(N)]
        self.D = [0 for i in range(N)]

    def set_depth_rec(self, u, p):
        self.D[u] = p
        if self.r[u] is not -1:
            self.set_depth(self.r[u], p)
        if self.l[u] is not -1:
            self.set_depth(self.l[u], p+1)

    def set_depth(self, u):
        d = 0
        pre_u = u
        while self.p[u] is not -1:
            u = self.p[u]
            d += 1
        self.D[pre_u] = d

    def print_children(self, u):
        children = []
        flag = self.l[u]
        while flag is not -1:
            children.append(flag)
            flag = self.r[flag]
            
        return children
        

N = int(input())
T = Node(N)

for j in range(N):
    A = [int(i) for i in input().split()]
    
    # left????±????
    if len(A) > 2:
        T.l[A[0]] = A[2]
    else:
        T.l[A[0]] = -1

    # parent???right????±????
    for index, i in enumerate(A[2:]):
        if(A[-1] == i):
            T.p[i], T.r[i] = A[0], -1
        else:
            T.p[i], T.r[i] = A[0], A[index+3]
    
#T.set_depth_rec(T.p.index(-1), 0)
for i in range(N):
    T.set_depth(i)

for i in range(N):
    if T.p[i] is -1:
        node = "root"
    elif T.l[i] is -1:
        node = "leaf"
    else:
        node = "internal node"
        
    print("node {0}: parent = {1}, depth = {2}, {3}, {4}".format(i, T.p[i], T.D[i], node, T.print_children(i)))
N,Q = map(int,input().split())
sons = {1:[]}
edges = {}
for _ in range(N-1):
    a,b = map(int,input().split())
    if a==1:
    	sons[a] += [b]
    else:
      	edges[a] = edges[a]+[b] if b in edges.keys() else [b]
        edgese[b] = edges[b]+[a] if a in edges.keys() else [a]

counts = [0]*(N+1)
for _ in range(Q):
    p,x = map(int,input().split())
    counts[p] += x
        
stack = sons[1]
count_stack = [counts[1]]
ignores = set([])
results = [0]*(N+1)
results[1] = counts[1]
while stack != []:
  	next_stack = []
    next_cstack = []
	for x,c in zip(stack,count_stack):
      	results[x] = counts[x]+c
  		sons[x] = set(edges[x])-ignores
    	next_stack += sons[x]
        next_cstack += [results[x]]*len(sons[x])
        ignores = ignores | set([x])
        print(results[i], end=' ')
    stack = next_stack
    count_stack = next_cstack

### FIXED CODE ###

N,Q = map(int,input().split())
parents = {1:0}
for _ in range(N-1):
    a,b = map(int,input().split())
    key,val = max(a,b), min(a,b)
    parents[key] = val
counts = [0]*(N+1)
for _ in range(Q):
    p,x = map(int,input().split())
    counts[p] += x
results = [0]*(N+2)
for i in range(1,N+1):
    results[i] = counts[i]+results[parents[i]]
    print(results[i], end=' ')
a, b, c = map(int,input().split())
if a = b:
    if a = c:
        print("No")
    else:
        print("Yes")
elif a = c:
    print("Yes") 
else:
    print("No")

### FIXED CODE ###

a, b, c = map(int,input().split())
if a == b:
    if a == c:
        print("No")
    else:
        print("Yes")
elif a == c:
    print("Yes") 
elif b == c:
    print("Yes")
else:
    print("No")
n = int(input())
A = [int(x) for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if len(A) = N:
    print("APPROVED")
else:
    print("DENIED")

### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if len(A) == N:
    print("APPROVED")
else:
    print("DENIED")
a,b=map(int,input().split())
c=[]
c=input().split()
d=c.sort()
print(d)
ans=0
for i in range(0,b):
 ans+=d[i]

print(ans)

### FIXED CODE ###

a,b=map(int,input().split())
c=list(map(int,input().split()))
d=sorted(c)
ans=0
for i in range(0,b):
 ans+=d[i]
print(ans)