Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N = int(input())
for n in range(1, N + 1):
    ans = 0
    for x in range(1, int(pow(n, 0.5))):
        for y in range(1, int(pow(n - x ** 2, 0.5))):
            for z in range(1, int(pow(n - x ** 2 - y ** 2, 0.5))):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == n:
                    ans += 1
    print(ans)

### FIXED CODE ###

N = int(input())
A = [0] * 10001
for x in range(1, int(pow(N, 0.5))):
    for y in range(1, int(pow(N, 0.5))):
        for z in range(1, int(pow(N, 0.5))):
            value = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if value > 10000:
                break
            A[value] += 1
for a in A[1:N+1]:
    print(a)
### BUGGY CODE ###

import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    n, k = nm()
    a = nl()
    b = [0]*n
    for _ in range(k):
        for i in range(n):
            if i > a[i]:
                b[i-a[i]] += 1
            else:
                b[0] += 1
            if i + a[i] + 1 < n:
                b[i + a[i] + 1] -= 1
        for i in range(n-1):
            b[i+1] += b[i]
            a[i] = 0
        a[-1] = 0
        b, a = a, b
        if min(a) >= n:
            break
    print(*a)
    return

solve()


### FIXED CODE ###

import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    n, k = nm()
    if k > 45:
        k = 45
    a = nl()
    b = [0]*n
    for _ in range(k):
        for i in range(n):
            b[max(0, i - a[i])] += 1
            if i + a[i] + 1 < n:
                b[i + a[i] + 1] -= 1
        for i in range(n-1):
            b[i+1] += b[i]
            a[i] = 0
        a[-1] = 0
        b, a = a, b
    print(*a)
    return

solve()
### BUGGY CODE ###

def get_input():
    X, Y, Z, K = [int(_) for _ in raw_input().split()]
    A = [int(_) for _ in raw_input().split()]
    B = [int(_) for _ in raw_input().split()]
    C = [int(_) for _ in raw_input().split()]
    return X, Y, Z, K, A, B, C

def solve():
    X, Y, Z, K, A, B, C = get_input()
    A = MergeSort(A)[:K]
    B = MergeSort(B)[:K]
    C = MergeSort(C)[:K]
    lB = len(B)
    lC = len(C)
    sumAB = []
    for i in range(lB):
        tmpA = [ele + B[i] for ele in A]
        sumAB = MergeArray(sumAB, tmpA)[:K]
    sumABC = []
    for i in range(lC):
        tmpAB = [ele + C[i] for ele in sumAB]
        sumABC = MergeArray(sumABC, tmpAB)[:K]
    for i in range(K):
        print sumABC[i]

def solve2():
    X, Y, Z, K, A, B, C = get_input()
    A.sort(reverse = True)
    B.sort(reverse = True)
    C.sort(reverse = True)
    sumABC = []
    for i in range(X):
        for j in range(Y):
            for k in range(Z):
                if (i + 1) * (j + 1) * (k + 1) <= K:
                    sumABC.append(A[i] + B[j] + C[k])
    sumABC.sort(reverse = True)
    for i in range(K):
        print sumABC[i]

if __name__ == '__main__':
    solve2()


### FIXED CODE ###

def MergeSort(arr):
    if len(arr) <= 1:
        return arr
    mid = len(arr) // 2
    left = arr[:mid]
    right = arr[mid:]
    left = MergeSort(left)
    right = MergeSort(right)
    return MergeArray(left, right)

def MergeArray(left, right):
    merged = []
    li, ri = 0, 0
    while li < len(left) and ri < len(right):
        if left[li] > right[ri]:
            merged.append(left[li])
            li += 1
        else:
            merged.append(right[ri])
            ri += 1
    if li < len(left):
        merged.extend(left[li:])
    elif ri < len(right):
        merged.extend(right[ri:])
    return merged

