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

X, Y, Z, K = input().split()
X = int(X)
Y = int(Y)
Z = int(Z)
K = int(K)
A = [int(a) for a in input().split()]
A = sorted(A, reverse=True)
B = [int(b) for b in input().split()]
B = sorted(B, reverse=True)
C = [int(c) for c in input().split()]
C = sorted(C, reverse=True)
ABC = []
AK, BK, CK = K, K, K
if len(A) <= K:
    AK = len(A)
if len(B) <= K:
    BK = len(B)
if len(C) <= K:
    CK = len(C)
for i in range(AK):
    for j in range(BK):
        for k in range(CK):
            ABC.append(A[i] + B[j] + C[k])
ABC_sort = sorted(ABC, reverse=True)
for x in range(K):
    print(ABC_sort[x])

### FIXED CODE ###

X, Y, Z, K = [int(x) for x in input().split()]
A = [int(a) for a in input().split()]
B = [int(b) for b in input().split()]
C = [int(c) for c in input().split()]
A = sorted(A, reverse=True)
B = sorted(B, reverse=True)
C = sorted(C, reverse=True)
ABC = []
for a in range(len(A)):
    if a+1 > K:
        break
    for b in range(len(B)):
        if b+1 > K:
            break
        elif (a+1)*(b+1) > K:
            break
        for c in range(len(C)):
            if c+1 > K:
                break
            elif (a+1)*(c+1) > K:
                break
            elif (b+1)*(c+1) > K:
                break
            elif (a+1)*(b+1)*(c+1) > K:
                break
            ABC.append(A[a] + B[b] + C[c])
ABC = sorted(ABC, reverse=True)
for i in range(K):
    print(ABC[i])
### BUGGY CODE ###

R, G, B, N = map(int, input().split())
mr, mg, mb = N//R, N//G, N//B

ans = 0
for r in range(mr+1):
    for g in range(mg+1):
        val = N - r*R - g*G
        if val >= 0 and val % B == 0:
            ans += 1
print(ans)

### FIXED CODE ###

R, G, B, N = map(int, input().split())
mr, mg, mb = N//R, N//G, N//B

ans = 0
for r in range(mr+1):
    for g in range(mg+1):
        val = N - r*R - g*G
        if val >= 0 and val % B == 0:
            ans += 1
print(ans)
### BUGGY CODE ###

s = input()
pre = [1]+[0]*12
n = 10**9 + 7
tem = [[i*j%13 for i in range(10)] for j in range(13)]
for i in range(len(s)):
    t = 10**i % 13
    if s[-1*i-1] > "9":
        pre = [sum([pre[k-i] for i in tem[t]])%n for k in range(13)]      
    else:
        te = int(s[-1*i-1])*t % 13
        pre = [pre[i-te] for i in range(13)]
print(pre[5])

### FIXED CODE ###

s = input()
pre = [1]+[0]*12
n = 10**9 + 7
tem = [[i*j%13 for i in range(10)] for j in range(13)]
t = 1
for i in range(len(s)):
    if s[-1*i-1] > "9":
        pre = [sum([pre[k-i] for i in tem[t]])%n for k in range(13)]      
    else:
        te = int(s[-1*i-1])*t % 13
        pre = [pre[i-te] for i in range(13)]
    t = t*10 % 13
print(pre[5])
### BUGGY CODE ###

class UnionFindVerSize():
  def __init__(self, N):
    self._parent = [n for n in range(0, N)]
    self._size = [1] * N
  def find_root(self, x):
    if self._parent[x] == x: 
      return x
    self._parent[x] = self.find_root(self._parent[x]) 
    return self._parent[x]
  def unite(self, x, y):
    gx = self.find_root(x)
    gy = self.find_root(y)
    if gx == gy:
      return
    if self._size[gx] < self._size[gy]:
      self._parent[gx] = gy
      self._size[gy] += self._size[gx]
    else:
      self._parent[gy] = gx
      self._size[gx] += self._size[gy]
  def is_same_group(self, x, y):
    return self.find_root(x) == self.find_root(y)
n,m,k = map(int,input().split())
f = [0 for _ in range(n+1)]
uf = UnionFindVerSize(n+1)
for i in range(m):
  ai,bi = map(int,input().split())
  uf.unite(ai,bi)
  f[ai] += 1
  f[bi] += 1
