Harryxun/stf_run huggingface dataset:
def mark(s, x):
    for i in range(x + x, len(s), x):
        s[i] = False

def sieve(n):
    s = [True] * n
    for x in range(2, int(n**0.5) + 1):
        if s[x]: mark(s, x)
    return [i for i in range(0,n) if s[i] and i > 1]

n = []
while True:
    tmp = int(input())
    if tmp == 0:
        break
    n.append(tmp)
m = max(n)
p = sieve(10000)

for i in range(len(n)):
    sum = 0
    for j in range(n[i]):
        sum += p[j]
    print(sum)

### FIXED CODE ###

def mark(s, x):
    for i in range(x + x, len(s), x):
        s[i] = False

def sieve(n):
    s = [True] * n
    for x in range(2, int(n**0.5) + 1):
        if s[x]: mark(s, x)
    return [i for i in range(0,n) if s[i] and i > 1]

n = []
while True:
    tmp = int(input())
    if tmp == 0:
        break
    n.append(tmp)
m = max(n)
p = sieve(500000)

for i in range(len(n)):
    sum = 0
    if n[i] == 1:
        print(2)
    else:
        for j in range(n[i]):
            sum += p[j]
        print(sum)
import math

N, K=map(int,input().split())
ansA, ansB = 0, 0
for i in range(N):
    if K/(i+1) <= 1:
        ansA += 1/N
    else:
        x = math.ceil(K/(i+1))
        y = 0.5**math.ceil(math.log2(x))
        ansB += y/N

print(ansA + ansB)

### FIXED CODE ###

import math

N, K=map(int,input().split())
ansA, ansB = 0, 0
for i in range(N):
    if K/(i+1) <= 1:
        ansA += 1/N
    else:
        x = math.ceil(K/(i+1))
        y = 0.5**math.ceil(math.log2(x))
        ansB += y/N

print(ansA + ansB)
l, r = map(int, input().split())
mod = []
for i in range(l, min(r+1,l+2019)):
    mod.append(i % 2019)
mod = sorted(list(mod))
print(mod[0] * mod[1])

### FIXED CODE ###

n, a, b = map(int, input().split())
print(min(n*a, b))
import argparse

parser = argparse.ArgumentParser()

parser.add_argument('input', metavar='a', type=int)

args = parser.parse_args()

a = args.input

print('{0}'.format(a+a*a+a*a*a))

### FIXED CODE ###

a = int(input())
print('{0}'.format(a+a*a+a*a*a))
a,b = map(int, input().split())
c = a*b

if c%2 == 0
	print("Even")
  else
  print("Odd")
         

### FIXED CODE ###

a, b = map(int, input().split())
print("Even" if a*b % 2 == 0 else "Odd")
N, Q = [int(item) for item in input().split()]

tree_list = [input() for _ in range(1,N)]
tree_list_int = [[int(k) for k in i.split()] for i in tree_list]
query_list = [input() for _ in range(Q)]
query_list_int = [[int(k) for k in i.split()]  for i in query_list]

val_list = [0 for _ in range(N)]
node_index = [[] for _ in range(N)]
cumulated_sum_list = [0] * N

# make graph(relation)
for a, b in tree_list_int:
    node_index[a -1].append(b - 1) #親位置に子のindexを追加
    node_index[b -1].append(a - 1)#子位置に親のindexを追加

for index, val in query_list_int:
    val_list[index-1] += val #加算する値を親位置へ記載

def dfs(child_index, pairent_index):
    for child in node_index[child_index]: #とあるノード（再帰していく）の子ノードを線形探索

        if child != pairent_index: #子ノードが親ノードでないとき
            val_list[child] += val_list[child_index] #累積和の計算
            dfs(child, child_index) #再帰する。子にノード子を挿入。今回の子を親に

    return val_list

res = dfs(0, -1) #0はルート、-1は親を持っていない事

for i in res:
    print(i)

### FIXED CODE ###

N, Q = [int(item) for item in input().split()]

tree_list = [input().split() for j in range(1, N)]

query_list = [input().split() for k in range(Q)]
query_list_int = [[int(k) for k in i] for i in query_list]

val_list = [0 for _ in range(N)]

linked_node_list = [[] for _ in range(N)]

for a, b in tree_list:
    a, b = int(a)-1, int(b) -1
    linked_node_list[a].append(b)
    linked_node_list[b].append(a)


for index, val in query_list_int:
    val_list[index-1] += val

stack = [0]
parent = [0] * (N+1)