def solve():
    X, Y, Z, K = [int(_) for _ in raw_input().split()]
    A = [int(_) for _ in raw_input().split()]
    B = [int(_) for _ in raw_input().split()]
    C = [int(_) for _ in raw_input().split()]
    A = MergeSort(A)[:K]
    B = MergeSort(B)[:K]
    C = MergeSort(C)[:K]
    lB = len(B)
    lC = len(C)
    sumAB = []
    for i in range(lB):
        tmpA = [ele + B[i] for ele in A]
        sumAB = MergeArray(sumAB, tmpA)[:K]
    sumABC = []
    for i in range(lC):
        tmpAB = [ele + C[i] for ele in sumAB]
        sumABC = MergeArray(sumABC, tmpAB)[:K]
    for i in range(K):
        print sumABC[i]

if __name__ == '__main__':
    solve()
### BUGGY CODE ###

# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N = inp()

A = inlist()
m = 0
for i in range(N):
    c = 0
    for j in range(i, N-1):
        if A[j] >= A[j+1]:
            c += 1
        else:
            break
    if c > m:
        m = c
print(m)


### FIXED CODE ###

# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N = inp()

A = inlist()
move = 0
m = 0
current = A[0]
for i in range(1, N):

    if A[i] <= current:
        m += 1
    else:
        m = 0
    if move < m:
        move = m
    # print(current, A[i], m, move)
    current = A[i]


print(move)
### BUGGY CODE ###

import sys
input=sys.stdin.readline

n=int(input())
s=input()
dp=[[[False for k in range(1000)] for j in range(4)] for i in range(n+1)]

dp[0][0][0]=True

for i in range(n):
    for j in range(4):
        for k in range(1000):
            if dp[i][j][k]==False:continue
            dp[i+1][j][k]=True
            if j<=2:
                dp[i+1][j+1][k*10+int(s[i])]=True
cnt=0
for i in range(1000):
    if dp[n][3][i]==1:cnt+=1
print(cnt)

### FIXED CODE ###

n=int(input())
s=list(map(int,list(input())))
ans=0
for i in range(10):
    try:
        ss=s[s.index(i)+1:]
        for j in range(10):
            try:
                sss=ss[ss.index(j)+1:]
                for k in range(10):
                    if k in sss:ans+=1
            except:pass
    except:pass

print(ans)
### BUGGY CODE ###

N = int(input())
S = input().strip()

M = [[0] * 3 for _ in range(N+1)]

for i in range(N-1, -1, -1):
    for j in range(3):
        M[i][j] = M[i+1][j]
    if S[i] == "R":
        M[i][0] += 1
    elif S[i] == "G":
        M[i][1] += 1
    else:
        M[i][2] += 1

ans = 0

T = "RGB"


for i in range(N-2):
    for j in range(i+1, N-1):
        m = [0, 0, 0]
        if S[i] == "R":
            m[0] += 1
        elif S[i] == "G":
            m[1] += 1
        else:
            m[2] += 1

        k = j + (j-i)
        if S[j] == "R":
            if m[0] == 0:
                m[0] += 1
                idx = m.index(0)
                ans += M[j+1][idx]
                if k < N and S[k] == T[idx]:
                    ans -= 1
            else:
                continue
        elif S[j] == "G":
            if m[1] == 0:
                m[1] += 1
                idx = m.index(0)
                ans += M[j+1][idx]
                if k < N and S[k] == T[idx]:
                    ans -= 1
            else:
                continue
        else:
            if m[2] == 0:
                m[2] += 1
                idx = m.index(0)
                ans += M[j+1][idx]
                if k < N and S[k] == T[idx]:
                    ans -= 1
            else:
                continue

print(ans)


### FIXED CODE ###

N = int(input())
S = input().strip()

M = [[0] * 3 for _ in range(N+1)]

for i in range(N-1, -1, -1):
    for j in range(3):
        M[i][j] = M[i+1][j]
    if S[i] == "R":
        M[i][0] += 1
    elif S[i] == "G":
        M[i][1] += 1
    else:
        M[i][2] += 1

ans = 0

T = "RGB"