l = [[] for _ in range(n+1)]
for i in range(k):
  ci,di = map(int,input().split())
  l[ci].append(di)
  l[di].append(ci)
d = [-1 for i in range(n+1)]
for i in range(1,n+1):
  bf = 0
  for x in l[i]:
    if uf.is_same_group(i,x):
      bf += 1
  if d[i] != -1:
    print(d[i]-bf-f[i],end=" ")
    continue
  ff = []
  for j in range(i+1,n+1):
    if uf.is_same_group(i,j):
      ff.append(j)
  ll = len(ff)
  for y in ff:
    d[y] = ll
  print(ll-bf-f[i],end=" ")
      
    
  


  
  

### FIXED CODE ###

class UnionFindVerSize():
  def __init__(self, N):
    self._parent = [n for n in range(0, N)]
    self._size = [1] * N
  def find_root(self, x):
    if self._parent[x] == x: 
      return x
    self._parent[x] = self.find_root(self._parent[x]) 
    return self._parent[x]
  def unite(self, x, y):
    gx = self.find_root(x)
    gy = self.find_root(y)
    if gx == gy:
      return
    if self._size[gx] < self._size[gy]:
      self._parent[gx] = gy
      self._size[gy] += self._size[gx]
    else:
      self._parent[gy] = gx
      self._size[gx] += self._size[gy]
  def get_size(self, x):
    return self._size[self.find_root(x)]
  def is_same_group(self, x, y):
    return self.find_root(x) == self.find_root(y)
n,m,k = map(int,input().split())
f = [0 for _ in range(n+1)]
uf = UnionFindVerSize(n+1)
for i in range(m):
  ai,bi = map(int,input().split())
  uf.unite(ai,bi)
  f[ai] += 1
  f[bi] += 1
l = [[] for _ in range(n+1)]
for i in range(k):
  ci,di = map(int,input().split())
  l[ci].append(di)
  l[di].append(ci)
for i in range(1,n+1):
  bf = 0
  for x in l[i]:
    if uf.is_same_group(i,x):
      bf += 1
  print(uf.get_size(i)-bf-f[i]-1,end=" ")
### BUGGY CODE ###

def main():
    n = int(input())
    original_n = n
    primes = []

    factor = 2
    while True:
        if n == 1:
            break

        if n % factor == 0:
            n //= factor
            primes.append(factor)
            continue
        else:
            factor += 1

    print("{}: {}".format(
        original_n,
        " ".join(list(map(str, primes)))
    ))



main()



### FIXED CODE ###

import math

def make_divisors(n):
    divisors = []
    for k in range(2, math.floor(math.sqrt(n))+1):
        if n % k == 0:
            divisors.append(k)
            divisors.append(n // k)

    divisors.append(n)

    return sorted(divisors)

def main():
    n = int(input())
    original_n = n

    factors = []
    divisors = make_divisors(n)

    i = 0
    while True:
        if n == 1:
            break

        if n % divisors[i] == 0:
            n //= divisors[i]
            factors.append(divisors[i])
        else:
            i += 1

    print("{}: {}".format(
        original_n,
        " ".join(list(map(str, factors)))
    ))

main()
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, K: int, x: "List[int]", y: "List[int]"):
    sx = sorted(x)
    sy = sorted(y)
    acc = [[0]*N for _ in range(N)]

    for i, x1 in enumerate(sx):
        for j, y1 in enumerate(sy):
            acc[i][j] = sum([True for xx, yy in zip(x, y)
                             if xx <= x1 and yy <= y1])

    m = INF

    for i, x1 in enumerate(sx):
        for j, y1 in enumerate(sy):
            # 始点を固定
            for x2 in sx[i+1:]:
                for y2 in sy[j+1:]:
                    # 終点を固定
                    counter = 0
                    for xx, yy in zip(x, y):
                        if (x1 <= xx <= x2) and (y1 <= yy <= y2):
                            counter += 1
                    if counter >= K:
                        flag = True
                        area = abs((y2-y1)*(x2-x1))
                        if area < m:
                            m = area
                        break   # これ以上yをあげたところで面積は増える一方なので抜ける
    print(m)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]"
    y = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, K, x, y)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, K: int, x: "List[int]", y: "List[int]"):
    sx = sorted(x)
    sy = sorted(y)
    acc = [[0]*N for _ in range(N)]

    for i, x1 in enumerate(sx):
        for j, y1 in enumerate(sy):
            acc[i][j] = sum([True for xx, yy in zip(x, y)
                             if xx <= x1 and yy <= y1])

    m = INF

    for i, x1 in enumerate(sx[:-K+1]):
        for j, y1 in enumerate(sy[:-K+1]):
            # 始点を固定
            for x2 in sx[i+1:]:
                for y2 in sy[j+1:]:
                    # 終点を固定
                    counter = 0
                    for xx, yy in zip(x, y):
                        if (x1 <= xx <= x2) and (y1 <= yy <= y2):
                            counter += 1
                    if counter >= K:
                        flag = True
                        area = abs((y2-y1)*(x2-x1))
                        if area < m:
                            m = area
                        break   # これ以上yをあげたところで面積は増える一方なので抜ける
    print(m)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]"
    y = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, K, x, y)


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