while True:
    v=stack.pop()
    for child in linked_node_list[v]:
        if child != parent[v]:
            parent[child] = v
            stack.append(child)
            val_list[child] += val_list[v]
    if not stack:
        break

print(*val_list)
a,b,c,d=map(int,input().split()),map(int,input().split())
print("0" if a==c else "1")

### FIXED CODE ###

a,b=map(int,input().split())
c,d=map(int,input().split())
print("0" if a==c else "1")
import math
a, b, c, d = map(int, input().split())
lc = int (c * d / math.gcd(c, d))
def num(x):
    return x - x // c - x // d + x // lc
print(int(num(b) - num(a - 1)))


### FIXED CODE ###

from fractions import gcd
a, b, c, d = map(int, input().split())
lc = int (c * d / gcd(c, d))
def num(x):
    return x - x // c - x // d + x // lc
print(int(num(b) - num(a - 1)))
n,a,b,c,d=map(int,input().split())
s=input()
sb=s[b-1:d]
nb=len(sb)
for i in range(nb-1):
  if sb[i:i+2]=='##':
    print('No')
    exit()
  else:
    s[d-1]='#'
    
sa=s[a-1:c]
na=len(sa)
for i in range(na-1):
  if sa[i:i+2]=='##':
    print('No')
    exit()
  else:
    print('Yes')

### FIXED CODE ###

n,a,b,c,d=map(int,input().split())
s=input()
for i in range(a-1,c-1):
  if s[i:i+2]=='##':
    print('No')
    exit()
for i in range(b-1,d-1):
  if s[i:i+2]=='##':
    print('No')
    exit()
if c<d:
  print('Yes')
else:
  for i in range(b-2,d-1):
    if s[i:i+3]=='...':
      print('Yes')
      exit()
  print('No')
X, K, L = map(int, input().split())
min_dist = inf
for p_num in range(K+1):
    dist = L*p_num + (-1)*L*(K-p_num)
    if dist < min_dist:
        min_dist = dist
print(min_dist)


### FIXED CODE ###

X, K, D = map(int, input().split())

X = abs(X)

n = X // D
m = K - n

A1 = abs(X - n*D)
A2 = abs(X - (n+1)*D)

Ans = A2

if m > 1:
    if A1 <= A2:
        if m % 2 == 0:
            Ans = A1
    else:
        if m % 2 == 0:
            Ans = A1
else:
    Ans = abs(X - K*D)

print(Ans)
N = input()
A = [int(i) for i in input().split()]
count = 0
COUNT = 0
while 1:
  for i in range(N):
    if A[i]%2==0:
      A[i]/=2
      count+=1
  if count == N:
    COUNT+=1
    count=0
  else:
    break
  print(COUNT)

### FIXED CODE ###

N = int(input())
count = 0
COUNT = 0
A = [int(i) for i in input().split()]
while 1:
  for i in range(N):
    if A[i]%2==0:
      A[i]/=2
      count+=1
  if count == N:
    COUNT+=1
    count = 0
  else:
    break
print(COUNT)
n,m = map(int,input().split())
 
c = []
for i in range(m):
    c.append(list(map(int,input().split())))
 
max = 0
for i in range(m):
    if c[i][0] >= max:
        max = c[i][0]
 
ans = -1
if n == 1:
    tmp = 0
    for i in range(m):
        if c[i][1] == c[0][1]:
            tmp += 1
        if tmp == m:
            ans = c[0][1]
else:            
 for i in range(pow(10,max-1),pow(10,n)):
    tmp = 0
    for j in range(m):
        if str(i)[c[j][0]-1] == str(c[j][1]):
            tmp += 1
    if tmp == m:
         ans = i
         break
print(ans)   

### FIXED CODE ###

n,m = map(int,input().split())
 
c = []
for i in range(m):
    c.append(list(map(int,input().split())))
 

ans = -1
if n == 1 and m == 0:
    ans = 0
elif m == 0 and n != 1:
    ans = pow(10,n-1)
elif n == 1:
    tmp = 0
    for i in range(m):
        if c[i][1] == c[0][1]:
            tmp += 1
        if tmp == m:
            ans = c[0][1]
            break
else:            
 for i in range(pow(10,n-1),pow(10,n)):
    tmp = 0
    for j in range(m):
        if str(i)[c[j][0]-1] == str(c[j][1]):
            tmp += 1
    if tmp == m:
         ans = i
         break
print(ans)
# -*- coding: utf-8 -*-
import sys


