#include <bits/stdc++.h>
using namespace std;
mt19937 gene(233);
inline char GET_CHAR() {
  const int maxn = 131072;
  static char buf[maxn], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, maxn, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int getInt() {
  int res(0);
  char c = getchar();
  while (c < '0') c = getchar();
  while (c >= '0') {
    res = res * 10 + (c - '0');
    c = getchar();
  }
  return res;
}
inline long long fastpo(long long x, long long n, long long mod) {
  long long res(1);
  while (n) {
    if (n & 1) {
      res = res * (long long)x % mod;
    }
    x = x * (long long)x % mod;
    n /= 2;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline string itoa(int x, int width = 0) {
  string res;
  if (x == 0) res.push_back('0');
  while (x) {
    res.push_back('0' + x % 10);
    x /= 10;
  }
  while ((int)res.size() < width) res.push_back('0');
  reverse(res.begin(), res.end());
  return res;
}
const int _B = 131072;
char buf[_B];
int _bl = 0;
inline void flush() {
  fwrite(buf, 1, _bl, stdout);
  _bl = 0;
}
__inline void _putchar(char c) {
  if (_bl == _B) flush();
  buf[_bl++] = c;
}
inline void print(long long x, char c) {
  static char tmp[20];
  int l = 0;
  if (!x)
    tmp[l++] = '0';
  else {
    while (x) {
      tmp[l++] = x % 10 + '0';
      x /= 10;
    }
  }
  for (int i = l - 1; i >= 0; i--) _putchar(tmp[i]);
  _putchar(c);
}
struct P {
  double x, y;
};
const int N = 300033;
const int LOG = 20;
const int mod = 998244353;
const int inf = 1e9 + 7;
int n, m;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int a[N];
long long s[N];
void add(int p, int delta) {
  for (int x = p; x <= n; x += x & -x) s[x] += delta;
}
long long getsum(int p) {
  long long res = 0;
  for (int x = p; x; x -= x & -x) res += s[x];
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) add(i, a[i]);
  int inv = fastpo(n, mod - 2, mod);
  for (int k = 1; k <= n; k++) {
    int rmn = n - k;
    long long res = 0;
    long long mx = (rmn + k - 1) / k;
    for (int i = 1;; i++) {
      if (i * k <= rmn) {
        res =
            (res + (getsum(rmn - i * k + k) - getsum(rmn - i * k)) % mod * i) %
            mod;
      } else {
        res = (res + (getsum(rmn - i * k + k)) % mod * i) % mod;
        break;
      }
    }
    cout << res * inv % mod;
    if (k == n)
      cout << endl;
    else
      cout << ' ';
  }
}

### Prompt

Create a solution in cpp for the following problem:

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 P/Q where P and Q are non-negative integers and Q ≠ 0. Report the values of P ⋅ Q^{-1} \pmod {998244353}.

Input

The first contains a single integer n (2 ≤ n ≤ 3 ⋅ 10^5) — the number of rooms and the number of chests.

The second line contains n integers c_1, c_2, ..., c_n (1 ≤ c_i ≤ 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 P/Q where P and Q are non-negative integers and Q ≠ 0. Report the values of P ⋅ 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.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
mt19937 gene(233);
inline char GET_CHAR() {
  const int maxn = 131072;
  static char buf[maxn], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, maxn, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int getInt() {
  int res(0);
  char c = getchar();
  while (c < '0') c = getchar();
  while (c >= '0') {
    res = res * 10 + (c - '0');
    c = getchar();
  }
  return res;
}
inline long long fastpo(long long x, long long n, long long mod) {
  long long res(1);
  while (n) {
    if (n & 1) {
      res = res * (long long)x % mod;
    }
    x = x * (long long)x % mod;
    n /= 2;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline string itoa(int x, int width = 0) {
  string res;
  if (x == 0) res.push_back('0');
  while (x) {
    res.push_back('0' + x % 10);
    x /= 10;
  }
  while ((int)res.size() < width) res.push_back('0');
  reverse(res.begin(), res.end());
  return res;
}
const int _B = 131072;
char buf[_B];
int _bl = 0;
inline void flush() {
  fwrite(buf, 1, _bl, stdout);
  _bl = 0;
}
__inline void _putchar(char c) {
  if (_bl == _B) flush();
  buf[_bl++] = c;
}
inline void print(long long x, char c) {
  static char tmp[20];
  int l = 0;
  if (!x)
    tmp[l++] = '0';
  else {
    while (x) {
      tmp[l++] = x % 10 + '0';
      x /= 10;
    }
  }
  for (int i = l - 1; i >= 0; i--) _putchar(tmp[i]);
  _putchar(c);
}
struct P {
  double x, y;
};
const int N = 300033;
const int LOG = 20;
const int mod = 998244353;
const int inf = 1e9 + 7;
int n, m;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int a[N];
long long s[N];
void add(int p, int delta) {
  for (int x = p; x <= n; x += x & -x) s[x] += delta;
}
long long getsum(int p) {
  long long res = 0;
  for (int x = p; x; x -= x & -x) res += s[x];
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) add(i, a[i]);
  int inv = fastpo(n, mod - 2, mod);
  for (int k = 1; k <= n; k++) {
    int rmn = n - k;
    long long res = 0;
    long long mx = (rmn + k - 1) / k;
    for (int i = 1;; i++) {
      if (i * k <= rmn) {
        res =
            (res + (getsum(rmn - i * k + k) - getsum(rmn - i * k)) % mod * i) %
            mod;
      } else {
        res = (res + (getsum(rmn - i * k + k)) % mod * i) % mod;
        break;
      }
    }
    cout << res * inv % mod;
    if (k == n)
      cout << endl;
    else
      cout << ' ';
  }
}

```