import itertools
n,k = map(int,input().split())
ary = [list(map(int,input().split())) for _ in range(n)]
ary = list(itertools.combinations(ary,k))
ans = float("Inf")
for i in range(len(ary)):
    a = []
    for j in enumerate(zip(*ary[i])):
        a.append([min(j[1]),max(j[1])])
    if ans > (a[0][1] - a[0][0]) * (a[1][1] - a[1][0]):
        ans = (a[0][1] - a[0][0]) * (a[1][1] - a[1][0])
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
ary = [list(map(int,input().split())) for _ in range(n)]
ary.sort()

ans = float("Inf")
for i in range(n-k+1):
    for j in range(k,n-i+1):
        xmin = ary[i][0]
        xmax = ary[i+j-1][0]
        ary_y = sorted(ary[i:i+j], key=lambda x: (x[1]))
        for l in range(len(ary_y)-k+1):
            ymin = ary_y[l][1]
            ymax = ary_y[l+k-1][1]
            ans = min(ans,(xmax - xmin) * (ymax - ymin))
print(ans)
### BUGGY CODE ###

n=int(input())
a=[2**66+int(i) for i in input().split()]
ans=0
for i in range(64):
    x,y=0,0
    for j in a:
        if bin(j)[-i-1]=='1':
            y+=1
        else:
            x+=1
    ans+=x*y*(1<<i)
    ans%=10**9+7
print(ans)

### FIXED CODE ###

n=int(input())
a=[int(i) for i in input().split()]
ans=0
for i in range(64):
    x,y=0,0
    for j in a:
        if j>>i&1:
            y+=1
        else:
            x+=1
    ans+=x*y*(1<<i)
    ans%=10**9+7
print(ans)
### BUGGY CODE ###

n,m,q=map(int,input().split())
Q=[list(map(int,input().split())) for i in range(q)]
ans=0
#めっちゃfor分あるならdfs
def dfs(d,s):
    global n,m,Q,ans
    if d==n-1:
        ans_=0
        for k in Q:
            a,b,c,d=k
            if int(s[b-1])-int(s[a-1])==c:
                ans_+=d
        ans=max(ans,ans_)
    else:
        l=int(s[-1])
        [dfs(d+1,s+str(i)) for i in range(l,m+1)]
for i in range(1,m+1):
    dfs(0,str(i))

print(ans)

### FIXED CODE ###

n,m,q=map(int,input().split())
Q=[list(map(int,input().split())) for i in range(q)]
ans=0
#めっちゃfor分あるならdfs
R=[range(i,m) for i in range(m)]
def dfs(d,s):
    global n,m,Q,ans
    if d==n:
        ans_=0
        for k in Q:
            a,b,c,e=k
            if int(s[b-1])-int(s[a-1])==c:
                ans_+=e
        ans=max(ans,ans_)
    else:
        l=int(s[-1])
        for i in R[l]:
            dfs(d+1,s+str(i))
for i in R[0]:
    dfs(1,str(i))

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

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

cnt = 0
for i in range(N):
  for j in range(i+1):
    if i > 1 and p[i] > p[i-1]:
      break
    elif p[i] > p[j]:
      break
    elif i == j:
      cnt += 1

print(cnt)


### FIXED CODE ###

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

cnt = 0
for n in p:
  if n == p[0]:
    cnt += 1
    min = n
  elif min >= n:
    cnt += 1
    min = n