def input():
    return sys.stdin.readline().strip()


def main(N, DATA):
    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] + DATA[i][k])

    res = 0

    for v in range(3):
        res = max(res, dp[N][v])

    return res


if __name__ == '__main__':
    N = int(input())
    DATA = [map(int, input().split()) for i in range(N)]
    r = main(N, DATA)
    print(r)


### FIXED CODE ###

import sys

input = sys.stdin.readline

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

dp = [[0 for i in range(3)] for j in range(vacation+1)]
def chmax(a, b):
    if a > b:
        return a
    else:
        return b

for i in range(vacation):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i+1][k] = chmax(dp[i+1][k], dp[i][j] + lst_happiness[i][k])
ans = 0
for i in range(3):
    ans = chmax(ans, dp[vacation][i])
print(ans)
if __name__=='__main__':
    N = int(input())
    S = input()
    ans = 'No'
    if N % 2 == 0 and S[0:N/2]==S[N/2:]: ans='Yes'
    print(ans)

### FIXED CODE ###

if __name__=='__main__':
    N = int(input())
    S = input()
    ans = 'No'
    if N % 2 == 0:
        if S[0:int(N/2)]==S[int(N/2):]: ans='Yes'
    print(ans)
def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)
        
def lcm(a,b):
    return a*b/gcd(a,b)

n = int(input())
t = []
for i in range(n):
    t.append(int(input()))

res=1
for i in range(n):
    res = lcm(res,t[i])
    
print(res)

### FIXED CODE ###

n = int(raw_input())

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

def lcm(a,b):
    g = gcd(a,b)
    return a/g * b

x = 1
for i in range(n):
    ti = int(raw_input())
    x = lcm(x, ti)

print x
N = input()

print("Yes" if N.contains("7") else "No")

### FIXED CODE ###

N = input()
print("Yes" if N.__contains__("7") else "No")
= int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

if sum(a) < sum(b):
    print("-1")
    exit()
yobun_sum = []

for i in range(N):
    if a[i] > b[i]:
        yobun_sum.append(a[i]-b[i])

yobun_sum.sort()
yobun_sum.reverse()

yobun_cum_sum=[]
cum_sum=0
for i in yobun_sum:
    cum_sum+=i
    yobun_cum_sum.append(cum_sum)

yobun_ind = 0
lack_num=0
use_first=False

for i in range(N):
    if a[i] < b[i]:
        use_first=True
        lack_num+=1
        lack = abs(a[i] - b[i])
        if yobun_cum_sum[yobun_ind] >= lack: # can pay
            yobun_cum_sum[yobun_ind] -= lack
        else: # can't pay
            yobun_cum_sum[yobun_ind+1] -= lack - yobun_cum_sum[yobun_ind]
            yobun_cum_sum[yobun_ind] =0
            yobun_ind+=1

if use_first:
    yobun_ind+=1

print(yobun_ind+lack_num)

### FIXED CODE ###

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

if sum(a) < sum(b):
    print("-1")
    exit()
yobun_sum = []

for i in range(N):
    if a[i] > b[i]:
        yobun_sum.append(a[i]-b[i])

yobun_sum.sort()
yobun_sum.reverse()
yobun_cum_sum=[]
cum_sum=0
for i in yobun_sum:
    cum_sum+=i
    yobun_cum_sum.append(cum_sum)

lack_num=0
lack_sum=0

for i in range(N):
    if a[i] < b[i]:
        lack_num+=1
        lack = abs(a[i] - b[i])
        lack_sum+=lack

for i in range(len(yobun_cum_sum)):
    if yobun_cum_sum[i] >= lack_sum:
        break

if lack_sum==0:
    print(0)
else:
    print(lack_num+i+1)
str = input()
n = lent(str)
counter = []
max = 0
for i in range(n):
  counter[i] = 0

for i in range(n):
  if str[i] == "A" or "T" or "C" or "G":
    counter[i] ++
  
  
for i in range(n):
  if counter[i] > max:
    max = counter[i]
    
print(max)

### FIXED CODE ###

str = list(input())
n = len(str)
max = 0
counter = [0,0,0]
for i in range(n):
  if 'A' in str[i] or 'T'in str[i] or 'C' in str[i]or 'G'in str[i]:
    counter.insert(i, counter[i] + 1)
  else:
    counter.append(0)
  

con = 0;    
for i in range(n+1):
  if counter[i] == 1:
    con += 1
    continue
  else :
    if con > max :
      max = con
      con = 0
    
