#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
mt19937_64 rnd64(
    chrono::high_resolution_clock::now().time_since_epoch().count());
long long power(long long a, long long m, long long mod) {
  long long ans = 1;
  while (m) {
    if (m % 2) {
      ans *= a;
      ans %= (mod);
    }
    a = (a * a) % (mod);
    m >>= 1;
  }
  return ans;
}
void init(long long* a, long long n, long long val) {
  for (long long i = 0; i < n; i++) a[i] = val;
}
void solve() {
  long long i, j, _, n;
  cin >> n;
  long long a[n], pre[n];
  for (i = 0; i < n; i++) cin >> a[i];
  vector<long long> ans;
  sort(a, a + n);
  j = 0;
  for (i = 0; i < n; i++) cin >> j, j += a[i], j %= 998244353, pre[i] = j;
  for (i = 1; i < n; i++) {
    long long k = 0;
    for (j = n - i - 1; j > -1; j -= i) k += pre[j], k %= 998244353;
    ans.push_back(k);
  }
  ans.push_back(0);
  n = power(n, 998244353 - 2, 998244353);
  for (auto& i : ans) i *= n, i %= 998244353, cout << i << " ";
  cout << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