for i in range(N-2):
    for j in range(i+1, N-1):
        m = [0, 0, 0]
        if S[i] == "R":
            m[0] += 1
        elif S[i] == "G":
            m[1] += 1
        else:
            m[2] += 1

        k = j + (j-i)
        if S[j] == "R":
            if m[0] == 0:
                m[0] += 1
                idx = m.index(0)
                ans += M[j+1][idx]
                if k < N and S[k] == T[idx]:
                    ans -= 1
            else:
                continue
        elif S[j] == "G":
            if m[1] == 0:
                m[1] += 1
                idx = m.index(0)
                ans += M[j+1][idx]
                if k < N and S[k] == T[idx]:
                    ans -= 1
            else:
                continue
        else:
            if m[2] == 0:
                m[2] += 1
                idx = m.index(0)
                ans += M[j+1][idx]
                if k < N and S[k] == T[idx]:
                    ans -= 1
            else:
                continue

print(ans)
### BUGGY CODE ###

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

D = []

for i in range(N-1):
  D.append(int(max(A[i:N+1])-A[i]))

M = max(D)
result = D.count(M)

print(result)

### FIXED CODE ###

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

B = []
Amin = A[0]

for i in range(1, N):
  if A[i] < Amin:
    Amin = A[i]
  else:
    B.append(A[i] - Amin)

result = B.count(max(B))
print(result)
### BUGGY CODE ###

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

for i in range(N):
        print(A.index(i+1) + 1, end=' ')

### FIXED CODE ###

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

B = [0 for i in range(N)]

for i in range(N):
  B[A[i] - 1] = i + 1
 
print(' '.join(map(str, B)))
### BUGGY CODE ###

S = input()
Q = int(input())
QUERY = [input().split() for _ in range(Q)]

rev = False

for query in QUERY:
    # 反転の操作
    if query[0] == '1':
        if rev:
            rev = False
        else:
            rev = True
    else:
        # 先頭に追加する場合
        if query[1] == '1':
            # 反転しているとき
            if rev:
                # 末尾に追加
                S = S + query[2]
            # 反転していないとき
            else:
                # 先頭に追加
                S = query[2] + S
        # 末尾に追加する場合
        else:
            # 反転しているとき
            if rev:
                # 先頭に追加
                S = query[2] + S
            # 反転していないとき
            else:
                # 末尾に追加
                S = S + query[2]
if rev:
    print(S[::-1])
else:
    print(S)

### FIXED CODE ###

S = input()
Q = int(input())
Query = [input().split() for _ in range(Q)]

rev = False
S1 = ''
S2 = ''

for TFC in Query:
    if TFC[0] == '1':
        rev = not rev
    else:
        if TFC[1] == '1':
            if rev:
                S2 += TFC[2]
            else:
                S1 = TFC[2] + S1
        else:
            if rev:
                S1 = TFC[2] + S1
            else:
                S2 += TFC[2]

if rev:
    print(S2[::-1] + S[::-1] + S1[::-1])
else:
    print(S1 + S + S2)
### BUGGY CODE ###

n, k = map(int, input().split())
h = []
for i in range(n):
    h.append(int(input()))
h.sort()
ans = 1e11
for i in range(0, n-k+1):
    maxh = max(h[i:i+k])
    minh = min(h[i:i+k])
    if ans > maxh - minh:
        ans = maxh - minh
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
h = []
for i in range(n):
    h.append(int(input()))
h.sort(reverse = True)
ans = 10000000000
maxh = h[:k]
maxn = 0
for i in range(k, n):
    if ans > maxh[maxn] - maxh[(maxn-1)%k]:
        ans = maxh[maxn] - maxh[(maxn-1)%k]
    maxh[maxn] = h[i]
    maxn = (maxn+1) % k
if ans > maxh[maxn] - maxh[(maxn-1)%k]:
    ans = maxh[maxn] - maxh[(maxn-1)%k]
print(ans)
### BUGGY CODE ###

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