print(max)
num1 = int(input())
num2 = int(input())

sum = num1 * num2

if sum % 2 == 0:
    print("Even")
else:
    print("Odd")


### FIXED CODE ###

num = input().split(" ")


sum = int(num[0]) * int(num[1])

if sum % 2 == 0:
    print("Even")
else:
    print("Odd")
N,M = map(int,input().split())
x = [input().split() for i in range(M)]
y = [[] for _ in range(M)]
z = [0 for _ in range(M)]

for i in x:
  y[int(i[0])-1].append(int(i[1])-1)
  y[int(i[1])-1].append(int(i[0])-1)

tmp = y[0]
ans = 0
cnt = 0

while True:
  if cnt != N - 1:
    tmp2 = []
    for l in tmp:
      if z[l] == 0:
        z[l] += 1
        for n in y[l]:
          tmp2.append(n)
    tmp = tmp2
    cnt += 1
  else:
    ans = len(tmp)
    break

print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(M)]

adj = [[] for _ in range(N)]
for a,b in ab:
    adj[a-1].append(b-1)
    adj[b-1].append(a-1)
    

def dfs(x,s,flags):
    vlist = adj[x]
    flags = list(flags)
    flags[x] = False
    flags = tuple(flags)
    if sum(flags) == 0:
        return 1
    s = 0
    for v in vlist:    
        if flags[v]:
            s += dfs(v,s,flags)
    return s        

Flag = [True] * N
Flag[0] = False
ans = dfs(0,0,tuple(Flag))
print(ans)
a=int(input())
b=[input() for i in range(a)]
c=[AC,WA,TLE,RE]
for value in c:
  e=b.count(value)
print("{0}x{1}".format(value.e)  
  
  


### FIXED CODE ###

N = int(input())
s = [input() for i in range(N)]
for v in ['AC', 'WA', 'TLE', 'RE']:
  print('{0} x {1}'.format(v, s.count(v)))
s = list(set((input())))

s.sort()

for i in range(26):
    if s[i] != chr(i + ord('a')):
        print(chr(i + ord('a')))
        exit()
else:
    print('None')

### FIXED CODE ###

s = list(set((input())))

s.sort()

for i in range(26):
    if i >= len(s) or s[i] != chr(i + ord('a')):
        print(chr(i + ord('a')))
        exit()
else:
    print('None')
import sys, os, re
from pprint import pprint
from math import sin, cos, sqrt, radians

n, m = list(map(int, sys.stdin.readline().strip().split()))
g = [[] for x in range(n)]

for i in range(n):
    x, y = list(map(int, sys.stdin.readline().strip().split()))
    x -= 1
    y -= 1
    g[x].append(y)
    g[y].append(x)

ans = {0: -1}

while len(ans) < n:
    flag = False
    for k, v in ans.items():
        for node in g[k]:
            if node not in ans:
                ans[node] = k
                flag = True
    if flag == False:
        break

print("Yes")
for i in range(1, n):
    print(ans[i]+1)



### FIXED CODE ###


import sys, os, re
from pprint import pprint
from math import sin, cos, sqrt, radians

n, m = list(map(int, sys.stdin.readline().strip().split()))
g = [[] for x in range(n)]

for i in range(m):
    x, y = map(int, sys.stdin.readline().strip().split())
    x -= 1
    y -= 1
    g[x].append(y)
    g[y].append(x)

if [] in g:
    print("No")
    exit(0)

ans = {0: -1}
tmp = [0]

while len(ans) < n:
    tmp_next = []
    for k in tmp:
        for node in g[k]:
            if node not in ans:
                ans[node] = k
                tmp_next.append(node) 
                flag = True

        tmp = tmp_next
        if flag == False:
            break

    """
    flag = False    
    for k, v in list(ans.items()):
        for node in g[k]:
            if node not in ans:
                ans[node] = k
                flag = True
    if flag == False:
        break
    """

print("Yes")
for i in range(1, n):
    print(ans[i]+1)
from fractions import gcd

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re


ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



def main():
    n,k,q = mi()
    alist = [0 for i in range(100005)]
    for i in range(q):
        a = ii()
        alist[a]+=1
	for i in range(1,n+1):
        if alist[i] > q-k:
            print('Yes')
        else:
            print('No')
    


main()


### FIXED CODE ###

#gcdは3.4.3だとfractionsにある
from fractions import gcd

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re


ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



def main():
    n,k,q = mi()
    alist = [0 for i in range(100005)]
    for i in range(q):
        a = ii()
        alist[a]+=1
    
    for i in range(1,n+1):
        if alist[i] > q-k:
            print('Yes')
        else:
            print('No')
    


main()
#4
N = int(input())
x,y,k = 0,0,0

x = int(0.8*N)

for i in range(x,N):
    k = int(i*108)
    if k[0:-2] == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")


### FIXED CODE ###

#4
import sys
N = int(input())
x,y,k = 0,0,0

if N == 1:
    print(1)
    sys.exit()
elif N <= 12:
    print(N)
    sys.exit()
x = int(0.8*N)

for i in range(x,N):
    k = str(i*108)
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())
A = [0]*N
B = [0]*N
i = 0
for line in readlines():
    A[i], B[i] = map(int, line.rstrip().decode('utf-8').split())
    i+=1
