Harryxun/stf_run huggingface dataset:
data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]

count = int(input())
for c in range(count):
    c, f, r, v = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v
    

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()
    print()

### FIXED CODE ###

data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]
    
count = int(input())
for c in range(count):
    b,f,r,v = [int(i) for i in input().split()]
    data[b-1] [f-1] [r-1] += v
    
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
        print()
    if bi < 3:
        print('#' * 20)
import numpy as np

N=int(input())
V=np.array(list(map(int,input().split())))
C=np.array(list(map(int,input().split())))
bit=[]
max=0
for i in range(2**N):
    bit=np.array([int(bin((i & (1 << j)) >> j), 0)  for j in range(N)])
    X=np.dot(V,bit)
    Y=np.dot(C,bit)
    if max<X-Y:
        max=X-Y
print(max)



### FIXED CODE ###

N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
dif=[]
count=0
for i in range(N):
    dif.append(int(V[i]-C[i]))

dif.sort(reverse=True)

i=0
for i in range(N):
    if dif[i]>=0:
        count=count+dif[i]
    else:
        break

print(count)
N,A,B=map(lambda x:int(x) , raw_input().split(' '))
if A>B or N<2:
	print 0
elif A==B:
	print 1
else:
	li= range(0,B-A+2)[::-1]
        print li
	print sum(li[:N-2])

### FIXED CODE ###

N,A,B=map(lambda x:int(x) , raw_input().split(' '))

if N==0:
	print 0
elif N==1:
	if A==B:
		print 1
	else:
		print 0
elif A>B:
	print 0
else:
	print (B-A)*(N-2)+1
n, q = list(map(int, input().split()))
s = input()
lr = []
for _ in range(q):
    lr.append(list(map(int, input().split())))
dp = [0]*(10^5+1)
for i in range(1, n):
    if s[i-1]=="A" and s[i]=="C":
        dp[i+1]=dp[i]+1
    else:
        dp[i+1]=dp[i]
for i in range(q):
    l = lr[i][0]
    r = lr[i][1]
    ans = dp[r] - dp[l]
    print(ans)

### FIXED CODE ###

n, q = list(map(int, input().split()))
s = input()
dp = [0, 0]
for i in range(1, n):
    if s[i-1]=="A" and s[i]=="C":
        dp.append(dp[-1]+1)
    else:
        dp.append(dp[-1])
for i in range(q):
    l, r = map(int, input().split())
    ans = dp[r] - dp[l]
    print(ans)
N, S = map(int, input().split())
data = list(map(int, input().split()))

MOD = 998244353
dp = [[0]*(S+1) for _ in range(N)]
ans = 0

for i, num in enumerate(data):
    dp[i][num] = 1
    for j in range(i):
        for k in range(S-num, 0, -1):
            if dp[j][k] >= 1:
                dp[j][k+num] += dp[j][k]
            if k == num:
                dp[j][num] += 1
    for j in range(i+1):
        ans += dp[j][S]
    ans %= MOD

print(ans)

### FIXED CODE ###

P = 998244353

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

dp0 = [[0]*(S+1) for _ in range(N)]
dp1 = [[0]*(S+1) for _ in range(N)]
dp2 = [[0]*(S+1) for _ in range(N)]

dp0[0][0] = 1
dp1[0][0] = 1
if A[0] <= S:
    dp1[0][A[0]] = 1

for i in range(1, N):
    dp0[i][0] = 1
    dp1[i][0] = dp1[i-1][0] + 1
    dp2[i][S] = dp2[i-1][S] + dp1[i-1][S]
    if A[i] == S:
        dp2[i][S] += dp1[i-1][0] + 1
        dp1[i][S] += dp1[i-1][0] + 1
    elif A[i] < S:
        dp1[i][A[i]] += 1 + dp1[i-1][0]
    for j in range(1, S+1):
        dp1[i][j] += dp1[i-1][j]
        if j + A[i] < S:
            dp1[i][j+A[i]] += dp1[i-1][j]
        elif j + A[i] == S:
            dp2[i][S] += dp1[i-1][j]
            dp1[i][S] += dp1[i-1][j]
        dp0[i][j] %= P
        dp1[i][j] %= P
        dp2[i][j] %= P

print(dp2[N-1][S])
from collections import Counter

n = int(input())
v = list(map(str, input().split()))

