You are creating a level for a video game. The level consists of $n$ rooms placed in a circle. The rooms are numbered $1$ through $n$. Each room contains exactly one exit: completing the $j$-th room allows you to go the $(j+1)$-th room (and completing the $n$-th room allows you to go the $1$-st room).

You are given the description of the multiset of $n$ chests: the $i$-th chest has treasure value $c_i$.

Each chest can be of one of two types:   regular chest — when a player enters a room with this chest, he grabs the treasure and proceeds to the next room;  mimic chest — when a player enters a room with this chest, the chest eats him alive, and he loses. 

The player starts in a random room with each room having an equal probability of being chosen. The players earnings is equal to the total value of treasure chests he'd collected before he lost.

You are allowed to choose the order the chests go into the rooms. For each $k$ from $1$ to $n$ place the chests into the rooms in such a way that:

  each room contains exactly one chest;  exactly $k$ chests are mimics;  the expected value of players earnings is minimum possible. 

Please note that for each $k$ the placement is chosen independently.

It can be shown that it is in the form of $\frac{P}{Q}$ where $P$ and $Q$ are non-negative integers and $Q \ne 0$. Report the values of $P \cdot Q^{-1} \pmod {998244353}$.


-----Input-----

The first contains a single integer $n$ ($2 \le n \le 3 \cdot 10^5$) — the number of rooms and the number of chests.

The second line contains $n$ integers $c_1, c_2, \dots, c_n$ ($1 \le c_i \le 10^6$) — the treasure values of each chest.


-----Output-----

Print $n$ integers — the $k$ -th value should be equal to the minimum possible expected value of players earnings if the chests are placed into the rooms in some order and exactly $k$ of the chests are mimics.

It can be shown that it is in the form of $\frac{P}{Q}$ where $P$ and $Q$ are non-negative integers and $Q \ne 0$. Report the values of $P \cdot Q^{-1} \pmod {998244353}$.


-----Examples-----
Input
2
1 2

Output
499122177 0 

Input
8
10 4 3 6 5 10 7 5

Output
499122193 249561095 249561092 873463811 499122178 124780545 623902721 0 



-----Note-----

In the first example the exact values of minimum expected values are: $\frac 1 2$, $\frac 0 2$.

In the second example the exact values of minimum expected values are: $\frac{132} 8$, $\frac{54} 8$, $\frac{30} 8$, $\frac{17} 8$, $\frac{12} 8$, $\frac 7 8$, $\frac 3 8$, $\frac 0 8$.

Difficulty: MEDIUM

Starter code:

Solutions:
def add(a, b):
	return (a + b) % mod

def mult(a, b):
	tmp = a % mod * (b % mod)
	return tmp % mod
n = int(input())
c = [int(i) for i in input().split()]
c.sort(reverse=True)
pref = [0] * (n + 1)
pref[0] = 0
for i in range(1, n + 1):
	pref[i] = pref[i - 1] + c[i - 1]
mod = 998244353
invn = pow(n, mod - 2, mod)
for k in range(1, n + 1):
	ans = 0
	j = 0
	for i in range(0, n + 1, k):
		ans = add(ans, mult(j, add(pref[min(n, i + k)], -pref[i])))
		j += 1
	ans = mult(ans, invn)
	print(ans, end=' ')


from itertools import accumulate

def readline():
	return map(int, input().split())
MOD = 998244353

def sum_mod(a, b):
	return (a + b) % MOD

def main():
	n = int(input())
	c = sorted(readline())
	assert len(c) == n
	psums = list(accumulate(c, sum_mod))
	psums.insert(0, 0)
	assert len(psums) == n + 1
	inv_n = pow(n, MOD - 2, MOD)
	for k in range(1, n + 1):
		p = 0
		for t in range(n % k, n, k):
			p = (p + psums[t]) % MOD
		p *= inv_n
		print(p % MOD, end=' ')
	print()
main()


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def solve():
	cs = [aa[0]]
	for a in aa[1:]:
		cs.append((cs[-1] + a) % md)
	inv = pow(n, md - 2, md)
	ans = []
	for k in range(1, n):
		cur = 0
		for i in range(1, n):
			if n - 1 - k * i < 0:
				break
			cur = (cur + cs[n - 1 - k * i]) % md
		cur = cur * inv % md
		ans.append(cur)
	ans.append(0)
	print(*ans)
md = 998244353
n = II()
aa = LI()
aa.sort()
solve()


from sys import stdin
input = stdin.buffer.readline

def inv(x):
	return pow(x, mod - 2, mod)
mod = 998244353
n = int(input())
a = sorted(map(int, input().split()), reverse=True)
p = [0] * (n + 1)
p[0] = a[0]
for i in range(1, n):
	p[i] = p[i - 1] + a[i]
for k in range(1, n + 1):
	ans = 0
	i = 0
	while i + k <= n:
		ans = (ans + (p[i + k - 1] - p[i - 1]) * (i // k)) % mod
		i += k
	ans = (ans + (p[n - 1] - p[i - 1]) * (i // k)) % mod
	ans = ans * inv(n)
	print(ans % mod)


n = int(input())
c = sorted(list(map(int, input().split())))
mod = 998244353
inv = pow(n, mod - 2, mod)
imos = [c[i] for i in range(n)]
res = [0] * n
for i in range(1, n):
	imos[i] += imos[i - 1]
for i in range(1, n + 1):
	temp = 0
	L = n - i
	R = n - 1
	count = 0
	while True:
		temp += count * (imos[R] - imos[L - 1] * (L >= 1))
		count += 1
		if L == 0:
			break
		else:
			R -= i
			L = max(0, L - i)
	res[i - 1] = temp * inv % mod
print(*res)


from sys import stdin

def inverse(a, mod):
	return pow(a, mod - 2, mod)
n = int(stdin.readline())
c = list(map(int, stdin.readline().split()))
mod = 998244353
c.sort()
d = [0]
for i in range(n):
	d.append(d[-1] + c[i])
inv = inverse(n, mod)
ans = []
for k in range(1, n + 1):
	now = 0
	ni = n - k
	cnt = 1
	while ni > k:
		now += cnt * (d[ni] - d[ni - k])
		cnt += 1
		ni -= k
	now += cnt * d[ni]
	ans.append(now * inv % mod)
print(*ans)