print(cnt)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    for j in range(i+1, n):
        if a[i] == a[j]:
             print("NO")
             exit()
print("YES")

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = False
for i in range(len(a)-1):
    if a[i] == a[i+1]:
        flag = True
        break
if flag:
    print("NO")
else:
    print("YES")
### BUGGY CODE ###

import sys
sys.setrecursionlimit(2000000)
def input():
    return sys.stdin.readline()[:-1]
n=int(input())
ab=[list(map(int,input().split())) for i in range(n-1)]
ki=[[] for i in range(n+1)]
for i in range(n-1):
    ki[ab[i][0]].append(ab[i][1])
    ki[ab[i][1]].append(ab[i][0])
# print(ki)
kyori=[[0,0] for i in range(n+1)]
def tansaku(m, dis, hito):
    if not ki[m]:
        kyori[m][hito]=dis
        return
    elif kyori[m][hito]!=0:
        return
    else:
        kyori[m][hito]=dis
        for i in range(len(ki[m])):
            tansaku(ki[m][i], dis+1, hito)
tansaku(1,1,0)
tansaku(n,1,1)
fe,su=0,0

for i in range(1,n+1):
    if kyori[i][0]<=kyori[i][1]:
        fe+=1
    else:
        su+=1

if fe>su:
    print("Fennec")
else:
    print("Snuke")

### FIXED CODE ###

import sys
sys.setrecursionlimit(2000000)
def input():
    return sys.stdin.readline()[:-1]
n=int(input())
ab=[list(map(int,input().split())) for i in range(n-1)]
ki=[[] for i in range(n+1)]
for i in range(n-1):
    ki[ab[i][0]].append(ab[i][1])
    ki[ab[i][1]].append(ab[i][0])
# print(ki)
kyori=[[float("INF"), float("INF")] for i in range(n+1)]
def tansaku(m, dis, hito):
    q=[[m,dis]]
    while q:
        po=q.pop()
        for i in ki[po[0]]:
            if kyori[i][hito]>po[1]:
                kyori[i][hito]=po[1]
                q.append([i,po[1]+1])

tansaku(1,1,0)
tansaku(n,1,1)
fe,su=0,0

for i in range(1,n+1):
    if kyori[i][0]<=kyori[i][1]:
        fe+=1
    else:
        su+=1

if fe>su:
    print("Fennec")
else:
    print("Snuke")
### BUGGY CODE ###

from sys import setrecursionlimit
setrecursionlimit(100000)
def rad_reach(b,h,dist,E,rad):
	cnt = 1
	if dist < rad:
		for nxt in E[h]:
			if nxt == b:
				continue
			cnt += rad_reach(h,nxt,dist+1,E,rad) 
	return cnt
def solve():
	N,K = map(int,raw_input().split())
	pairs = []
	E = [[] for i in xrange(N)]
	for i in xrange(N-1):
		a,b = map(lambda x:int(x)-1,raw_input().split())
		E[a].append(b)
		E[b].append(a)
		pairs.append((a,b))
	ans = N
	rad = K/2
	if K % 2 == 0:
		for c in xrange(N):
			ans = min(ans,N-rad_reach(-1,c,0,E,rad))
	else:
		for c1,c2 in pairs:
			ans = min(ans,N-rad_reach(c2,c1,0,E,rad)-rad_reach(c1,c2,0,E,rad))
	print ans
solve()

### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(1000000)
def calc_dist(b,h,dist,E,D,ne):
	D[dist] += 1
	for nxt in E[h]:
		if nxt == b or nxt == ne:
			continue
		calc_dist(h,nxt,dist+1,E,D,ne) 

def solve():
	N,K = map(int,raw_input().split())
	pairs = []
	E = [[] for i in xrange(N)]
	for i in xrange(N-1):
		a,b = map(lambda x:int(x)-1,raw_input().split())
		E[a].append(b)
		E[b].append(a)
		pairs.append((a,b))
	ans = N
	rad = K/2
	if K % 2 == 0:
		for i in xrange(N):
			D = [0]*N
			calc_dist(-1,i,0,E,D,-1)
			for j in xrange(rad):
				D[rad-j-1] += D[rad-j]
			ans = min(N-D[0],ans)
	else:
		for a,b in pairs:
			D1 = [0]*N
			D2 = [0]*N
			calc_dist(-1,a,0,E,D1,b)
			calc_dist(-1,b,0,E,D2,a)
			for j in xrange(rad):
				D1[rad-j-1] += D1[rad-j]
				D2[rad-j-1] += D2[rad-j]
			ans = min(N-D1[0]-D2[0],ans)
	print ans