ans = 0
for i in range(10 ** 8):
  print(A * i // B - A * (i // B))
  ans = max(ans, A * i // B - A * (i // B))

for i in range(10 ** 8):
  i = N - i
  if i < 0:
    break
  ans = max(ans, A * i // B - A * (i // B))

print(ans)

### FIXED CODE ###

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

def solve(i):
  return A * i // B - A * (i // B)

print(solve(min(B-1, N)))
### BUGGY CODE ###

import math
n = int(input())
a = [int(i) for i in input().split()]

a.sort()
b = []
c = 0
r = []
for i, v in enumerate(a):
    flag = True
    for j in range(1, int(math.sqrt(v))+1):
        if v % j == 0 and (j in b or v/j in b):
            flag = False
            break
    if flag == True:
        b.append(v)
        if i+1 >= len(a):
            c += 1
        elif a[i+1] != v:
            c += 1
print(c)

### FIXED CODE ###

import math
n = int(input())
a = [int(i) for i in input().split()]

a.sort()
b = [0 for _ in range(a[-1])]
c = 0
for i in a:
    x = i-1
    while len(b) > x:
        b[x] += 1
        x += i 
for i in a:
    if b[i-1] == 1:
        c += 1
print(c)
### BUGGY CODE ###

n=int(input())
wordlist=[input() for i in range(n)]
count=0
for i in range(n-1):
    for j in range(i+1,n):
        a=list(wordlist[i])
        b=list(wordlist[j])
        a.sort()
        b.sort()
        if a==b:
            count+=1
print(count)

### FIXED CODE ###

n=int(input())

#単語が全て入ったリストを作るO(n)
wordlist=[input() for i in range(n)]

#wordlistを一つ一つソートさせたものをsortlistとして作るO（n）
sortlist=[]
for i in range(n):
    a=list(wordlist[i])
    a.sort()
    sortlist.append(a)
    
count=0

#ソートリストをソートするO(nlogn)
sortlist.sort()

checkword=""
check=0

for i in range(n): #O(n)
    a=sortlist.pop()
    if checkword==a:
            check+=1
            count+=check
    else:
        check=0
        checkword=a
    
print(int(count) )
### BUGGY CODE ###

letters = list(input())
n = int(input())
for i in range(0,n):
    command = list(input().split())
    if command[0] == "1":
        letters.reverse()
    
    else:
        if command[1] == "2":
            letters.append(command[2])
        else:
            letters.insert(0, command[2])


ans = "".join(letters)
print(ans)

### FIXED CODE ###

from collections import deque

letters = deque(input())
n = int(input())

top = "head"

for i in range(0,n):
    command = list(input().split())
    if command[0] == "1":
        if top == "head":
            top = "tail"
        else:
            top = "head"
        
    
    else:
        if (command[1] == "2" and top == "head") or (command[1] == "1" and top == "tail"):
            letters.append(command[2])
        else:
            letters.appendleft(command[2])

if top == "tail":
    letters.reverse()
    
 
ans = "".join(letters)
print(ans)
### BUGGY CODE ###

from collections import deque


class Room:
    def __init__(self, prev=-1, dist=1 << 64):
        self.prev = prev
        self.dist = dist


n, m = map(int, input().split())
passages = [set() for _ in range(n)]
for _ in range(m):
    a, b = map(lambda x: int(x) - 1, input().split())
    passages[a].add(b)
    passages[b].add(a)

cave = [Room() for _ in range(n)]
cave[0].dist = 0

opening = deque({0})
while opening:
    curr_room = opening.pop()
    next_dist = cave[curr_room].dist + 1
    for next_room in passages[curr_room]:
        if next_dist < cave[next_room].dist:
            cave[next_room].prev = curr_room
            cave[next_room].dist = next_dist
            opening.append(next_room)

guide_points = [cave[i].prev + 1 for i in range(1, n)]

print('Yes')
print('\n'.join(map(str, guide_points)))


### FIXED CODE ###

class Room:
    def __init__(self, prev=-1, dist=1 << 64):
        self.prev = prev
        self.dist = dist


n, m = map(int, input().split())
passages = [set() for _ in range(n)]
for _ in range(m):
    a, b = map(lambda x: int(x) - 1, input().split())
    passages[a].add(b)
    passages[b].add(a)

opening = {0}
closing = {0}
guide_points = [-1] * n
while opening:
    next_opening = set()

    for curr_room in opening:
        for next_room in passages[curr_room]:
            if next_room in closing:
                continue

            guide_points[next_room] = curr_room
            next_opening.add(next_room)
            closing.add(next_room)

    opening = next_opening

print('Yes')
print('\n'.join(map(lambda x: str(x + 1), guide_points[1:])))
### BUGGY CODE ###

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

ma = max(a)
tmp = 1
m = ma.bit_length()

memo = [0 for i in range(m+1)]

for j in range(m+1):
    cnt0 = 0
    cnt1 = 0
    for ai in a:
        if ai & (1 << j):
            cnt1 += 1
        else:
            cnt0 += 1
    if cnt1 % 2 == 0 and cnt0 % 2 == 0:
        memo[j] = 1

ans = []


for ai in a:
    ansi = 0
    for j in range(m+1):
        if ai & (1 << j):
            if memo[j]:
                ansi += 2 ** j
        else:
            if memo[j] == 0:
                ansi += 2 ** j

    ans.append(str(ansi))

print(" ".join(ans))



### FIXED CODE ###

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

ma = max(a)
tmp = 1
m = 0
while True:
    if tmp >= ma:
        break
    tmp *= 2
    m += 1

memo = [0 for i in range(m+1)]

for j in range(m+1):
    cnt0 = 0
    cnt1 = 0
    for ai in a:
        if ai & (1 << j):
            cnt1 += 1
        else:
            cnt0 += 1
    if cnt1 % 2 == 0 and cnt0 % 2 == 0:
        memo[j] = 1

ans = []


for ai in a:
    ansi = 0
    for j in range(m+1):
        if ai & (1 << j):
            if memo[j]:
                ansi += 2 ** j
        else:
            if memo[j] == 0:
                ansi += 2 ** j

    ans.append(str(ansi))

print(" ".join(ans))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

s = input().rstrip()
q = int(input())

flag = False
for i in range(q):
    qq = input().rstrip().split()
    if qq[0] == '1':
        flag = not(flag)
    else:
        if flag:
            if qq[1] == '1':
                s = s + qq[2]
            else:
                s = qq[2] + s
        else:
            if qq[1] == '1':
                s = qq[2] + s
            else:
                s = s + qq[2]

if flag:
    print(s[::-1])
else:
    print(s)


### FIXED CODE ###

import sys
from collections import deque

sys.setrecursionlimit(10**7)
input = sys.stdin.readline

s = input().rstrip()
q = int(input())
d = deque()
d.append(s)

flag = False
for i in range(q):
    qq = input().split()
    if qq[0] == '1':
        flag = not(flag)
    else:
        if flag:
            if qq[1] == '1':
                d.append(qq[2])
            else:
                d.appendleft(qq[2])
        else:
            if qq[1] == '1':
                d.appendleft(qq[2])
            else:
                d.append(qq[2])

ans = ''.join(list(d))
if flag:
    print(ans[::-1])
else:
    print(ans)
### BUGGY CODE ###

import math 
[K, S] = list(map(int, input().split()))
count = 0
total = 0
for X in range(K+1):
  if X > S:
    break
  for Y in range(K+1):
    sub = X + Y
    if sub > S:
      break
    for Z in range(K+1):
      total = X + Y + Z 
      if total == S:
        count += 1
      if total > S:
        break
      if total < S/2:
        Z += math.floor(S/2)
            
print(count)

### FIXED CODE ###

[K, S] = list(map(int, input().split()))
count = 0
for X in range(K+1):
  for Y in range(K+1):
    Z = S - X - Y
    if 0 <= Z and Z <= K:
      count +=1

print(count)
### BUGGY CODE ###

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

    distance_list = []
    for i in range(1, n):
        for j in range(i+1, n+1):
            distance_list.append(min(j-i, abs(i-x)+abs(j-y)+1))

    for i in range(1, n):
        print(distance_list.count(i))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    import collections

    n, x, y = map(int, input().split())

    distance_list = []
    for i in range(1, n):
        for j in range(i+1, n+1):
            distance_list.append(min(j-i, abs(i-x)+abs(j-y)+1))

    distance_count = collections.Counter(distance_list)
    for i in range(1, n):
        print(distance_count[i])


if __name__ == '__main__':
    main()
### BUGGY CODE ###

n,q,*t=map(int,open(0).read().split())
for v,w in zip(t[::2],t[1::2]):
  while n>1and v!=w:
    v,w=sorted((v,w))
    w=(w+n-2)//n
  print(v)

### FIXED CODE ###

n,q,*t=map(int,open(0).read().split())
for v,w in zip(t[::2],t[1::2]):
  if n<2:
    print(min(v,w))
    continue
  s,t=set(),set()
  while v:
    s|={v}
    v=(v+n-2)//n
  while w:
    t|={w}
    w=(w+n-2)//n
  print(max(s&t))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
N = int(input())
A = [int(i) for i in input().split()]
count0 = [0 for i in range(60)]
count1 = [0 for i in range(60)]
for a in A:
    a_tmp = bin(a).replace("0b","")
    a_tmp = a_tmp.zfill(60)
    for i,b in enumerate(a_tmp):
        if b == "1":
            count1[i] += 1
        else:
            count0[i] += 1
cnt = 0
ans = 0
for c0,c1 in zip(count0[::-1],count1[::-1]):
    ans += c0*c1*(2**cnt)
    cnt += 1
print(ans%(10**9+7))


### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
A = [int(i) for i in input().split()]
count0 = [0 for i in range(60)]
count1 = [0 for i in range(60)]
for a in A:
    a_tmp = bin(a).replace("0b","")
    a_tmp = a_tmp.zfill(60)
    for i,b in enumerate(a_tmp):
        if b == "1":
            count1[i] += 1
        else:
            count0[i] += 1
cnt = 0
ans = 0
for c0,c1 in zip(count0[::-1],count1[::-1]):
    ans += c0*c1*(2**cnt)
    cnt += 1
print(ans%(10**9+7))
### BUGGY CODE ###

n=int(input())
p=input().split()
flag=0
oldflag=2*10**5+1
ans=0
for i in range(1,(n+1)):
    idx=p.index(str(i))
    flag=idx
    ans+=1
    if oldflag<idx:
        ans-=1
        flag=oldflag
        continue
    oldflag=flag
print(ans)


### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))
flag=2*10**5+1
ans=0
for i in range(n):
    if flag>int(p[i]):
        ans+=1
    flag=min(flag,p[i])
print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 7)

N, M, K = map(int, input().split())
edges = [set() for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].add(b)
    edges[b].add(a)

block_edges = [set() for _ in range(N)]
for _ in range(K):
    c, d = map(int, input().split())
    c -= 1
    d -= 1
    block_edges[c].add(d)
    block_edges[d].add(c)

visited = [False] * N
cnt = 0

def dfs(u, s):
    if visited[u]:
        return

    visited[u] = True
    for v in edges[u]:
        if visited[v]:
            continue
        if v == s:
            continue

        if v not in block_edges[s] and v not in edges[s]:
            global  cnt
            cnt += 1

        dfs(v, s)


ans = []
for i in range(N):
    visited = [False] * N
    cnt = 0
    for v in edges[i]:
        dfs(v, i)
    ans.append(cnt)
print(*ans)

### FIXED CODE ###

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

    def find(self, x):
        if self.d[x] < 0:
            return x
        self.d[x] = self.find(self.d[x])
        return self.d[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.d[x] > self.d[y]:
            x, y = y, x
        self.d[x] += self.d[y]
        self.d[y] = x
        return True

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return -self.d[self.find(x)]


N, M, K = map(int, input().split())
NMAX = 100005
deg = [0] * NMAX
to = [[] for _ in range(NMAX)]
uf = UnionFind(N)
for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    deg[a] += 1
    deg[b] += 1
    uf.unite(a, b)
for i in range(K):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)
anss = []
for i in range(N):
    ans = uf.size(i) - 1 - deg[i]
    for u in to[i]:
        if uf.same(i, u):
            ans -= 1
    anss.append(ans)
print(" ".join(map(str, anss)))