sA = sorted(A)
sB = sorted(B)
if N % 2 == 0:
    ans = ((sB[(N//2)-1]+sB[(N//2)]) - (sA[(N//2)-1]+sA[(N//2)])) + 1
else:
    ans = (sB[(N-1)//2]-sA[(N-1)//2]) + 1
print(ans)


### FIXED CODE ###

N = int(input())
A = [0]*N
B = [0]*N
i = 0
for i in range(N):
    A[i], B[i] = map(int, input().split())
sA = sorted(A)
sB = sorted(B)
if N % 2 == 0:
    ans = ((sB[(N//2)-1]+sB[(N//2)]) - (sA[(N//2)-1]+sA[(N//2)])) + 1
else:
    ans = (sB[(N-1)//2]-sA[(N-1)//2]) + 1
print(ans)
x,a,b = map(int, input().split())
if b-a < 1:
    print("delicious")
elif b-a = 1:
    print("safe")
else:
    print("dangerous")

### FIXED CODE ###

x,a,b = map(int, input().split())
if b-a < 1:
    print("delicious")
elif b-a < x + 1:
    print("safe")
else:
    print("dangerous")
S = input()
T = input()
x = 0

for i in range(3):
  if S[i] == T[i]
  	x = x +1
  else:
  	x = x

print(x)



### FIXED CODE ###

S = input()
T = input()
x = 0
 
for i in range(3):
  if S[i] == T[i]:
  	x = x + 1
  else:
  	x = x
print(x)
A, B, C = map(int, input().split())

Number=0
count =0

for i in range (1000):
    MAX=max(A,B,C)
    Number=0
    if MAX==A:
        Number=Number+1
    if MAX==B:
        Number=Number+1
    if MAX==C:
        Number=Number+1

    if Number ==1:
        MAX=max(A,B,C)
        if MAX!=A:
            A=A+1
        if MAX!=B:
            B=B+1
        if MAX!=C:
            C=C+1
        count=count +1
        Number=0

    if Number ==2:
        MAX=max(A,B,C)
        if MAX!=A:
            A=A+2
        if MAX!=B:
            B=B+2
        if MAX!=C:
            C=C+2
        count=count +1
        Number=0
    
    if Number ==3:
        print('%d'%(count))
        break


### FIXED CODE ###

S = input()

S1='abc'
S2='acb'
S3='bac'
S4='bca'
S5='cab'
S6='cba'
if S==S1:
    print ('Yes')
elif S==S2:
    print ('Yes')
elif S==S3:
    print ('Yes')
elif S==S4:
    print ('Yes')
elif S==S5:
    print ('Yes')
elif S==S6:
    print ('Yes')
else:
    print ('No')
import sys
sys.setrecursionlimit(10**9)

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

Map = [[] for _ in range(M)]
reached = [False]*N

for _ in range(M):
    aa, bb = map(int, input().split())
    Map[aa-1].append(bb-1)
    Map[bb-1].append(aa-1)

cnt = 0

def DFS(x):
    global cnt
    global reached

    reached[x] = True

    if all(reached):
        cnt += 1
        reached[x] = False

        return

    for i in Map[x]:
        if reached[i]:
            continue

        else:
            DFS(i)

    reached[x] = False


DFS(0)
print(cnt)


### FIXED CODE ###

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

Map = [[] for _ in range(N)]
reached = [False]*N

for _ in range(M):
    aa, bb = map(int, input().split())
    Map[aa-1].append(bb-1)
    Map[bb-1].append(aa-1)

cnt = 0

def DFS(x):
    global cnt
    global reached

    reached[x] = True

    if all(reached):
        cnt += 1
        reached[x] = False

        return

    for i in Map[x]:
        if reached[i]:
            continue

        else:
            DFS(i)

    reached[x] = False


DFS(0)
print(cnt)
(n,_),*t=[t.split()for t in open(0)]
n=int(n)
for i in range(10**(n-1-(n<2)),10**n):
  i=str(i)
  for s,c in t:
    if i[int(s)-1]!=c:
      break
  else:
    print(i)
    break
else:
  print(-1)

### FIXED CODE ###

(n,_),*t=[t.split()for t in open(0)]
n=int(n)
for i in range(10**(n-1)-(n<2),10**n):
  i=str(i)
  for s,c in t:
    if i[int(s)-1]!=c:
      break
  else:
    print(i)
    break
else:
  print(-1)
n,m,k = map(int,input().split())
f = [[] for _ in range(n)]
g = [[] for _ in range(n)]
for _ in range(m):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    f[a].append(b)
    f[b].append(a)
for _ in range(k):
    c,d = map(int,input().split())
    c,d = c-1,d-1
    g[c].append(d)
    g[d].append(c)
d = {}
parent = [-1]*n
seen = [False]*n
from collections import deque
for i in range(n):
    if seen[i]: continue
    stack = deque()
    d[i] = set([i])
    stack = [i]
    while stack:
        v = stack.pop()
        seen[v] = True
        parent[v]=i
        for nv in f[v]:
            if seen[nv]: continue
            d[i].add(nv)
            stack.append(nv)
ans = [0]*n
for i in range(n):
    group = d[parent[i]]
    sum = len(d[i]) -len(f[i]) - len(set(g[i])&group) -1
    ans[i]=sum
print(*ans)

### FIXED CODE ###

n,m,k = map(int,input().split())
f = [[] for _ in range(n)]
g = [[] for _ in range(n)]
for _ in range(m):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    f[a].append(b)
    f[b].append(a)
for _ in range(k):
    c,d = map(int,input().split())
    c,d = c-1,d-1
    g[c].append(d)
    g[d].append(c)
d = {}
parent = [-1]*n
seen = [False]*n
from collections import deque
for i in range(n):
    if seen[i]: continue
    stack = deque()
    d[i] = set([i])
    stack = [i]
    while stack:
        v = stack.pop()
        parent[v] = i #同じ連結成分をまとめる
        seen[v] = True
        for nv in f[v]:
            if seen[nv]: continue
            d[i].add(nv)
            stack.append(nv)
ans = [0]*n
for i in range(n):
    group = d[parent[i]]
    #連結成分-直接の友達関係-ブロックしてるけど連結成分にいる人-自分
    sum = len(group)-len(f[i])-len(set(g[i])&group) -1
    ans[i] = sum
print(*ans)
import numpy as np
a=np.array([[0]*10]*12)
n=int(input())
for i in range(n):
    b,f,r,v=map(int,input().split())
    a[ 3*b-4+f, r-1 ] = v
for i in range(12):
    if i > 0 and i%3==0:
        print('#'*20)
    print(' ', end='')
    print(*a[i,])

### FIXED CODE ###

towers = [
    [[0 for i in range(10)] for j in range(3)] for k in range(4)
]
floor = 3
 
n = int(input())
for i in range(n):
    b,f,r,v = list(map(int,input().split()))
    towers[b-1][f-1][r-1] += v
 
for b in towers:
    for f in b:
        for r in f:
            print(' ' + str(r), end='')
        print('')
    if floor:
        print('#'*20)
        floor -= 1
nml = input().split()
n, m, l = map(int, nml)

A = [[int(i) for i in input().split()] for j in range(n)]
B = [[int(i) for i in input().split()] for j in range(m)]

C = [[0 for i in range(l)] for j in range(n)]

for j in range(n):
    for i in range(l):
        s = 0
        for k in range(m):
            s += A[i][k]*B[k][j]
        C[i][j] = s

for i in C:
    print(' '.join(map(str, i)))

### FIXED CODE ###

nml = input().split()
n, m, l = map(int, nml)

A = [[int(i) for i in input().split()] for j in range(n)]
B = [[int(i) for i in input().split()] for j in range(m)]

C = [[0 for i in range(l)] for j in range(n)]

for j in range(n):
    for i in range(l):
        s = 0
        for k in range(m):
            s += A[j][k]*B[k][i]
        C[j][i] = s

for i in C:
    print(' '.join(map(str, i)))