f = Counter(v[::2]).most_common(2)
s = Counter(v[1::2]).most_common(2)

if f[0][0] != s[0][0]:
    print(n - f[0][1] - s[0][1])
else:
    if len(s) == 1 or len(b) == 1:
        print(n // 2)
    else:
        print(n - max(f[0][1] + s[1][1], f[1][1] + s[0][1]))


### FIXED CODE ###

from collections import Counter

n = int(input())
v = list(map(str, input().split()))

f = Counter(v[::2]).most_common(2)
s = Counter(v[1::2]).most_common(2)

if f[0][0] != s[0][0]:
    print(n - f[0][1] - s[0][1])
else:
    if len(f) == 1 or len(s) == 1:
        print(n // 2)
    else:
        print(n - max(f[0][1] + s[1][1], f[1][1] + s[0][1]))
while 1: 
	h , w=map(int, input().split())
	if (h==0) and (w==0): break

	else:
		print("#"*w)
		for I in  range(h-2):
		print("#"+"."*(w-2)+"#")
		print("#"*w)
 


### FIXED CODE ###

while 1:
        (H,W)=[int(i) for i in input().split()]
        if H==W==0:
                break
        print('#'*W)
        for i in range(H-2):
                print('#'+'.'*(W-2)+'#')
        print('#'*W)
        print('')
N, X, T = input().split()

if N / X:
	print(N / X * T)
else:
	print((N / X + 1) * T)


### FIXED CODE ###

N, X, T = map(int, input().split())

if N % X:
	print((N // X + 1) * T)
else:
	print(N // X * T)
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 ** 9

N, M = map(int, readline().split())
AC = 0
WA = 0
li = []
for i in range(M):
    p, s = map(str, readline().decode('utf8').strip().split())
    if p not in li:
        if s != 'AC':
            WA += 1
        else:
            AC += 1
            li.append(p)

print(AC, WA)


### FIXED CODE ###

"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 ** 9

N, M = map(int, readline().split())
PS = [line.split() for line in readlines()]
AC = [False] * (N + 1)
WA = [0] * (N + 1)

penal = 0
for p, s in PS:
    p = int(p)
    if AC[p]:
        continue
    if s == b'WA':
        WA[p] += 1
    else:
        AC[p] = True
        penal += WA[p]

ac = sum(AC)
print(ac, penal)
K,N = map(int,input().split())
li = list(map(int,input().split()))
maxd=(K-li[N-1])+li[0]
for i in range(N-1):#i番目の家を出発地にした時の最小距離を順に求めていく
  maxd=max(maxd, li[i+1]-li[i]) 
print(K-maxd)

### FIXED CODE ###

s=input()
if s[2]==s[3] and s[4]==s[5]:
  print('Yes')
else:
  print('No')
import math
A,B,C,D=map(int,input().split())
L=C*D//math.gcd(C,D)

if A%C!=0 and A%D!=0:
    print((B-A+1)-((B-(A//C+1)*C)//C+1+(B-(A//D+1)*D)//D+1-(((B-(A//L+1)*L)//L)+1)))
elif A%C==0 and A%D!=0:
    print((B-A+1)-(((B-(A//C)*C)//C+1)+((B-(A//D+1)*D)//D+1)-((B-(A//L+1)*L)//L+1)))
elif A%C!=0 and A%D==0:
    print((B-A+1)-((B-(A//C+1)*C)//C+1+(B-(A//D)*D)//D+1-(B-(A//L+1)*L)//L-1))
elif A%C==0 and A%D==0 and A%L==0:
    print((B-A+1)-((B-(A//C)*C)//C+1+(B-(A//D)*D)//D++1(B-(A//L)*L)//L-1))
elif A%C==0 and A%D==0 and A%L!=0:
    print((B-A+1)-((B-(A//C)*C)//C+1+(B-(A//D)*D)//D+1+(B-(A//L+1)*L)//L-1))

### FIXED CODE ###

import fractions
A,B,C,D=map(int,input().split())
L=C*D//fractions.gcd(C,D)

if A%C!=0 and A%D!=0:
    print((B-A+1)-((B-(A//C+1)*C)//C+1+(B-(A//D+1)*D)//D+1-(((B-(A//L+1)*L)//L)+1)))
elif A%C==0 and A%D!=0:
    print((B-A+1)-(((B-(A//C)*C)//C+1)+((B-(A//D+1)*D)//D+1)-((B-(A//L+1)*L)//L+1)))
elif A%C!=0 and A%D==0:
    print((B-A+1)-((B-(A//C+1)*C)//C+1+(B-(A//D)*D)//D+1-(B-(A//L+1)*L)//L-1))
elif A%C==0 and A%D==0 and A%L==0:
    print((B-A+1)-((B-(A//C)*C)//C+1+(B-(A//D)*D)//D+1-(B-(A//L)*L)//L-1))
elif A%C==0 and A%D==0 and A%L!=0:
    print((B-A+1)-((B-(A//C)*C)//C+1+(B-(A//D)*D)//D+1-(B-(A//L+1)*L)//L-1))
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		if(S == U) score[0]--;
		else score[1]--;
		Console.WriteLine(String.Join(" ",score));
	}
	String S,T;
	int[] score;
	String U;
	public Sol(){
		var ss = rsa();
		S = ss[0]; T = ss[1];
		score = ria();
		U = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


### FIXED CODE ###

from sys import stdin
import sys
import numpy as np
import collections
from functools import cmp_to_key
import heapq

##  input functions for me
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def rip(sep = ''):
    if sep == '' :
        return map(int, input().split()) 
    else: return map(int, input().split(sep))
def ria(sep = ''): 
    return list(rip(sep))
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()
##
def main():
    s, t = rsa()
    a, b = ria()
    u = rs()
    if s == u: a -= 1
    if t == u: b -= 1
    print("{0} {1}".format(a,b))


if __name__ == "__main__":
    main()
from decimal import *
import re
def solve2(m, n):
    maxlen = 80
    PREC=200
    getcontext().prec = PREC
    x = Decimal(m) / Decimal(n)
    s = x.to_eng_string()
    if len(s) < PREC:
        return(s[2:],'')
    rep = 1
    while True:
        r = r'(.{%d})\1{%d,}' % (rep, int((PREC-20)/rep))  #ex. '(.{6})\\1{12,}'
        a=re.search(r, s)
        if a:
            break
        rep += 1
        if rep > maxlen:
            raise ValueError('This cannot happen.rep=%d' % rep)

    u = s[2:a.start()+len(a.group(1))]
    v = (' '*PREC + '^'*len(a.group(1)))[-len(u):]
    return(u,v)

while True:
    try:
        m,n = map(int, input().strip().split())
        s,t = solve2(m, n)
        print(s)
        if t!='':
            print(t)
    except EOFError:
        break

### FIXED CODE ###

from decimal import *
import re
def solve2(m, n):
    maxlen = 80
    PREC=180
    getcontext().prec = PREC
    x = Decimal(m) / Decimal(n)
    s = x.to_eng_string()
    if len(s) < PREC:
        return(s[2:],'')
    rep = 1
    while True:
        r = r'(.{%d})\1{%d,}' % (rep, int(maxlen/rep))  #ex. '(.{6})\\1{13,}'
        a=re.search(r, s)
        if a:
            break
        rep += 1
        if rep > maxlen:
            raise ValueError('This cannot happen.rep=%d' % rep)

    u = s[2:a.start()+len(a.group(1))]
    v = (' '*PREC + '^'*len(a.group(1)))[-len(u):]
    return(u,v)

while True:
    try:
        m,n = map(int, input().strip().split())
        s,t = solve2(m, n)
        print(s)
        if t!='':
            print(t)
    except EOFError:
        break
a=map(int, raw_input().split())
a=sorted(a)
for i in range (len(a)):
    print a[i] + " "

### FIXED CODE ###

a = map(int, raw_input().split())
a.sort()
for i in range(len(a)):
    print a[i],
N = int(input())
if N>=1,N<=999:
    print('ABC')
if N>=1000,N<=1998
    print('ABD')

### FIXED CODE ###

N = input()
N=int(N)
if N>=1 and N<=999:
    print('ABC')
if N>=1000 and N<=1998:
    print('ABD')
h, w = map(int, input().split())
n = int(input())
colors = list(map(int, input().split()))
cmap = [(i+1,a) for i,a in enumerate(colors)]
campus=[0]*(h*w)

def printmtrx(campus):
    ts=""
    for idx,i in enumerate(campus):
        if((idx+1)%w==1):
            if idx==0:
                ts += str(i) + " "
            else:
                ts+="\n"+str(i)+" "
        else:
            if (idx+1)%w==0:
                ts += str(i)
            else:
                ts+=str(i)+" "
    print(ts)

#print(cmap)
#print(campus)

cnt=cmap[0][1]
idx=0
campusidx=0
direct=0
while cnt:
    #print(campusidx)
    #printmtrx(campus)
    #print("")
    campus[campusidx]=cmap[idx][0]
    cnt-=1
    if(cnt<1):
        idx+=1
        if(idx>=len(cmap)):
            break
        cnt=cmap[idx][1]
    campusidx+=1-2*direct
    if campusidx%w==0 and direct==0:
        campusidx+=w-1
        direct=1
    elif campusidx%w==4 and direct==1:
        campusidx+=w+1
        direct=0
printmtrx(campus)



### FIXED CODE ###

h, w = map(int, input().split())
n = int(input())
colors = list(map(int, input().split()))
cmap = [(i+1,a) for i,a in enumerate(colors)]
campus=[0]*(h*w)

def printmtrx(campus):
    ts=""
    for idx,i in enumerate(campus):
        if((idx+1)%w==1):
            if idx==0:
                ts += str(i) + " "
            else:
                ts+="\n"+str(i)+" "
        else:
            if (idx+1)%w==0:
                ts += str(i)
            else:
                ts+=str(i)+" "
    print(ts)

def printmtrx2(campus):
    cnt=0
    for i in range(h):
        ts=""
        for j in range(w):
            if not j==0:
                ts+=" "
            ts+=str(campus[cnt])
            cnt+=1
        print(ts)

#print(cmap)
#print(campus)

cnt=cmap[0][1]
idx=0
campusidx=0
direct=0
while cnt:
    #print(campusidx)
    #printmtrx(campus)
    #print("")
    campus[campusidx]=cmap[idx][0]
    cnt-=1
    if(cnt<1):
        idx+=1
        if(idx>=len(cmap)):
            break
        cnt=cmap[idx][1]
    campusidx+=1-2*direct
    if campusidx%w==0 and direct==0:
        campusidx+=w-1
        direct=1
    elif campusidx%w==w-1 and direct==1:
        campusidx+=w+1
        direct=0
printmtrx2(campus)
from scipy.sparse.csgraph import csgraph_from_dense, dijkstra
import numpy as np

N = int(input())

G = np.full((N, N), 10**12)

if N==1:
    print(1)
else:
    for i in range(N-1):
        u, v, w = map(int, input().split())
        G[u-1][v-1] = w
        G[v-1][u-1] = w

    # G2 = csgraph_from_dense(G, null_value=10**12)
    # d = dijkstra(G2, indices=0)

    # for dist in d:
    #     if dist % 2 == 0:
    #         print(1)
    #     else:
    #         print(0)


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)


N = int(input())
G = [[] for i in range(N)]

for i in range(N-1):
    u, v, w = map(int, input().split())
    if w % 2 == 0:
        G[u-1].append((v-1, 1))
        G[v-1].append((u-1, 1))
    else:
        G[u-1].append((v-1, -1))
        G[v-1].append((u-1, -1))

color = [None for i in range(N)]


def set_color(v, c):
    color[v] = c
    for next_v, d in G[v]:
        if color[next_v] is None:
            set_color(next_v, d*c)


set_color(0, 1)

for c in color:
    if c == 1:
        print(1)
    else:
        print(0)
num, t = map(int, input().split())
taste = []
findmin = []

sum= 0
for i in range(len(num)):
  taste.append(t+i-1)
  sum += t+i-1
for j in range(len(taste)):
  findmin.append(j*j)
m = findmin.index(min(findmin))
print(sum - taste[m])





### FIXED CODE ###

num, t = map(int, input().split())
taste = []
findmin = []

sum= 0
for i in range(1,num + 1):
  taste.append(t+i-1)
  sum += t+i-1
for j in range(len(taste)):
  findmin.append(taste[j]*taste[j])
m = findmin.index(min(findmin))
print(sum - taste[m])
S=input()
if S.count"o"+15-len(S)>=8
	print("YES")
else:
	print("NO")

### FIXED CODE ###

S=input()
if S.count("o")+15-len(S)>=8:
	print("YES")
else:
	print("NO")
a=input()
b=input()
s="1","2","3"
s.remove(x)
s.remove(y)
print s[0]

### FIXED CODE ###

a=input()
b=input()
if a==1 and b==2:
  print "3"
elif a==2 and b==3:
  print "1"
elif a==3 and b==1:
  print "2" 
elif a==3 and b==2:
  print "1"
elif a==2 and b==1:
  print "3"
else:
  print "2"
a , b = input().split()
if (a+b) >= 24:
	print (a + b - 24)
else:
  	print (a + b)


### FIXED CODE ###

a , b = map(int, input().split())
if a+b >= 24:
	print ((a + b) - 24)
else:
  	print (a + b)
import sys
import itertools
input = sys.stdin.readline
sys.setrecursionlimit(100000)
# mod = 10 ** 9 + 7
mod = 998244353

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


class V:
    def __init__(self, f):
        self.f = f
        self.v = None
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if self.v is None:
            self.v = n
        else:
            self.v = self.f(self.v, n) 


def f(N, S, A, L, R, exist=False):
    if S == 0:
        return [[0, L - 1]]

    SS = sum(A[L:R + 1])
    if SS < S:
        return []
    if SS == S:
        return [[L, R]]
    if L == R:
        return []

    T1 = f(N, S, A, L + 1, R, exist)
    T2 = f(N, S - A[L], A, L + 1, R, True)

    if not exist and len(T2) > 0:
        for l in T2:
            l[0] = L
    T1.extend(T2)
    return T1


def main():
    N = int(input())
    S = read_list()

    dp = [[0 for _ in range(N)] for __ in range(N)]
    res = V(max)
    res.ud(0)
    for c in range(1, N):
        T = set()
        for k in range(N):
            t1 = (k + 1) * c
            t2 = (N - 1) - t1 
            if t1 >= N - 1:
                break
            
            if t1 == t2:
                break

            if t1 in T or t2 in T: 
                break
        
            dp[c][k + 1] = dp[c][k] + S[t1] + S[t2]
            T.add(t1)
            T.add(t2)
            res.ud(dp[c][k + 1])

    print(res)



if __name__ == "__main__":
    main(

### FIXED CODE ###

import sys
import itertools
input = sys.stdin.readline
sys.setrecursionlimit(100000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if self.v is None:
            self.v = n
        else:
            self.v = self.f(self.v, n) 


def main():
    N = int(input())
    S = read_list()

    res = V(max, 0)
    for c in range(1, N):
        r = 0
        t1 = 0
        t2 = N - 1
        a = t2 - c
        while True:
            if a < c:
                break
            
            if (N - 1) % c == 0 and 2 * a <= N - 1:
                break

            t1 += c
            t2 -= c
            a -= c
            r += S[t1] + S[t2]
            res.ud(r)

    print(res)


if __name__ == "__main__":
    main()
N = int(input())
A = list(map(int, input().split()))

start_v = (sum(A) - A[0])*A[0]

ans = start_v
for i in range(2, N):
    ans += int((start_v - sum(A[1:i])*A[0])*A[i-1]/A[0])

print(ans%(10**9 + 7))
    


### FIXED CODE ###

from itertools import accumulate

n = int(input())
a = list(map(int, input().split()))
b = list(accumulate(a))
sum = 0

for i in range(len(a)):
    sum += a[i]*(b[-1] - b[i])
    sum %= 10**9 + 7

print(sum)
def main():
    n = int(input())
    alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
    #print(len(alphabet))
    ans = ''
    
    i = 1
    length = 1
    while (26 ** (i-1)) + (26 ** i) < n:
        length += 1
        i += 1
        #print(length)
    
    #print(length)
    for j in reversed(range(1, length+1)):
        r = n // 26 **(j-1)
        n -= (26 ** (j - 1))* r
        ans = alphabet[r-1] + ans
        #print(j)
    
    
    print(ans)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###


def main():
    n = int(input())
    ans = ''
    
    for i in range(1, 99):
        if n <= 26 ** i:
            n -= 1
            for j in range(i):
                ans += chr(ord('a') + n % 26)
                n //= 26
            break
        else:
            n -= 26 ** i
    
    print(ans[::-1])
    
if __name__ == '__main__':
    main()
n = int(input())
a = list(map(int, input().split()))
def gcm(a, b) :
  while(b) :
    a, b = b, a%b
  return a
def lcm(a, b) :
  return int(a*b/gcm(a, b))

b = a[0]
for i in range(n-1) :
  b = lcm(b, a[i+1])
  
print(sum([(b-1)%a[i] for i in range(n)]))

### FIXED CODE ###

n = input()
print(sum(list(map(lambda x: int(x)-1, input().split()))))
A,B,C = map(int,input())
num_list = [A,B,C]
list_s = sorted(num_list)
if A % 2 == 1 and B % 2 == 1 and C % 2 == 1:
    print(list_s[0]*list_s[1])
else:
    print(0)

### FIXED CODE ###

A,B,C = map(int,input().split(' '))
num_list = [A,B,C]
list_s = sorted(num_list)
if A % 2 == 1 and B % 2 == 1 and C % 2 == 1:
    print(list_s[0]*list_s[1])
else:
    print(0)
INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2
 
n = int(input())
M = [list(map(int, input().split())) for i in range(n)]
 
d = [INFTY for i in range(n)]
color = [INFTY for i in range(n)]
 
for i in range(n):
    u = int(input())
    k = int(input())
    for j in range(k):
        v = int(input())
        c = int(input())
        M[u][v] = c
        
def dijkstra():
    global M, d, p, color
    d[0] = 0
    color[0] = GRAY
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if (d[v] > d[u] + M[u][v]):
                    d[v] = d[u] + M[u][v]
                    color[v] = GRAY
    for i in range(n):
        print(str(i) + " " + str(d[i]))
print(dijkstra())

### FIXED CODE ###

from sys import stdin

INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2

n = int(stdin.readline())
M = [[INFTY for i in range(n)] for j in range(n)]

for u in range(n):
    U = list(map(int, stdin.readline().split()[2:]))
    for j in range(0, len(U), 2):
        M[u][U[j]] = U[j+1]

d = [INFTY for i in range(n)]
color = [WHITE for i in range(n)]

def dijkstra():
    global n
    d[0] = 0
    color[0] = GRAY
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if(d[v] > d[u] + M[u][v]):
                    d[v] = d[u] + M[u][v]
                    color[v] = GRAY
    for i in range(
n):
        print(i, (-1 if d[i] == INFTY else d[i]))
dijkstra()
def dfs(dp,edges,node,visited):
    if node not in visited:
        visited.add(node)
        for kid in edges[node]:
            dfs(dp,edges,kid,visited)
            #print(dp,node,kid)
            dp[node-1] = max(dp[node-1],dp[kid-1])
        if edges[node]:
            dp[node-1] += 1

def solve(edges,n):
    dp = [0]*n
    visited = set()
    for i in range(1,n+1):
        if i not in visited:
            #print(i)
            dfs(dp,edges,i,visited)

    #print(dp)
    print(max(dp))

def main():
    n,m = map(int,raw_input().split())
    edges = {}
    for i in range(1,n+1):
        edges[i] = []

    for i in range(m):
        x,y = map(int,raw_input().split())
        edges[x].append(y)

    solve(edges,n)


main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

def dfs(dp,edges,node,visited):
    if node not in visited:
        visited.add(node)
        for kid in edges[node]:
            dfs(dp,edges,kid,visited)
            #print(dp,node,kid)
            dp[node-1] = max(dp[node-1],dp[kid-1])
        if edges[node]:
            dp[node-1] += 1

def solve(edges,n):
    dp = [0]*n
    visited = set()
    for i in range(1,n+1):
        if i not in visited:
            #print(i)
            dfs(dp,edges,i,visited)

    #print(dp)
    print(max(dp))

def main():
    n,m = map(int,input().split())
    edges = {}
    for i in range(1,n+1):
        edges[i] = []

    for i in range(m):
        x,y = map(int,input().split())
        edges[x].append(y)

    solve(edges,n)


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

if ord(a) < ord(b):
    print("<")
elif ord(a) > ord(b):
    print(">")
else:
    print("=")

### FIXED CODE ###

a,b = input().split()

if ord(a) < ord(b):
    print("<")
elif ord(a) > ord(b):
    print(">")
else:
    print("=")
n = raw_input()

print n*n*n

### FIXED CODE ###

n = int(raw_input())
print n**3