solve()
### BUGGY CODE ###

#coding: utf-8
from collections import deque
N, M = map(int, input().split())
graph = {i:[] for i in range(1, N+1)}
for i in range(M):
    u, v = map(int, input().split())
    graph[u].append(v)
    # graph[v].append(u)
S, T = map(int, input().split())
queue = deque([[graph[S][i], 0] for i in range(len(graph[S]))])
cnt = 0
visited = [False for _ in range(N)]
while queue:
    # print(len(queue))
    now = queue.popleft()
    # print(now)
    now[1] += 1
    # if visited[now[0]-1]:
    #     continue
    if now[1] >= 10**6:
        break
    if now[1] % 3 == 0:
        # print("visited", now[0])
        visited[now[0]-1] = True
        if now[0] == T:
            print(now[1] // 3)
            exit()
        for i in range(len(graph[now[0]])):
            queue.append([graph[now[0]][i], now[1]])
    else:
        for i in range(len(graph[now[0]])):
            queue.append([graph[now[0]][i], now[1]])
print(-1)



### FIXED CODE ###

from sys import stdin
from collections import deque
def main():
    #入力
    readline=stdin.readline
    n,m=map(int,readline().split())
    G=[[] for _ in range(n*3)]
    for i in range(m):
        a,b=map(lambda x:int(x)-1,readline().split())
        for j in range(3):
            G[3*a+j].append(3*b+(j+1)%3)

    s,t=map(lambda x:int(x)-1,readline().split())
    s*=3
    t*=3
    #bfs
    d=deque([s])
    flags=[-1]*(3*n)
    flags[s]=0
    while len(d)>0:
        now=d.popleft()
        for nex in G[now]:
            if flags[nex]==-1:
                flags[nex]=flags[now]+1
                d.append(nex)

    print(flags[t]//3)

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

import queue

# match of  a vs b
def match(a, b):
    """
    :type a: int
    :type b: int
    :rtype: int
    """
    return min(a,b) + N * max(a,b)

N = int(input())
A = []
for i in range(N):
    A.append( [ int(n)-1 for n in input().split() ] )

# NEXT[ match(a,b) ]  must be held after  match(a,b)
NEXT = [ [] for i in range(N*N) ]
# How many matches must be held before  match(a,b)
before = [ 0 for i in range(N*N) ]

for i in range(N):
    for j in range(N-2):
        # i vs A[i][j+1]  must be held after  i vs A[i][j]
        NEXT[ match(i,A[i][j]) ].append(match(i,A[i][j+1]))
        before[match(i,A[i][j+1])] += 1
        
q  = queue.Queue()
q0 = queue.Queue()

for i in range(N):
    for j in range(i+1,N):
        if before[match(i,j)] == 0:
            q.put(match(i,j))
            
day = 0

while True:
    day += 1
    while not q.empty():
        M = q.get()
        for m in NEXT[M]:
            before[m] -= 1
            if before[m] == 0:
                q0.put(m)
        NEXT[M] = []
    while not q0.empty():
        M = q0.get()
        q.put(M)
    #print(NEXT)
    #print(before)
    if q.empty():
        break

if NEXT == [ [] for i in range(N*N) ]:
    print(day)
else:
    print(-1)


### FIXED CODE ###

# match of  a vs b
def match(a, b):
    """
    :type a: int
    :type b: int
    :rtype: int
    """
    return min(a,b) + N * max(a,b)

N = int(input())
A = []
for i in range(N):
    A.append( [ int(n)-1 for n in input().split() ] )

# NEXT[ match(a,b) ]  must be held after  match(a,b)
NEXT = [ [] for i in range(N*N) ]
# How many matches must be held before  match(a,b)
before = [ 0 for i in range(N*N) ]

for i in range(N):
    for j in range(N-2):
        # i vs A[i][j+1]  must be held after  i vs A[i][j]
        NEXT[ match(i,A[i][j]) ].append( match(i,A[i][j+1]) )
        before[ match(i,A[i][j+1]) ] += 1
        
q  = []
q0 = []

for i in range(N):
    for j in range(i+1,N):
        if before[ match(i,j) ] == 0:
            q.append( match(i,j) )
            
day = 0

while True:
    day += 1
    for M in q:
        for m in NEXT[M]:
            before[m] -= 1
            if before[m] == 0:
                q0.append(m)
        NEXT[M] = []
    q = q0
    q0 = []
    #print(NEXT)
    #print(before)
    if q == []:
        break

if NEXT == [ [] for i in range(N*N) ]:
    print(day)
else:
    print(-1)
### BUGGY CODE ###

from fractions import Fraction
import sys
input = sys.stdin.readline
def powmod(x, n,mod):
  if n == 0:
   return 1
  K = 1
  while n > 1:
   if n % 2 != 0:
    K = K * x%mod
    x = x ** 2%mod
    n = (n - 1) // 2
   else:
    x = x ** 2%mod
    n = n // 2%mod

  return K * x # 指数を割り続け n が 1 に至ったら終了
N=int(input())
mod=10**9+7
dic={}
c=0
d=0
e=0
for i in range(N):
 A,B = map(int,input().split())
 if A==0 and B==0:
  e+=1
 elif A==0:
  c+=1
 elif B==0:
  d+=1
 else:
   x=Fraction(A,B)
   if x in dic:
    dic[x]+=1
   else:
    dic[x]=1
ans=1
for k in dic:
 if  -1/k in dic:
  ans*=(powmod(2,dic[k],mod)+powmod(2,dic[-1/k],mod) -1)
  ans%=mod
  dic[k]=0
  dic[-1/k]=0
 else:
  ans*=powmod(2,dic[k],mod)
  ans%=mod
ans*=(powmod(2,c,mod)+powmod(2,d,mod)-1)
print((ans-1+e)%mod)

### FIXED CODE ###

from collections import defaultdict
from math import gcd
import sys
input = sys.stdin.readline
N=int(input())
mod=10**9+7
dic=defaultdict(lambda: [0,0])
c=0
d=0
e=0
for i in [0]*N:
 A,B = map(int,input().split())
 if A==0 and B==0:
  e+=1
 elif A==0:
  c+=1
 elif B==0:
  d+=1
 else:
  g=gcd(A,B)
  A//=g
  B//=g
  if A*B>0:
   dic[(abs(A),abs(B))][0]+=1
  else:
   dic[(abs(B),abs(A))][1]+=1
ans=1
for k in dic:
 ans=ans*(pow(2,dic[k][0],mod)+pow(2,dic[k][1],mod) -1)
ans=ans*(pow(2,c,mod)+pow(2,d,mod)-1)
print((ans-1+e)%mod)
### BUGGY CODE ###

n = int(input())
a = sorted([int(input()) for _ in range(n)], reverse=True)
suma = sum(a)
mod = 998244353

dp1 = [3] + [0] * (suma // 2)
dp2 = [3] + [0] * (suma // 2)
for ai in a:
    for j in range(suma // 2, -1, -1):
        dp1[j] = (dp1[j] + (dp1[j - ai]  * 2 if j >= ai else 0)) % mod
        dp2[j] = (dp2[j] + (dp2[j - ai]      if j >= ai else 0)) % mod
half = dp2[suma // 2] if suma % 2 == 0 else 0
print(((3 ** n) - sum(dp1) + half + mod) % mod)


### FIXED CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]
suma = sum(a)
suma2 = suma // 2
mod = 998244353

dp1 = [3] + [0] * suma2
dp2 = [3] + [0] * suma2
for ai in a:
    for j in range(suma2, ai - 1, -1):
        dp1[j] = (dp1[j] + dp1[j - ai] * 2) % mod
        dp2[j] = (dp2[j] + dp2[j - ai]    ) % mod
half = dp2[suma2] if suma % 2 == 0 else 0
print(((3 ** n) - sum(dp1) + half + mod) % mod)
### BUGGY CODE ###

n = int(input())
a= list(map(int, input().split()))
for i in range(n):
     print(a.count(i+1))


### FIXED CODE ###

n = int(input())
a= list(map(int, input().split()))
aa=[0]*n
for i in range(n-1):
     aa[a[i]-1]+=1
for i in range(n):
     print(aa[i])