#include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;

template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }

#ifdef NEAL_DEBUG
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
#include <cassert>
#include <iostream>
using namespace std;

namespace IO {
    const int BUFFER_SIZE = 1 << 15;

    char input_buffer[BUFFER_SIZE];
    size_t input_pos = 0, input_len = 0;

    char output_buffer[BUFFER_SIZE];
    int output_pos = 0;

    char number_buffer[100];
    uint8_t lookup[100];

    void _update_input_buffer() {
        input_len = fread(input_buffer, sizeof(char), BUFFER_SIZE, stdin);
        input_pos = 0;

        if (input_len == 0)
            input_buffer[0] = EOF;
    }

    inline char next_char(bool advance = true) {
        if (input_pos >= input_len)
            _update_input_buffer();

        return input_buffer[advance ? input_pos++ : input_pos];
    }

    template<typename T>
    inline void read_int(T &number) {
        bool negative = false;
        number = 0;

        while (!isdigit(next_char(false)))
            if (next_char() == '-')
                negative = true;

        do {
            number = 10 * number + (next_char() - '0');
        } while (isdigit(next_char(false)));

        if (negative)
            number = -number;
    }

    template<typename T, typename... Args>
    inline void read_int(T &number, Args &... args) {
        read_int(number);
        read_int(args...);
    }

    void _flush_output() {
        fwrite(output_buffer, sizeof(char), output_pos, stdout);
        output_pos = 0;
    }

    inline void write_char(char c) {
        if (output_pos == BUFFER_SIZE)
            _flush_output();

        output_buffer[output_pos++] = c;
    }

    template<typename T>
    inline void write_int(T number, char after = '\0') {
        if (number < 0) {
            write_char('-');
            number = -number;
        }

        int length = 0;

        while (number >= 10) {
            uint8_t lookup_value = lookup[number % 100];
            number /= 100;
            number_buffer[length++] = char((lookup_value & 15) + '0');
            number_buffer[length++] = char((lookup_value >> 4) + '0');
        }

        if (number != 0 || length == 0)
            write_char(char(number + '0'));

        for (int i = length - 1; i >= 0; i--)
            write_char(number_buffer[i]);

        if (after)
            write_char(after);
    }

    void init() {
        // Make sure _flush_output() is called at the end of the program.
        bool exit_success = atexit(_flush_output) == 0;
        assert(exit_success);

        for (int i = 0; i < 100; i++)
            lookup[i] = uint8_t((i / 10 << 4) + i % 10);
    }
}

template<const int &MOD>
struct _m_int {
    int val;

    _m_int(int64_t v = 0) {
        if (v < 0) v = v % MOD + MOD;
        if (v >= MOD) v %= MOD;
        val = int(v);
    }

    static int inv_mod(int a, int m = MOD) {
        // https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Example
        int g = m, r = a, x = 0, y = 1;

        while (r != 0) {
            int q = g / r;
            g %= r; swap(g, r);
            x -= q * y; swap(x, y);
        }

        return x < 0 ? x + m : x;
    }

    explicit operator int() const { return val; }
    explicit operator int64_t() const { return val; }

    _m_int& operator+=(const _m_int &other) {
        val -= MOD - other.val;
        if (val < 0) val += MOD;
        return *this;
    }

    _m_int& operator-=(const _m_int &other) {
        val -= other.val;
        if (val < 0) val += MOD;
        return *this;
    }

    static unsigned fast_mod(uint64_t x, unsigned m = MOD) {
#if !defined(_WIN32) || defined(_WIN64)
        return unsigned(x % m);
#endif
        // Optimized mod for Codeforces 32-bit machines.
        // x must be less than 2^32 * m for this to work, so that x / m fits in an unsigned 32-bit int.
        unsigned x_high = unsigned(x >> 32), x_low = unsigned(x);
        unsigned quot, rem;
        asm("divl %4\n"
            : "=a" (quot), "=d" (rem)
            : "d" (x_high), "a" (x_low), "r" (m));
        return rem;
    }

    _m_int& operator*=(const _m_int &other) {
        val = fast_mod(uint64_t(val) * other.val);
        return *this;
    }

    _m_int& operator/=(const _m_int &other) {
        return *this *= other.inv();
    }

    friend _m_int operator+(const _m_int &a, const _m_int &b) { return _m_int(a) += b; }
    friend _m_int operator-(const _m_int &a, const _m_int &b) { return _m_int(a) -= b; }
    friend _m_int operator*(const _m_int &a, const _m_int &b) { return _m_int(a) *= b; }
    friend _m_int operator/(const _m_int &a, const _m_int &b) { return _m_int(a) /= b; }

    _m_int& operator++() {
        val = val == MOD - 1 ? 0 : val + 1;
        return *this;
    }

    _m_int& operator--() {
        val = val == 0 ? MOD - 1 : val - 1;
        return *this;
    }

    _m_int operator++(int) { _m_int before = *this; ++*this; return before; }
    _m_int operator--(int) { _m_int before = *this; --*this; return before; }

    _m_int operator-() const {
        return val == 0 ? 0 : MOD - val;
    }

    bool operator==(const _m_int &other) const { return val == other.val; }
    bool operator!=(const _m_int &other) const { return val != other.val; }

    _m_int inv() const {
        return inv_mod(val);
    }

    _m_int pow(int64_t p) const {
        if (p < 0)
            return inv().pow(-p);

        _m_int a = *this, result = 1;

        while (p > 0) {
            if (p & 1)
                result *= a;

            p >>= 1;

            if (p > 0)
                a *= a;
        }

        return result;
    }

    friend ostream& operator<<(ostream &os, const _m_int &m) {
        return os << m.val;
    }
};

extern const int MOD = 998244353;
using mod_int = _m_int<MOD>;

int main() {
    IO::init();

    int N;
    IO::read_int(N);
    vector<int> C(N);

    for (int &c : C)
        IO::read_int(c);

    sort(C.begin(), C.end());
    vector<uint64_t> C_sum(N + 1, 0);

    for (int i = 0; i < N; i++)
        C_sum[i + 1] = C_sum[i] + C[i];

    vector<mod_int> answers(N);
    mod_int inv_N = mod_int(N).inv();

    for (int k = 1; k <= N; k++) {
        int remain = N - k;
        int full = remain / k;

        uint64_t sum = C_sum[remain % k] * (full + 1);
        int position = remain % k;

        for (int x = full; x > 0; x--) {
            sum += (C_sum[position + k] - C_sum[position]) * x;
            position += k;
        }

        assert(position == remain);
        answers[k - 1] = mod_int(sum) * inv_N;
    }

    for (int i = 0; i < N; i++)
        IO::write_int(int(answers[i]), i < N - 1 ? ' ' : '\n');
}


#include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;

template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }

#ifdef NEAL_DEBUG
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
#include <cassert>
#include <iostream>
using namespace std;

namespace IO {
    const int BUFFER_SIZE = 1 << 15;

    char input_buffer[BUFFER_SIZE];
    size_t input_pos = 0, input_len = 0;

    char output_buffer[BUFFER_SIZE];
    int output_pos = 0;

    char number_buffer[100];
    uint8_t lookup[100];

    void _update_input_buffer() {
        input_len = fread(input_buffer, sizeof(char), BUFFER_SIZE, stdin);
        input_pos = 0;

        if (input_len == 0)
            input_buffer[0] = EOF;
    }

    inline char next_char(bool advance = true) {
        if (input_pos >= input_len)
            _update_input_buffer();

        return input_buffer[advance ? input_pos++ : input_pos];
    }

    template<typename T>
    inline void read_int(T &number) {
        bool negative = false;
        number = 0;

        while (!isdigit(next_char(false)))
            if (next_char() == '-')
                negative = true;

        do {
            number = 10 * number + (next_char() - '0');
        } while (isdigit(next_char(false)));

        if (negative)
            number = -number;
    }

    template<typename T, typename... Args>
    inline void read_int(T &number, Args &... args) {
        read_int(number);
        read_int(args...);
    }

    void _flush_output() {
        fwrite(output_buffer, sizeof(char), output_pos, stdout);
        output_pos = 0;
    }

    inline void write_char(char c) {
        if (output_pos == BUFFER_SIZE)
            _flush_output();

        output_buffer[output_pos++] = c;
    }

    template<typename T>
    inline void write_int(T number, char after = '\0') {
        if (number < 0) {
            write_char('-');
            number = -number;
        }

        int length = 0;

        while (number >= 10) {
            uint8_t lookup_value = lookup[number % 100];
            number /= 100;
            number_buffer[length++] = char((lookup_value & 15) + '0');
            number_buffer[length++] = char((lookup_value >> 4) + '0');
        }

        if (number != 0 || length == 0)
            write_char(char(number + '0'));

        for (int i = length - 1; i >= 0; i--)
            write_char(number_buffer[i]);

        if (after)
            write_char(after);
    }

    void init() {
        // Make sure _flush_output() is called at the end of the program.
        bool exit_success = atexit(_flush_output) == 0;
        assert(exit_success);

        for (int i = 0; i < 100; i++)
            lookup[i] = uint8_t((i / 10 << 4) + i % 10);
    }
}

template<const int &MOD>
struct _m_int {
    int val;

    _m_int(int64_t v = 0) {
        if (v < 0) v = v % MOD + MOD;
        if (v >= MOD) v %= MOD;
        val = int(v);
    }

    static int inv_mod(int a, int m = MOD) {
        // https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Example
        int g = m, r = a, x = 0, y = 1;

        while (r != 0) {
            int q = g / r;
            g %= r; swap(g, r);
            x -= q * y; swap(x, y);
        }

        return x < 0 ? x + m : x;
    }

    explicit operator int() const { return val; }
    explicit operator int64_t() const { return val; }

    _m_int& operator+=(const _m_int &other) {
        val -= MOD - other.val;
        if (val < 0) val += MOD;
        return *this;
    }

    _m_int& operator-=(const _m_int &other) {
        val -= other.val;
        if (val < 0) val += MOD;
        return *this;
    }

    static unsigned fast_mod(uint64_t x, unsigned m = MOD) {
#if !defined(_WIN32) || defined(_WIN64)
        return unsigned(x % m);
#endif
        // Optimized mod for Codeforces 32-bit machines.
        // x must be less than 2^32 * m for this to work, so that x / m fits in an unsigned 32-bit int.
        unsigned x_high = unsigned(x >> 32), x_low = unsigned(x);
        unsigned quot, rem;
        asm("divl %4\n"
            : "=a" (quot), "=d" (rem)
            : "d" (x_high), "a" (x_low), "r" (m));
        return rem;
    }

    _m_int& operator*=(const _m_int &other) {
        val = fast_mod(uint64_t(val) * other.val);
        return *this;
    }

    _m_int& operator/=(const _m_int &other) {
        return *this *= other.inv();
    }

    friend _m_int operator+(const _m_int &a, const _m_int &b) { return _m_int(a) += b; }
    friend _m_int operator-(const _m_int &a, const _m_int &b) { return _m_int(a) -= b; }
    friend _m_int operator*(const _m_int &a, const _m_int &b) { return _m_int(a) *= b; }
    friend _m_int operator/(const _m_int &a, const _m_int &b) { return _m_int(a) /= b; }

    _m_int& operator++() {
        val = val == MOD - 1 ? 0 : val + 1;
        return *this;
    }

    _m_int& operator--() {
        val = val == 0 ? MOD - 1 : val - 1;
        return *this;
    }

    _m_int operator++(int) { _m_int before = *this; ++*this; return before; }
    _m_int operator--(int) { _m_int before = *this; --*this; return before; }

    _m_int operator-() const {
        return val == 0 ? 0 : MOD - val;
    }

    bool operator==(const _m_int &other) const { return val == other.val; }
    bool operator!=(const _m_int &other) const { return val != other.val; }

    _m_int inv() const {
        return inv_mod(val);
    }

    _m_int pow(int64_t p) const {
        if (p < 0)
            return inv().pow(-p);

        _m_int a = *this, result = 1;

        while (p > 0) {
            if (p & 1)
                result *= a;

            p >>= 1;

            if (p > 0)
                a *= a;
        }

        return result;
    }

    friend ostream& operator<<(ostream &os, const _m_int &m) {
        return os << m.val;
    }
};

extern const int MOD = 998244353;
using mod_int = _m_int<MOD>;

int main() {
    IO::init();

    int N;
    IO::read_int(N);
    vector<int> C(N);

    IO::read_int(C);

    sort(C.begin(), C.end());
    vector<uint64_t> C_sum(N + 1, 0);

    for (int i = 0; i < N; i++)
        C_sum[i + 1] = C_sum[i] + C[i];

    vector<mod_int> answers(N);
    mod_int inv_N = mod_int(N).inv();

    for (int k = 1; k <= N; k++) {
        int remain = N - k;
        int full = remain / k;

        uint64_t sum = C_sum[remain % k] * (full + 1);
        int position = remain % k;

        for (int x = full; x > 0; x--) {
            sum += (C_sum[position + k] - C_sum[position]) * x;
            position += k;
        }

        assert(position == remain);
        answers[k - 1] = mod_int(sum) * inv_N;
    }

    for (int i = 0; i < N; i++)
        IO::write_int(int(answers[i]), i < N - 1 ? ' ' : '\n');
}


#include <bits/stdc++.h>
using namespace std;

#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;

template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v);
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
	cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
	cin >> p.first;
	return cin >> p.second;
}

mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// mt19937 rng(61378913);
/* usage - just do rng() */

void usaco(string filename) {
  // #pragma message("be careful, freopen may be wrong")
	freopen((filename + ".in").c_str(), "r", stdin);
	freopen((filename + ".out").c_str(), "w", stdout);
}

// #include <atcoder/all>
// using namespace atcoder;

const lld pi = 3.14159265358979323846;
// const ll mod = 1000000007;
const ll mod = 998244353;
// ll mod;

namespace modop {
	ll madd(ll a, ll b) {
	  return (a + b) % mod;
	}
	ll msub(ll a, ll b) {
	  return (((a - b) % mod) + mod) % mod;
	}
	ll mmul(ll a, ll b) {
	  return ((a % mod) * (b % mod)) % mod;
	}
	ll mpow(ll base, ll exp) {
	  ll res = 1;
	  while (exp) {
		if (exp % 2 == 1){
			res = (res * base) % mod;
		}
		exp >>= 1;
		base = (base * base) % mod;
	  }
	  return res;
	}
	ll minv(ll base) {
	  return mpow(base, mod - 2);
	}
	ll mdiv(ll a, ll b) {
	  return mmul(a, minv(b));
	}
}

using namespace modop;

ll n, m, k, q, l, r, x, y, z;
const ll template_array_size = 1e6 + 3862;
ll a[template_array_size];
ll b[template_array_size];
ll c[template_array_size];
string s, t;
ll ans = 0;

ll psum[300005];
ll gs(ll l, ll r) {
	ll x = psum[r];
	if (l > 0) x -= psum[l - 1];
	return x % mod;
}

void solve(int tc = 0) {
	cin >> n;
	for (ll i = 0; i < n; i++) cin >> a[i];
	sort(a, a + n);

	// for (ll i = 0; i < n; i++) cout << a[i] << " ";

	ll r = 0;
	for (ll i = 0; i < n; i++) {
		r += a[i];
		psum[i] = r;
	}

	ll mn = minv(n);
	for (ll i = 0; i < n; i++) {
		ll x = 0;
		ll start = n - i - 2;

		ll cur = 1;
		while (start >= 0) {
			x = (x + cur * gs(start - i, start)) % mod;
			++cur;
			start -= (i + 1);
		}

		cout << (x * mn) % mod << " ";
	}
}

int main() {
	#ifdef galen_colin_local
		auto begin = std::chrono::high_resolution_clock::now();
	#endif

	send help

	#ifndef galen_colin_local
		// usaco("cowpatibility");
	#endif

	// usaco("cowland");

	// freopen("tc.cpp", "r", stdin);

	int tc = 1;
	// cin >> tc;
	for (int t = 0; t < tc; t++) solve(t);

	#ifdef galen_colin_local
		auto end = std::chrono::high_resolution_clock::now();
		cout << setprecision(4) << fixed;
		// cout << "Execution time: " << std::chrono::duration_cast<std::chrono::duration<double>>(end - begin).count() << " seconds" << endl;
	#endif
}


#include <bits/stdc++.h>
using namespace std;

#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;

template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v);
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
	cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
	cin >> p.first;
	return cin >> p.second;
}

mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// mt19937 rng(61378913);
/* usage - just do rng() */

void usaco(string filename) {
  // #pragma message("be careful, freopen may be wrong")
	freopen((filename + ".in").c_str(), "r", stdin);
	freopen((filename + ".out").c_str(), "w", stdout);
}

// #include <atcoder/all>
// using namespace atcoder;

const lld pi = 3.14159265358979323846;
// const ll mod = 1000000007;
const ll mod = 998244353;
// ll mod;

namespace modop {
	ll madd(ll a, ll b) {
	  return (a + b) % mod;
	}
	ll msub(ll a, ll b) {
	  return (((a - b) % mod) + mod) % mod;
	}
	ll mmul(ll a, ll b) {
	  return ((a % mod) * (b % mod)) % mod;
	}
	ll mpow(ll base, ll exp) {
	  ll res = 1;
	  while (exp) {
		if (exp % 2 == 1){
			res = (res * base) % mod;
		}
		exp >>= 1;
		base = (base * base) % mod;
	  }
	  return res;
	}
	ll minv(ll base) {
	  return mpow(base, mod - 2);
	}
	ll mdiv(ll a, ll b) {
	  return mmul(a, minv(b));
	}
}

using namespace modop;

ll n, m, k, q, l, r, x, y, z;
const ll template_array_size = 1e6 + 3862;
ll a[template_array_size];
ll b[template_array_size];
ll c[template_array_size];
string s, t;
ll ans = 0;

ll psum[300005];
ll gs(ll l, ll r) {
	ll x = psum[r];
	if (l > 0) x -= psum[l - 1];
	return x % mod;
}

void solve(int tc = 0) {
	cin >> n;
	for (ll i = 0; i < n; i++) cin >> a[i];
	sort(a, a + n);

	for (ll i = 0; i < n; i++) cout << a[i] << " ";

	ll r = 0;
	for (ll i = 0; i < n; i++) {
		r += a[i];
		psum[i] = r;
	}

	ll mn = minv(n);
	for (ll i = 0; i < n; i++) {
		ll x = 0;
		ll start = n - i - 2;

		ll cur = 1;
		while (start >= 0) {
			x = (x + cur * gs(start - i, start)) % mod;
			++cur;
			start -= (i + 1);
		}

		cout << (x * mn) % mod << " ";
	}
}

int main() {
	#ifdef galen_colin_local
		auto begin = std::chrono::high_resolution_clock::now();
	#endif

	send help

	#ifndef galen_colin_local
		// usaco("cowpatibility");
	#endif

	// usaco("cowland");

	// freopen("tc.cpp", "r", stdin);

	int tc = 1;
	// cin >> tc;
	for (int t = 0; t < tc; t++) solve(t);

	#ifdef galen_colin_local
		auto end = std::chrono::high_resolution_clock::now();
		cout << setprecision(4) << fixed;
		// cout << "Execution time: " << std::chrono::duration_cast<std::chrono::duration<double>>(end - begin).count() << " seconds" << endl;
	#endif
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn=2e5+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=998244353;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define int ll

#ifdef HNO2
#define IOS
#else
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int ppow(int x,int y)
{
    if (y==0) return 1;
    int ret=ppow(x,y/2);
    ret=ret*ret%mod;
    if (y&1) ret=ret*x%mod;
    return ret;
}

int a[maxn],p[maxn],ans[maxn];

int32_t main()
{
    IOS
    int n;
    cin>>n;
    for (int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+n+1);

    int inv=ppow(n,mod-2);
    for (int i=1;i<=n;i++) p[i]=p[i-1]+a[i];
    for (int i=1;i<=n;i++)
    {
        int sum=0;
        int L=n/i,R=n%i;
        sum=p[R]*L;
        int cnt=L-1;
        for (int j=R+i;j<=R+i*L;j+=i) sum=(sum+(p[j]-p[j-i])*cnt%mod)%mod,cnt--;
        //cout<<sum<<endl;
        cout<<sum*inv%mod<<' ';
    }
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn=2e5+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=998244353;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define int ll

#ifdef HNO2
#define IOS
#else
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int ppow(int x,int y)
{
    if (y==0) return 1;
    int ret=ppow(x,y/2);
    ret=ret*ret%mod;
    if (y&1) ret=ret*x%mod;
    return ret;
}

int a[maxn],p[maxn],ans[maxn];

int32_t main()
{
    IOS
    int n;
    cin>>n;
    for (int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+n+1);

    int inv=ppow(n,mod-2);
    for (int i=1;i<=n;i++) p[i]=p[i-1]+a[i];
    for (int i=1;i<=n;i++)
    {
        int sum=0;
        int L=n/i,R=n%i;
        sum=p[R]*L;
        int cnt=L-1;
        for (int j=R+i;j<=R+i*(L-1);j+=i) sum+=(p[j]-p[j-i])*cnt,cnt--;
        //cout<<sum<<endl;
        cout<<sum*inv%mod<<' ';
    }
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn=1e6+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
//#define int ll

#ifdef HNO2
#define IOS
#else
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int32_t main()
{
    IOS
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn=3e5+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=998244353;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define int ll

#ifdef HNO2
#define IOS
#else
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int ppow(int x,int y)
{
    if (y==0) return 1;
    int ret=ppow(x,y/2);
    ret=ret*ret%mod;
    if (y&1) ret=ret*x%mod;
    return ret;
}

int a[maxn],p[maxn],ans[maxn];

int32_t main()
{
    IOS
    int n;
    cin>>n;
    for (int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+n+1);

    int inv=ppow(n,mod-2);
    for (int i=1;i<=n;i++) p[i]=p[i-1]+a[i];
    for (int i=1;i<=n;i++)
    {
        int sum=0;
        int L=n/i,R=n%i;
        sum=p[R]*L;
        int cnt=L-1;
        for (int j=R+i;j<=R+i*L;j+=i) sum=(sum+(p[j]-p[j-i])*cnt%mod)%mod,cnt--;
        //cout<<sum<<endl;
        cout<<sum*inv%mod<<' ';
    }
}


#pragma GCC optimize ("Ofast","unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define MP make_pair
#define F first
#define S second
#define setpre(a) cout.precision(a),cout<<fixed;
#define ALL(a) a.begin(),a.end()
#define MEM(a,b) memset(a,b,sizeof a)
#define Tie ios::sync_with_stdio(0),cin.tie(0);
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;

const ll MOD = 998244353;
ll n, all, alli, revn;
vector<ll> tree;
vector<ll> a;

ll mypow(ll a, ll b) {
    ll re = 1;
    while(b) {
        if(b & 1)
            re = re * a % MOD;
        a = a * a % MOD, b >>= 1;
    }
    return re;
}

ll rev(ll x) {
    return mypow(x, MOD - 2);
}

void fix(int l, int r, int tl, int tr, int c, ll w) {
    if(w == 0)
        return;
    if(l <= tl && tr <= r)
        return tree[c] = (tree[c] + w) % MOD, void();
    int tm = tl + tr >> 1;
    if(l <= tm)
        fix(l, r, tl, tm, c << 1, w);
    if(tm + 1 <= r)
        fix(l, r, tm + 1, tr, c << 1 | 1, w);
}

void solve(int r, ll w) {
    int last = r / 2, next;
    if(!r)return;
    for(int i = 2; last; i++) {
        next = r / i + 1;
        if(next == 0)
            break;
        // cout << next << ' ' << last << ' ' << ((r - next) / next) << ' ';
        if(next <= last)
            fix(next, last, 1, n, 1, w * ((r - next) / next));
        last = next - 1;
    }
    // cout << '\n';
}

void dfs(int l, int r, int c, ll w) {
    w = (w + tree[c]) % MOD;
    if(l == r)
        return all = (all - a[l - 1] + MOD) % MOD, cout << (w + all) % MOD * revn % MOD << " \n"[l == n], void();
    int m = l + r >> 1;
    dfs(l, m, c << 1, w), dfs(m + 1, r, c << 1 | 1, w);
}

int main() {Tie
    cin >> n, revn = rev(n);
    tree.resize(n * 4);
    a.resize(n);
    for(ll &i : a)
        cin >> i, all = (all + i) % MOD;
    sort(ALL(a));
    reverse(ALL(a));
    for(int i = 0; i < n; i++)
        solve(i, a[i]);
    dfs(1, n, 1, 0);
}


#pragma GCC optimize ("Ofast","unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define MP make_pair
#define F first
#define S second
#define setpre(a) cout.precision(a),cout<<fixed;
#define ALL(a) a.begin(),a.end()
#define MEM(a,b) memset(a,b,sizeof a)
#define Tie ios::sync_with_stdio(0),cin.tie(0);
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;

const ll MOD = 998244353;
ll n, all, alli, revn;
vector<ll> tree;
vector<ll> a;

ll mypow(ll a, ll b) {
    ll re = 1;
    while(b) {
        if(b & 1)
            re = re * a % MOD;
        a = a * a % MOD, b >>= 1;
    }
    return re;
}

ll rev(ll x) {
    return mypow(x, MOD - 2);
}

void fix(int l, int r, int tl, int tr, int c, ll w) {
    if(w == 0)
        return;
    if(l <= tl && tr <= r)
        return tree[c] = (tree[c] + w) % MOD, void();
    int tm = tl + tr >> 1;
    if(l <= tm)
        fix(l, r, tl, tm, c << 1, w);
    if(tm + 1 <= r)
        fix(l, r, tm + 1, tr, c << 1 | 1, w);
}

void solve(int r, ll w) {
    int last = r / 2, next;
    if(!r)return;
    for(int i = 2; last; i++) {
        next = r / i + (r % i > 0);
        if(next == 0)
            break;
        // cout << next << ' ' << last << ' ' << ((r - next) / next) << ' ';
        fix(next, last, 1, n, 1, w * ((r - next) / next));
        last = next - 1;
    }
    // cout << '\n';
}

void dfs(int l, int r, int c, ll w) {
    w = (w + tree[c]) % MOD;
    if(l == r)
        return all = (all - a[l - 1] + MOD) % MOD, cout << (w + all) % MOD * revn % MOD << " \n"[l == n], void();
    int m = l + r >> 1;
    dfs(l, m, c << 1, w), dfs(m + 1, r, c << 1 | 1, w);
}

int main() {Tie
    cin >> n, revn = rev(n);
    tree.resize(n * 4);
    a.resize(n);
    for(ll &i : a)
        cin >> i, all = (all + i) % MOD;
    sort(ALL(a));
    reverse(ALL(a));
    for(int i = 0; i < n; i++)
        solve(i, a[i]);
    dfs(1, n, 1, 0);
}


#pragma GCC optimize ("Ofast","unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define MP make_pair
#define F first
#define S second
#define setpre(a) cout.precision(a),cout<<fixed;
#define ALL(a) a.begin(),a.end()
#define MEM(a,b) memset(a,b,sizeof a)
#define Tie ios::sync_with_stdio(0),cin.tie(0);
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;

const ll MOD = 998244353;
ll n, all, alli, revn;
vector<ll> tree;
vector<ll> a;

ll mypow(ll a, ll b) {
    ll re = 1;
    while(b) {
        if(b & 1)
            re = re * a % MOD;
        a = a * a % MOD, b >>= 1;
    }
    return re;
}

ll rev(ll x) {
    return mypow(x, MOD - 2);
}

void fix(int l, int r, int tl, int tr, int c, ll w) {
    if(w == 0)
        return;
    if(l <= tl && tr <= r)
        return tree[c] = (tree[c] + w) % MOD, void();
    int tm = tl + tr >> 1;
    if(l <= tm)
        fix(l, r, tl, tm, c << 1, w);
    if(tm + 1 <= r)
        fix(l, r, tm + 1, tr, c << 1 | 1, w);
}

void solve(int r, ll w) {
    int last = r / 2, next;
    if(!r)return;
    for(int i = 2; last; i++) {
        next = r / i;
        if(next == 0)
            break;
        // cout << next << ' ' << last << ' ' << ((r - next) / next) << ' ';
        fix(next, last, 1, n, 1, w * ((r - next) / next));
        last = next - 1;
    }
    // cout << '\n';
}

void dfs(int l, int r, int c, ll w) {
    w = (w + tree[c]) % MOD;
    if(l == r)
        return all = (all - a[l - 1] + MOD) % MOD, cout << (w + all) % MOD * revn % MOD << " \n"[l == n], void();
    int m = l + r >> 1;
    dfs(l, m, c << 1, w), dfs(m + 1, r, c << 1 | 1, w);
}

int main() {Tie
    cin >> n, revn = rev(n);
    tree.resize(n * 4);
    a.resize(n);
    for(ll &i : a)
        cin >> i, all = (all + i) % MOD;
    sort(ALL(a));
    reverse(ALL(a));
    for(int i = 0; i < n; i++)
        solve(i, a[i]);
    dfs(1, n, 1, 0);
    cout << '\n';
}


#pragma GCC optimize ("Ofast","unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define MP make_pair
#define F first
#define S second
#define setpre(a) cout.precision(a),cout<<fixed;
#define ALL(a) a.begin(),a.end()
#define MEM(a,b) memset(a,b,sizeof a)
#define Tie ios::sync_with_stdio(0),cin.tie(0);
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;

const ll MOD = 998244353;
ll n, all, alli, revn;
vector<ll> tree;
vector<ll> a, sa;

ll mypow(ll a, ll b) {
    ll re = 1;
    while(b) {
        if(b & 1)
            re = re * a % MOD;
        a = a * a % MOD, b >>= 1;
    }
    return re;
}

ll rev(ll x) {
    return mypow(x, MOD - 2);
}

ll solve(ll x) {
    ll re = (sa[n] - sa[x - 1] + MOD) % MOD ;
    if(x * 2 <= n) {
        for(ll i = x * 2, cnt = 1; 1; i += x, cnt++) {
            re = (re + (sa[min(n, i + x - 1)] - sa[i - 1] + MOD) * cnt % MOD) % MOD;
            if(i + x - 1 >= n)
                break;
        }
    }
    return re * revn % MOD;
}

int main() {Tie
    cin >> n, revn = rev(n);
    tree.resize(n * 4);
    a.resize(n + 1);
    for(int i = 1; i <= n; i++)
        cin >> a[i];
    sort(ALL(a));
    reverse(ALL(a));
    sa = a;
    for(int i = 1; i <= n; i++)
        sa[i] = (sa[i] + sa[i - 1]) % MOD;
    for(int i = 1; i <= n; i++)
        cout << solve(i) << " \n"[i == n];
}


#include<bits/stdc++.h>
typedef long long LL;
using namespace std;
const int maxn = 3e5 + 10;
const int MOD = 998244353;

int n;
int arr[maxn];
LL sum[maxn];

LL fpow(LL a,LL b){
    LL ret = 1;
    while(b){
        if(b & 1) ret = ret * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return ret;
}

int main(){
    scanf("%d",&n);
    for(int i = 1 ; i <= n ; i++ )
        scanf("%d",&arr[i]);
    sort(arr + 1,arr + 1 + n,greater<int>());
    for(int i = 1 ; i <= n ; i++ ){
        sum[i] = (sum[i - 1] + arr[i]) % MOD;
    }
    LL inv = fpow(n,MOD - 2);
    for(int k = 1 ; k <= n ; k++ ){
        LL ans = 0;
        for(int i = 0,j = 0 ; i < n ; ++j,i += k){
            ans = (ans + j * (sum[min(n,i + k)] - sum[i] + MOD) % MOD) % MOD;
        }
        printf("%I64d%c", ans * inv % MOD,k == n ? '\n' : ' ');
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define F first
#define S second
#define pb push_back
typedef vector<int> vi;
typedef vector<pii> vpii;

template <class t>          //vector sort template
vector<t> sort(vector<t> &a) {return sort(a.begin(),a.end());}

const int MOD = 998244353;
struct mi {
    ll v; explicit operator ll() const { return v; }
    mi() { v = 0; }
    mi(ll _v) {
        v = (-MOD < _v && _v < MOD) ? _v : _v % MOD;
        if (v < 0) v += MOD;
    }
    friend bool operator==(const mi& a, const mi& b) {
        return a.v == b.v; }
    friend bool operator!=(const mi& a, const mi& b) {
        return !(a == b); }
    friend bool operator<(const mi& a, const mi& b) {
        return a.v < b.v; }

    mi& operator+=(const mi& m) {
        if ((v += m.v) >= MOD) v -= MOD;
        return *this; }
    mi& operator-=(const mi& m) {
        if ((v -= m.v) < 0) v += MOD;
        return *this; }
    mi& operator*=(const mi& m) {
        v = v*m.v%MOD; return *this; }
    mi& operator/=(const mi& m) { return (*this) *= inv(m); }
    friend mi pow(mi a, ll p) {
        mi ans = 1; assert(p >= 0);
        for (; p; p /= 2, a *= a) if (p&1) ans *= a;
        return ans;
    }
    friend mi inv(const mi& a) { assert(a.v != 0);
        return pow(a,MOD-2); }

    mi operator-() const { return mi(-v); }
    mi& operator++() { return *this += 1; }
    mi& operator--() { return *this -= 1; }
    mi operator++(int) { mi temp; temp.v = v++; return temp; }
    mi operator--(int) { mi temp; temp.v = v--; return temp; }
    friend mi operator+(mi a, const mi& b) { return a += b; }
    friend mi operator-(mi a, const mi& b) { return a -= b; }
    friend mi operator*(mi a, const mi& b) { return a *= b; }
    friend mi operator/(mi a, const mi& b) { return a /= b; }
    friend ostream& operator<<(ostream& os, const mi& m) {
        os << m.v; return os;
    }
    friend istream& operator>>(istream& is, mi& m) {
        ll x; is >> x;
        m.v = x;
        return is;
    }
};
bool cmp(mi &a,mi &b) {
    return !(a<b);
}
mi a[1000000];
int main()
{
//    ofstream fout("f.out");
//    ifstream fin("f.in");
    ios_base::sync_with_stdio(false);
    cin.tie();

    int n;cin>>n;
    mi v(n+1);
    for (int i=1;i<=n;i++) cin>>a[i];

    sort(a+1,a+n+1,cmp);

    mi invn = 1; invn /= n;
    for (int i=1;i<=n;i++) a[i] += a[i-1];//psum till end

    for (int q=1;q<=n;q++) { //q = block size

        //blk = q

        mi res = 0;
        for (int i=0;i*q<=n;i++) res += i* (a[min(n,(i+1)*q)] - a[i*q]);

        res *= invn;

        cout << res << ' ';
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define F first
#define S second
#define pb push_back
typedef vector<int> vi;
typedef vector<pii> vpii;

template <class t>          //vector sort template
vector<t> sort(vector<t> &a) {return sort(a.begin(),a.end());}

const int MOD = 998244353;
struct mi {
    ll v; explicit operator ll() const { return v; }
    mi() { v = 0; }
    mi(ll _v) {
        v = (-MOD < _v && _v < MOD) ? _v : _v % MOD;
        if (v < 0) v += MOD;
    }
    friend bool operator==(const mi& a, const mi& b) {
        return a.v == b.v; }
    friend bool operator!=(const mi& a, const mi& b) {
        return !(a == b); }
    friend bool operator<(const mi& a, const mi& b) {
        return a.v < b.v; }

    mi& operator+=(const mi& m) {
        if ((v += m.v) >= MOD) v -= MOD;
        return *this; }
    mi& operator-=(const mi& m) {
        if ((v -= m.v) < 0) v += MOD;
        return *this; }
    mi& operator*=(const mi& m) {
        v = v*m.v%MOD; return *this; }
    mi& operator/=(const mi& m) { return (*this) *= inv(m); }
    friend mi pow(mi a, ll p) {
        mi ans = 1; assert(p >= 0);
        for (; p; p /= 2, a *= a) if (p&1) ans *= a;
        return ans;
    }
    friend mi inv(const mi& a) { assert(a.v != 0);
        return pow(a,MOD-2); }

    mi operator-() const { return mi(-v); }
    mi& operator++() { return *this += 1; }
    mi& operator--() { return *this -= 1; }
    mi operator++(int) { mi temp; temp.v = v++; return temp; }
    mi operator--(int) { mi temp; temp.v = v--; return temp; }
    friend mi operator+(mi a, const mi& b) { return a += b; }
    friend mi operator-(mi a, const mi& b) { return a -= b; }
    friend mi operator*(mi a, const mi& b) { return a *= b; }
    friend mi operator/(mi a, const mi& b) { return a /= b; }
    friend ostream& operator<<(ostream& os, const mi& m) {
        os << m.v; return os;
    }
    friend istream& operator>>(istream& is, mi& m) {
        ll x; is >> x;
        m.v = x;
        return is;
    }
};
bool cmp(mi &a,mi &b) {
    return a.v>b.v;
}
mi a[1000000];
int main()
{
//    ofstream fout("f.out");
//    ifstream fin("f.in");
    ios_base::sync_with_stdio(false);
    cin.tie();

    int n;cin>>n;
    for (int i=1;i<=n;i++) cin>>a[i];

    sort(a+1,a+n+1,cmp);

    mi invn = 1; invn /= n;
    for (int i=1;i<=n;i++) a[i] += a[i-1];//psum till end

    for (int q=1;q<=n;q++) { //q = block size

        //blk = q

        mi res = 0;
        for (int i=0;i*q<=n;i++) res += i* (a[min(n,(i+1)*q)] - a[i*q]);

        res *= invn;

        cout << res << ' ';
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <utility>
#include <array>
#include <cmath>
#include <iterator>
#include <bitset>
#include <queue>
#include <map>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define maxV 10000
#define REP(i, a, b) for (int i = int(a); i <= int(b); i++)
using namespace std;
typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef vector<vector<int>> vvi;
//int adj[maxV][maxV];

lli bs(vector<lli> a, lli begin, lli end, lli value) {
	return lower_bound(a.begin() + begin, a.begin() + end, value) - a.begin();
}
lli max(lli a, lli b) { return a > b ? a : b; }
lli min(lli a, lli b) { return a < b ? a : b; }

vector<int> pset(1000);
vector<int> _weight(1000);
int _num = 0;

void initSet(int _size) { pset.resize(_size); _weight.resize(_size); _num = _size; REP(i, 0, _size - 1) { pset[i] = i; _weight[i] = 1; } }
int findSet(int i) { return (pset[i] == i) ? i : (pset[i] = findSet(pset[i])); }
void unionSet(int i, int j) { if (i == j) return; int ii = findSet(i); int jj = findSet(j); if (_weight[ii] > _weight[jj]) swap(ii, jj); pset[ii] = jj; _weight[jj] += _weight[ii]; _num--; }
bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
int sizeOfSet(int i) { return _weight[findSet(i)]; }
int numberOfSets() { return _num; }

lli gcd(lli a, lli b) {
	if (a % b == 0) return b;
	return gcd(b, a % b);
}

vvi graph;
vector<bool> visited;

void dfs(int u) {
	visited[u] = true;
	for (auto& v : graph[u]) {
		if (!visited[v]) dfs(v);
	}
}

//long long int memo[1][1];
//vector<int> table;
//bool sss(int end, int sum) {
//	if (sum == 0) return true;
//	if (sum < 0) return false;
//	if (end == 0) return false;
//	if (memo[end][sum] != -1) return memo[end][sum];
//	return (memo[end][sum] = (sss(end - 1, sum) || sss(end - 1, sum - table[end - 1])));
//}

lli modInverse(lli a, lli m) {
	lli m0 = m;
	lli y = 0, x = 1;
	if (m == 1) return 0;
	while (a > 1) {
		lli q = a / m;
		lli t = m;
		m = a % m, a = t;
		t = y;
		y = x - q * y;
		x = t;
	}
	if (x < 0) x += m0;
	return x;
}

lli cst = 998244353;
lli modu(lli p, lli q) {
	return (p * modInverse(q, cst)) % cst;
}

int main() {
	int n; cin >> n;
	vector<lli> table(n);
	REP(i, 0, n - 1)cin >> table[i];
	sort(table.begin(), table.end());
	REP(k, 1, n) {
		lli total = 0;
		int j = k;
		for (int i = n - k - 1; i >= 0; i--) {
			//cout << (j / k) << " " << table[i] << endl;
			total += j / k * table[i];
			j++;
		}
		cout << modu(total % cst, n) << " ";
	}
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <utility>
#include <array>
#include <cmath>
#include <iterator>
#include <bitset>
#include <queue>
#include <map>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define maxV 10000
#define REP(i, a, b) for (int i = int(a); i <= int(b); i++)
using namespace std;
typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef vector<vector<int>> vvi;
//int adj[maxV][maxV];

lli bs(vector<lli> a, lli begin, lli end, lli value) {
	return lower_bound(a.begin() + begin, a.begin() + end, value) - a.begin();
}
lli max(lli a, lli b) { return a > b ? a : b; }
lli min(lli a, lli b) { return a < b ? a : b; }

vector<int> pset(1000);
vector<int> _weight(1000);
int _num = 0;

void initSet(int _size) { pset.resize(_size); _weight.resize(_size); _num = _size; REP(i, 0, _size - 1) { pset[i] = i; _weight[i] = 1; } }
int findSet(int i) { return (pset[i] == i) ? i : (pset[i] = findSet(pset[i])); }
void unionSet(int i, int j) { if (i == j) return; int ii = findSet(i); int jj = findSet(j); if (_weight[ii] > _weight[jj]) swap(ii, jj); pset[ii] = jj; _weight[jj] += _weight[ii]; _num--; }
bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
int sizeOfSet(int i) { return _weight[findSet(i)]; }
int numberOfSets() { return _num; }

lli gcd(lli a, lli b) {
	if (a % b == 0) return b;
	return gcd(b, a % b);
}

vvi graph;
vector<bool> visited;

void dfs(int u) {
	visited[u] = true;
	for (auto& v : graph[u]) {
		if (!visited[v]) dfs(v);
	}
}

//long long int memo[1][1];
//vector<int> table;
//bool sss(int end, int sum) {
//	if (sum == 0) return true;
//	if (sum < 0) return false;
//	if (end == 0) return false;
//	if (memo[end][sum] != -1) return memo[end][sum];
//	return (memo[end][sum] = (sss(end - 1, sum) || sss(end - 1, sum - table[end - 1])));
//}

lli modInverse(lli a, lli m) {
	lli m0 = m;
	lli y = 0, x = 1;
	if (m == 1) return 0;
	while (a > 1) {
		lli q = a / m;
		lli t = m;
		m = a % m, a = t;
		t = y;
		y = x - q * y;
		x = t;
	}
	if (x < 0) x += m0;
	return x;
}

lli cst = 998244353;
lli modu(lli p, lli q) {
	return (p * modInverse(q, cst)) % cst;
}

int main() {
	int n; cin >> n;
	vector<lli> table(n), tsum(n);
	REP(i, 0, n - 1)cin >> table[i];
	sort(table.begin(), table.end());
	tsum[0] = table[0];
	REP(i, 1, n - 1) tsum[i] = (tsum[i - 1] + table[i]) ;
	REP(k, 1, n) {
		lli total = 0;
		lli i = n - k - 1;
		while (i >= 0) {
			total += tsum[i];
			total %= cst;
			i -= k;
		}
		cout << modu(total % cst, n) << " ";
	}
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
ll const M = 998244353;

ll bigmod(ll a, ll b){
    if(!b) return 1;
    ll x = bigmod(a,b/2);
    x = (x * x) % M;
    if(b&1) x = (x * a) % M;
    return x;
}
int main(){
    ios::sync_with_stdio(0); cin.tie(0);
    int n;
    cin >> n;
    vector<ll>v(n), pref(n,0);
    for(auto &x : v) cin >> x;
    sort(v.begin(), v.end(), greater<ll>());
    for(int i = 0; i < n; i++) pref[i] = (i?pref[i-1]:0) + v[i] ;
    ll ans = 0;
    for(int k = 1; k <= n; k++){
        ans = 0;
        for(int j = k; j < n; j += k){
            ll r = min(n,j + k), l = j;
            ans += (pref[r-1] - pref[l-1]) * (j/k);
        }
        cout << ans * bigmod(n,M-2) % M << " " ;
    }
    cout << endl;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
ll const M = 998244353;

ll bigmod(ll a, ll b){
    if(!b) return 1;
    ll x = bigmod(a,b/2);
    x = (x * x) % M;
    if(b&1) x = (x * a) % M;
    return x;
}
int main(){
    ios::sync_with_stdio(0); cin.tie(0);
    int n;
    cin >> n;
    vector<ll>v(n), pref(n,0);
    for(auto &x : v) cin >> x;
    sort(v.begin(), v.end(), greater<ll>());
    for(int i = 0; i < n; i++) pref[i] = (i?pref[i-1]:0) + v[i] ;
    ll ans = 0;
    for(int k = 1; k <= n; k++){
        ans = 0;
        for(int j = k; j < n; j += k){
            ll r = min(n,j + k), l = j;
            ans += (pref[r-1] - pref[l-1]) * (j/k);
        }
        ans %= M;
        cout << ans * bigmod(n,M-2) % M << " " ;
    }
    cout << endl;
}


///In the name of GOD
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll MXN = 6e5 + 10;
const ll Mod = 998244353;
ll power(ll a, ll b){
    return(!b ? 1 : (power(a * a % Mod, b / 2) * (b & 1LL ? a : 1)) % Mod);
}
ll inv(ll x){ return power(x, Mod - 2);}
ll n, ans;
ll A[MXN], ps[MXN];
int main(){
    ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i ++) cin >> A[i];
    sort(A + 1, A + n + 1, greater<ll>());
    for(int i = 1; i <= n * 2; i ++) ps[i] = ps[i - 1] + A[i];
    for(int k = 1; k <= n; k ++){
        ll t = n - k, sz = t / k, l = k + 1, r;
        t -= sz, ans = 0;
        for(int i = 1; i <= sz; i ++){
            r = l + k - 1;
            ans = (ans + (i * (((ps[r] - ps[l - 1]) % Mod + Mod) % Mod) % Mod)) % Mod;
            l = r + 1;
        }
        r = l + t - 1;
        ans = (ans + ((sz + 1) * (((ps[r] - ps[l - 1]) % Mod + Mod) % Mod) % Mod)) % Mod;
        cout << ans * inv(n) % Mod << ' ';
    }
    cout << '\n';
    return 0;
}
/*!
    I CHOOSE TO HAVE FAITH,
    BECAUSE WITHOUT THAT,
    I HAVE NOTHING....
    ITS THE ONLY THING THAT'S KEEPING ME GOING.
*/
//! N.N


///In the name of GOD
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll MXN = 3e5 + 10;
const ll Mod = 998244353;
ll power(ll a, ll b){
    return(!b ? 1 : (power(a * a % Mod, b / 2) * (b & 1LL ? a : 1)) % Mod);
}
ll inv(ll x){ return power(x, Mod - 2);}
ll n, ans;
ll A[MXN], ps[MXN];
int main(){
    ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i ++) cin >> A[i];
    sort(A + 1, A + n + 1, greater<ll>());
    for(int i = 1; i <= n + 5; i ++) ps[i] = ps[i - 1] + A[i];
    for(int k = 1; k <= n; k ++){
        ll t = n - k, sz = t / k, l = k + 1, r;
        t -= sz, ans = 0;
        for(int i = 1; i <= sz; i ++){
            r = l + k - 1;
            ans = (ans + (i * (((ps[r] - ps[l - 1]) % Mod + Mod) % Mod) % Mod)) % Mod;
            l = r + 1;
        }
        r = l + t - 1;
        ans = (ans + ((sz + 1) * (((ps[r] - ps[l - 1]) % Mod + Mod) % Mod) % Mod)) % Mod;
        cout << ans * inv(n) % Mod << ' ';
    }
    cout << '\n';
    return 0;
}
/*!
    I CHOOSE TO HAVE FAITH,
    BECAUSE WITHOUT THAT,
    I HAVE NOTHING....
    ITS THE ONLY THING THAT'S KEEPING ME GOING.
*/
//! N.N


#include <iostream>
#include <algorithm>
using namespace std;

int st(int n,int a)
{
    if(a==0) return 1;
    long long q=st(n,a/2);
    q=q*q;
    if(a%2==1) q=q*n;
    q=q%998244353;
    return q;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >>n;
    int a[n];
    for(int i=0;i<n;i++) cin >>a[i];
    sort(a,a+n);
    int b[n+1];b[0]=0;
    for(int i=1;i<=n;i++)b[i]=(a[i-1]+b[i-1])%998244353;
    int res[n+1];
    for(int i=0;i<=n;i++) res[i]=0;
    for(int i=1;i<n;i++)
    {
        for(int j=1;j*j<=i;j++)
        {
            if(i%j==0)
            {
                res[j]=(res[j]+b[n-i])%998244353;
                if(j*j!=i) res[i/j]=(res[i/j]+b[n-i])%998244353;
            }
        }
    }
    long long pr=st(n,998244351);
    for(int i=1;i<=n;i++) {long long sey=res[i];sey*=pr;cout<< sey%998244353<<' ';}
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int st(int n,int a)
{
    if(a==0) return 1;
    long long q=st(n,a/2);
    q=q*q;
    q=q%998244353;
    if(a%2==1) q=q*n;
    q=q%998244353;
    return q;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >>n;
    int a[n];
    for(int i=0;i<n;i++) cin >>a[i];
    sort(a,a+n);
    int b[n+1];b[0]=0;
    for(int i=1;i<=n;i++)b[i]=(a[i-1]+b[i-1])%998244353;
    int res[n+1];
    for(int i=0;i<=n;i++) res[i]=0;
    for(int i=1;i<n;i++)
    {
        for(int j=1;j*j<=i;j++)
        {
            if(i%j==0)
            {
                res[j]=(res[j]+b[n-i])%998244353;
                if(j*j!=i) res[i/j]=(res[i/j]+b[n-i])%998244353;
            }
        }
    }
    long long pr=st(n,998244351);
    for(int i=1;i<=n;i++) {long long sey=res[i];sey*=pr;cout<< sey%998244353<<' ';}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;

signed main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(0); cin.tie(0);

    const int MOD = 998244353;
    auto binpow = [&](ll a, ll p) {
        ll res = 1;
        for (; p; a = a * a % MOD, p >>= 1) if (p & 1) res = res * a % MOD;
        return res;
    };
    auto rev = [&](int a) {
        return binpow(a, MOD - 2);
    };

    int n;
    while (cin >> n) {
        vector<int> c(n);
        for (auto &e : c) cin >> e;
        sort(c.begin(), c.end(), greater<>());
        vector<ll> pref(n + 1);
        for (int i = 0; i < n; ++i) {
            pref[1 + i] = (pref[i] + c[i]) % MOD;
        }
        auto getsum = [&](int l, int r) {
            r = min(r, n - 1);
            return (MOD + pref[1 + r] - pref[l]) % MOD;
        };
        vector<int> res;
        int revn = rev(n);
        for (int k = 1; k <= n; ++k) {
            ll cur = 0;
            for (int i = k, j = 1; i < n; i += k, ++j) {
                cur = (cur + j * getsum(i, i + k - 1)) % MOD;
            }
            res.push_back(cur * revn % MOD);
        }

        for (auto e : res) cout << e << " ";
        cout << "\n";
    }
}


#include <bits/stdc++.h>
#define pb push_back
#define se second
#define fi first
#define iinf INT_MAX
#define llinf LLONG_MAX
using namespace std;
using ll = long long;
using i2 = pair<int, int>;
using ll2 = pair<ll, ll>;

const int N = 3e5+9;
const int M = 998244353;
int C[N];

bool bfr(int a, int b) {
    return a > b;
}

inline int add(int a, int b) {
    int res = a+b;
    if(res >= M) res -= M;
    return res;
}

inline int mult(ll a, ll b) {
    return a*b % M;
}

int bin_pow(int a, int n) {
    int res = 1;
    while(n) {
        if(n & 1)
            res = mult(res, a);
        a = mult(a, a);
        n >>= 1;
    }
    return res;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n; cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> C[i];
    sort(C+1, C+n+1, bfr);
    for(int i = n-1; i >= 1; i--)
        C[i] = add(C[i], C[i+1]);
    int inv = bin_pow(n, M-2);
    for(int k = 1; k <= n; k++) {
        int e = 0;
        for(int i = k+1; i <= n; i += k)
            e = add(e, C[i]);
        cout << mult(e, inv) << " ";
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10;
const int mod = 998244353;
void plusle (int &a, int b) {
    if (( a += b) >= mod ) a -= mod ;
}
void minun (int &a, int b) {
    if ((a -= b) < 0) a += mod ;
}
int add (int a, int b) {
    return (( a += b ) >= mod ) ? a - mod  : a;
}
int sub (int a, int b) {
    return (( a -= b) < 0) ? a + mod : a;
}
int mul (int a, int b) {
    return 1LL * a * b % mod;
}
int power (int a, int b) {
    int res = 1;
    for (; b > 0 ; b >>= 1 , a = mul(a, a))
        if (b & 1) res = mul(res, a);
    return res ;
}

int a[nax];
int n;

int main () {
    scanf("%d", &n);

    for (int i = 0 ; i < n; ++ i)
        scanf("%d", a + i);
    sort(a, a + n, greater<int>());

    for (int i = 1 ; i < n ; ++ i) {
        a[i] = add(a[i], a[i - 1]);
    }

    /**
        try brute force
    */

    int inv_n = power(n, mod - 2);

    for (int k = 1 ; k <= n ; ++ k) {
        int ans = 0, from = a[k - 1];
        for (int i = k, j = 1 ; i < n ; i += k, ++ j) {
            int to = min(n - 1, i + k - 1);

            int cur = sub(a[to], from);
            from = a[to];
            ans = add(ans, mul(j, cur));
        }
        printf("%d ", mul(ans, inv_n));
        //printf("%d ", mul(ans, inv_n));
    }
}
/*
    Rorona is not childish.
*/


#include<bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10;
const int mod = 998244353;
void plusle (int &a, int b) {
    if (( a += b) >= mod ) a -= mod ;
}
void minun (int &a, int b) {
    if ((a -= b) < 0) a += mod ;
}
int add (int a, int b) {
    return (( a += b ) >= mod ) ? a - mod  : a;
}
int sub (int a, int b) {
    return (( a -= b) < 0) ? a + mod : a;
}
int mul (int a, int b) {
    return 1LL * a * b % mod;
}
int power (int a, int b) {
    int res = 1;
    for (; b > 0 ; b >>= 1 , a = mul(a, a))
        if (b & 1) res = mul(res, a);
    return res ;
}

int a[nax + nax];
int n;

int main () {
    scanf("%d", &n);

    for (int i = 0 ; i < n; ++ i)
        scanf("%d", a + i);
    sort(a, a + n, greater<int>());

    for (int i = 1 ; i < n + n ; ++ i) {
        a[i] = add(a[i], a[i - 1]);
    }

    /**
        try brute force
    */

    int inv_n = power(n, mod - 2);

    for (int k = 1 ; k <= n ; ++ k) {
        int ans = 0, from = a[k - 1];
        for (int i = k, j = 1 ; i < n ; i += k, ++ j) {
            int to = min(n - 1, i + k - 1);

            int cur = sub(a[to], from);
            from = a[to];
            ans = add(ans, mul(j, cur));
        }
        printf("%d ", mul(ans, inv_n));
        //printf("%d ", mul(ans, inv_n));
    }
}
/*
    Rorona is not childish.
*/


#include<bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10;
const int mod = 998244353;
void plusle (int &a, int b) {
    if (( a += b) >= mod ) a -= mod ;
}
void minun (int &a, int b) {
    if ((a -= b) < 0) a += mod ;
}
int add (int a, int b) {
    return (( a += b ) >= mod ) ? a - mod  : a;
}
int sub (int a, int b) {
    return (( a -= b) < 0) ? a + mod : a;
}
int mul (int a, int b) {
    return 1LL * a * b % mod;
}
int power (int a, int b) {
    int res = 1;
    for (; b > 0 ; b >>= 1 , a = mul(a, a))
        if (b & 1) res = mul(res, a);
    return res ;
}

int a[nax + nax];
int n;

int main () {
    scanf("%d", &n);

    for (int i = 0 ; i < n; ++ i)
        scanf("%d", a + i);
    sort(a, a + n);

    for (int i = 1 ; i < n + n ; ++ i) {
        a[i] = add(a[i], a[i - 1]);
    }

    /**
        try brute force
    */

    int inv_n = power(n, mod - 2);

    for (int k = 1 ; k <= n ; ++ k) {
        int ans = 0, from = 0;
        for (int i = 0, j = 1 ; i < n - k ; i += k, ++ j) {
            int to = min(n - k - 1, i + k - 1);
            int cur = sub(a[to], from);
            from = a[to];
            ans = add(ans, mul(j, cur));
        }
        printf("%d ", mul(ans, inv_n));
    }
}
/*
    Rorona is not childish.
*/


#include<bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10;
const int mod = 998244353;
void plusle (int &a, int b) {
    if (( a += b) >= mod ) a -= mod ;
}
void minun (int &a, int b) {
    if ((a -= b) < 0) a += mod ;
}
int add (int a, int b) {
    return (( a += b ) >= mod ) ? a - mod  : a;
}
int sub (int a, int b) {
    return (( a -= b) < 0) ? a + mod : a;
}
int mul (int a, int b) {
    return 1LL * a * b % mod;
}
int power (int a, int b) {
    int res = 1;
    for (; b > 0 ; b >>= 1 , a = mul(a, a))
        if (b & 1) res = mul(res, a);
    return res ;
}

int a[nax];
int n;

int main () {
    scanf("%d", &n);

    for (int i = 0 ; i < n; ++ i)
        scanf("%d", a + i);
    sort(a, a + n);

    /**
        try brute force
    */

    int inv_n = power(n, mod - 2);

    for (int k = 1 ; k <= n ; ++ k) {
        static int sum[nax];
        fill(sum, sum + k, 0);
        int cur = 0;
        for (int i = 0 ; i < n - k; ++ i) {
            plusle(sum[i % k], a[i]);
            plusle(cur, sum[i % k]);
        }

        printf("%d ", mul(cur, inv_n));
    }
}
/*
    Rorona is not childish.
*/


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

template <long long mod>
struct modular {
    long long value;
    modular(long long x = 0LL) {
        value = x % mod;
        if (value < 0LL) value += mod;
    }
    modular& operator+=(modular other) {
        if ((value += other.value) >= mod) value -= mod;
        return *this;
    }
    modular& operator-=(modular other) {
        if ((value -= other.value) < 0LL) value += mod;
        return *this;
    }
    modular& operator*=(modular other) {
        value = value * other.value % mod;
        return *this;
    }
    modular& operator/=(modular other) {
        long long a = 0LL, b = 1, c = other.value, m = mod;
        while (c != 0LL) {
            long long t = m / c;
            m -= t * c;
            swap(c, m);
            a -= t * b;
            swap(a, b);
        }
        a %= mod;
        if (a < 0LL) a += mod;
        value = value * a % mod;
        return *this;
    }
    modular operator-() { return modular(-value); }
    modular operator+(modular rhs) { return modular(*this) += rhs; }
    modular operator-(modular rhs) { return modular(*this) -= rhs; }
    modular operator*(modular rhs) { return modular(*this) *= rhs; }
    modular operator/(modular rhs) { return modular(*this) /= rhs; }
    bool operator==(modular rhs) { return value == rhs.value; }
    bool operator!=(modular rhs) { return value != rhs.value; }
    bool operator<(modular rhs) { return value < rhs.value; }
};
template <long long mod>
string to_string(modular<mod> x) {
    return to_string(x.value);
}
template <long long mod>
ostream& operator<<(ostream& stream, modular<mod> x) {
    x.value %= mod;
    if (x.value < 0LL) x.value += mod;
    return stream << x.value;
}
template <long long mod>
istream& operator>>(istream& stream, modular<mod>& x) {
    stream >> x.value;
    x.value %= mod;
    if (x.value < 0LL) x.value += mod;
    return stream;
};
const long long mod = 998244353LL;
using mint = modular<mod>;

inline mint pw(mint a, long long n) {
    mint res = 1;
    while (n > 0LL) {
        if (n & 1LL) {
            res *= a;
        }
        a *= a;
        n >>= 1;
    }
    return res;
}
vector<mint> fact, finv;
inline void cinit(int n) {
    fact.resize(n, mint(1));
    finv.resize(n, mint(1));
    for (int i = 2; i < n; i++) {
        fact[i] = fact[i - 1] * i;
    }
    finv[n - 1] /= fact[n - 1];
    for (int i = n - 2; i >= 2; i--) {
        finv[i] = finv[i + 1] * (i + 1);
    }
}
inline mint C(int n, int k) {
    if (n < k || k < 0 || n < 0) {
        return mint(0LL);
    }
    return fact[n] * finv[k] * finv[n - k];
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<long long> c(n);
    for (int i = 0; i < n; i++) {
        cin >> c[i];
    }
    sort(c.begin(), c.end());
    vector<long long> s = c;
    for (int i = 1; i < n; i++) {
        s[i] += s[i - 1];
    }
    for (int i = 1; i <= n; i++) {
        mint res = 0;
        for (int j = n - 1 - i; j >= 0; j -= i) {
            res += s[j];
        }
        cout << res / n << " ";
    }
    cout << '\n';
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const ll mod=998244353;

ll fpow(ll b,ll e)
{
    ll res=1;
    while(e)
    {
        if(e&1) res=(res*b)%mod;
        b=(b*b)%mod;
        e/=2;
    }
    return res;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<ll> a(n+1,0);
    for(int i=1;i<=n;i++) cin >> a[i];
    sort(a.begin()+1,a.end(),greater<ll>());
    for(int i=n-1;i>=1;i--) a[i]+=a[i+1];
    ll inv=fpow(n,mod-2);
    for(int i=1;i<=n;i++)
    {
        ll res=0;
        for(int j=i+1;j<=n;j+=i) res=(res+a[j])%mod;
        res=(res*inv)%mod;
        cout << res << " \n"[i==n];
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int maxN = 3e5 + 10, mod = 998244353;

int n;
int a[maxN + 1], s[maxN + 1];

inline int ADD(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }

inline int SUB(int x, int y) { return x - y < 0 ? x - y + mod : x - y; }

inline int mpow(int a, int x)
{
	int ans = 1;
	while(x)
	{
		if(x & 1) ans = 1ll * ans * a % mod;
		a = 1ll * a * a % mod;
		x >>= 1;
	}
	return ans;
}

int main()
{
	scanf("%d", &n);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]);

	sort(a + 1, a + n + 1);
	reverse(a + 1, a + n + 1);

	for(int i = 1; i <= n; i++) s[i] = ADD(s[i - 1], a[i] % mod);

	int INV = mpow(n, mod - 2);
	for(int i = 1; i <= n; i++)
	{
		int ans = 0;
		for(int j = 0; i * j < n; j++)
			ans = ADD(ans, 1ll * j * SUB(s[ min(n, (j + 1) * i) ], s[j * i]) % mod);
		ans = 1ll * ans * INV % mod;
		printf("%d%c", ans, " \n"[i == n]);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const int NMAX = 300005;
long long a[NMAX],sp[NMAX],n;
long long lgput(long long n,long long p)
{
    long long rasp=1;
    while(p!=0)
    {
        if(p%2==1) rasp=(1LL*rasp*n)%MOD;
        n=(1LL*n*n)%MOD;
        p/=2;
    }
    return rasp;
}
int main()
{
    cin >> n;
    for(int i=1;i<=n;i++) cin >> a[i];
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++) sp[i]=sp[i-1]+a[i];
    long long inv=lgput(n,MOD-2);
    for(int i=1;i<=n;i++){
        long long rasp=0;
        for(int j=n-i;j>=1;j-=i) rasp=(rasp+sp[j])%MOD;
        cout << (rasp*inv)%MOD << ' ';
    }
    return 0;
}


#include <iostream>
#include <set>
#include <map>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <climits>
#include <math.h>
#include <cassert>
#include <unordered_map>
#include <chrono>
#include <random>
#include <ctime>
using namespace std;
#pragma warning(disable : 4996)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const ld PI = 3.14159265358979323846;
const ll MOD = 998244353;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

ll pw(ll a, ll p) {
	ll res = 1;
	while (p > 0) {
		if (p & 1) {
			res = (res * a) % MOD;
		}
		a = (a * a) % MOD;
		p /= 2;
	}
	return res;
}

int main() {
#ifdef _DEBUG
	freopen("input1.txt", "r", stdin);
	freopen("output2.txt", "w", stdout);
#endif
	srand(time(0));
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<ll> a(n), pref(n);
	for (int i = 0; i < n; i++)cin >> a[i];
	sort(a.rbegin(), a.rend());
	for (int i = 0; i < n; i++) {
		pref[i] = a[i];
		if (i)pref[i] += pref[i - 1];
		pref[i] %= MOD;
	}
	ll den = pw(n, MOD - 2);
	for (int k = 1; k <= n; k++) {
		ll cf = 0, s = 0;
		for (int j = k - 1; j < n; j += k) {
			ll temp = pref[j] - (j - k >= 0 ? pref[j - k] : 0);
			temp = (temp + MOD) % MOD;
			s = (s + temp * cf) % MOD;
			cf++;
		}
		if (n % k != 0) {
			ll temp = pref[n - 1] - pref[n - 1 - n % k];
			temp = (temp + MOD) % MOD;
			s = (s + temp * cf) % MOD;
		}
		ll ans = den * s % MOD;
		cout << ans << " ";
	}

}


#include <iostream>
#include <set>
#include <map>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <climits>
#include <math.h>
#include <cassert>
#include <unordered_map>
#include <chrono>
#include <random>
#include <ctime>
using namespace std;
#pragma warning(disable : 4996)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const ld PI = 3.14159265358979323846;
const ll MOD = 998244353;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

ll pw(ll a, ll p) {
	ll res = 1;
	while (p > 0) {
		if (p & 1) {
			res = (res * a) % MOD;
		}
		a = (a * a) % MOD;
		p /= 2;
	}
	return res;
}

int main() {
#ifdef _DEBUG
	freopen("input1.txt", "r", stdin);
	freopen("output2.txt", "w", stdout);
#endif
	srand(time(0));
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<ll> a(n), pref(n);
	for (int i = 0; i < n; i++)cin >> a[i];
	sort(a.rbegin(), a.rend());
	for (int i = 0; i < n; i++) {
		pref[i] = a[i];
		if (i)pref[i] += pref[i - 1];
		pref[i] %= MOD;
	}
	ll den = pw(n, MOD - 2);
	for (int k = 1; k <= n; k++) {
		ll cf = 0, s = 0;
		for (int j = k - 1; j < n; j += k) {
			ll temp = pref[j] - (j - k >= 0 ? pref[j - k] : 0);
			s = (s + temp * cf) % MOD;
			cf++;
		}
		if (n % k != 0) {
			ll temp = pref[n - 1] - pref[n - 1 - n % k];
			s = (s + temp * cf) % MOD;
		}
		ll ans = den * s % MOD;
		cout << ans << " ";
	}

}


#include <bits/stdc++.h>
using namespace std;

long long a[300005], ps[300005], n, temp, dsor;
const long long mod = 1e9 + 7;

long long bigmod(long long b, long long p) {
    long long res = 1;
    while(p) {
        if (p % 2) {
            res *= b;
            res %= mod;
        }
        b *= b;
        b %= mod;
        p /= 2;
    }
    return res;
}

long long divi(long long b, long long c) {
    return (b * bigmod(c, mod - 2)) % mod;
}

int main() {
    cin >> n;
    vector<long long> v;
    for (int i = 1; i <= n; i++) {
        cin >> temp;
        v.push_back(temp);
    }
    sort(v.rbegin(), v.rend());
    for (int i = 1; i <= n; i++) {
        a[i] = v[i - 1];
        ps[i] = ps[i - 1] + a[i];
    }
    dsor = divi(1, n);
    for (long long i = 1; i <= n; i++) {
        long long ans = 0;
        for (long long j = i; j < n; j += i) {
            ans = (ans + ps[n] - ps[j]) % mod;
        }
        ans = (ans * dsor) % mod;
        cout << ans;
        if (i != n) cout << " ";
        else cout << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

long long a[300005], ps[300005], n, temp, dsor;
const long long mod = 1e9 + 7;

long long bigmod(long long b, long long p) {
    long long res = 1;
    while(p) {
        if (p % 2) {
            res *= b;
            res %= mod;
        }
        b *= b;
        b %= mod;
        p /= 2;
    }
    return res;
}

long long divi(long long b, long long c) {
    return (b * bigmod(c, mod - 2)) % mod;
}

int main() {
    cin >> n;
    vector<long long> v;
    for (int i = 1; i <= n; i++) {
        cin >> temp;
        v.push_back(temp);
    }
    sort(v.rbegin(), v.rend());
    for (int i = 1; i <= n; i++) {
        a[i] = v[i - 1];
        ps[i] = ps[i - 1] + a[i];
    }
    dsor = divi(1, n);
    for (long long i = 1; i <= n; i++) {
        long long ans = 0;
        for (long long j = 0; j < n; j += i) {
            ans = (ans + ps[n] - ps[j]) % mod;
        }
        ans = (ans * dsor) % mod;
        cout << ans;
        if (i == n) cout << " ";
        else cout << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

long long a[300005], ps[300005], n, temp, dsor;
const long long mod = 998244353;

long long bigmod(long long b, long long p) {
    long long res = 1;
    while(p) {
        if (p % 2) {
            res *= b;
            res %= mod;
        }
        b *= b;
        b %= mod;
        p /= 2;
    }
    return res;
}

long long divi(long long b, long long c) {
    return (b * bigmod(c, mod - 2)) % mod;
}

int main() {
    cin >> n;
    vector<long long> v;
    for (int i = 1; i <= n; i++) {
        cin >> temp;
        v.push_back(temp);
    }
    sort(v.rbegin(), v.rend());
    for (int i = 1; i <= n; i++) {
        a[i] = v[i - 1];
        ps[i] = ps[i - 1] + a[i];
    }
    dsor = divi(1, n);
    for (long long i = 1; i <= n; i++) {
        long long ans = 0;
        for (long long j = i; j < n; j += i) {
            ans = (ans + ps[n] - ps[j]) % mod;
        }
        ans = (ans * dsor) % mod;
        cout << ans;
        if (i != n) cout << " ";
        else cout << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 998244353

long long gcd(long long a, long long b, long long& x, long long& y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long x1, y1;
    long long d = gcd(b, a % b, x1, y1);
    x = y1;
    y = x1 - y1 * (a / b);
    return d;
}

long long inverse(long long n, long long m){
    long long x, y;
    long long g = gcd(n,m, x, y);
    return (x%m+m)%m;
}

int main(){
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n; cin >> n;
    int arr[n+1];
    for(int i = 0; i<n; i++) cin >> arr[i+1];
    sort(arr+1, arr+n+1);
    long long sum[n+1];
    sum[0] = 0ll;
    for(int i = 1; i<=n; i++) sum[i] = sum[i-1]+arr[i];
    for(int k = 1; k<=n; k++){
        long long ans = 0;
        for(int kk = 1; kk<=ceil((n-k+0.0)/k); kk++){
            int cur1 = n-kk*k;
            int cur2 = n-(kk+1)*k;
            ans += kk*(sum[cur1]-sum[max(0, cur2)]);
        }
        // cout << ans << endl;
        ans %= MOD;
        ans = (ans * inverse(n, MOD))%MOD;
        cout << ans << endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll lp = 998244353;
int n;
ll p,q;
vector<int>val;

ll pow(ll x, ll p){
	if (p == 1) return x;
	ll hf = pow(x,p/2);

	if (p % 2) return ((hf*hf) % lp)*x % lp;
	return (hf*hf) % lp;
}
ll inv(ll x){
	return pow(x,lp-2);
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	cin >> n;
	val = vector<int>(n+1);
	for (int i=1; i<=n; i++) cin >> val[i];
	val[0] = 0;
	sort(val.begin()+1, val.end(), greater<int>());
	for (int i=1; i<=n; i++) val[i] = (val[i-1] + val[i]) % lp; //prefix sum

	//for (int i=0; i<=n; i++) cout << val[i] << " ";
	//cout << endl;

	int seg,fin,idx,times;
	ll q = inv(n);
	for (int i=1; i<=n; i++){
		seg = min(i,n-i);
		//len = (n-seg-1)/seg+1;
		idx = i;
		p = 0;
		times = -1;
		while (idx < n){
			times++;
			if (idx + seg <= n){
				ll add = (ll)times*((val[idx+seg] - val[idx] + lp) % lp) % lp;
				p = (p + add) % lp;
				idx += seg;
			}else{
				ll add = (ll)times*((val[n] - val[idx] + lp) % lp) % lp;
				p = (p + add) % lp;
				idx = n;
			}
		}
		p = (p+val[n]-val[i]+lp) % lp;
		cout << (p*q)%lp << " ";
	}
	cout << endl;
	//cout << inv(2) << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll lp = 998244353;
int n;
ll p,q;
vector<int>val;

ll pow(ll x, ll p){
	if (p == 1) return x;
	ll hf = pow(x,p/2);

	if (p % 2) return ((hf*hf) % lp)*x % lp;
	return (hf*hf) % lp;
}
ll inv(ll x){
	return pow(x,lp-2);
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	cin >> n;
	val = vector<int>(n+1);
	for (int i=1; i<=n; i++) cin >> val[i];
	val[0] = 0;
	sort(val.begin()+1, val.end(), greater<int>());
	for (int i=1; i<=n; i++) val[i] = (val[i-1] + val[i]) % lp; //prefix sum

	//for (int i=0; i<=n; i++) cout << val[i] << " ";
	//cout << endl;

	int seg,fin,idx,times;
	ll q = inv(n);
	for (int i=1; i<=n; i++){
		seg = min(i,n-i);
		//len = (n-seg-1)/seg+1;
		idx = i;
		p = 0;
		times = -1;
		while (idx < n){
			times++;
			if (idx + seg <= n){
				ll add = (ll)times*((val[idx+seg] - val[idx] + lp) % lp) % lp;
				p = (p + add) % lp;
				idx += seg;
			}else{
				ll add = (ll)times*((val[n] - val[idx] + lp) % lp) % lp;
				p = (p + add) % lp;
				idx = n;
			}
		}
		p = (p+val[n]-val[i]) % lp;
		cout << (p*q)%lp << " ";
	}
	cout << endl;
	//cout << inv(2) << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = 1000005;
const int mod = 998244353;
int a[maxn];
LL s[maxn];

LL inv(LL a, LL m)
{
    if(a == 1)return 1;
    return inv(m%a,m)*(m-m/a)%m;
}
int main(){
    int n;
    LL tot = 0;
    cin>>n;
    for (int i = 1; i <= n; ++i) {
        scanf("%d", a+i);
    }
    sort(a+1, a+n+1);
    s[0] = 0;
    for (int i = 1; i <= n; ++i) {
        tot += a[i];
        tot %= mod;
        s[i] = tot;
    }
    const LL invn = inv(n, mod);

    for (int i = 1; i <= n; ++i) {
        int j = n-i;
        LL ans = 0;
        int t = 1;
        int pre = n-i;
        for (j-=i; j >=0 ; j -= i) {
            ans += (s[pre] - s[j] + mod) * t % mod;
            //cout<<s[pre] - s[j]<<endl;
            pre = j;
            t++;
        }
        ans += (s[pre] - s[0]+mod) * t % mod;
        //cout<<ans<<endl;
        cout<<ans*invn%mod<<endl;

    }

}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = 1000005;
const int mod = 998244353;
int a[maxn];
LL s[maxn];

LL inv(LL a, LL m)
{
    if(a == 1)return 1;
    return inv(m%a,m)*(m-m/a)%m;
}
int main(){
    int n;
    LL tot = 0;
    cin>>n;
    for (int i = 1; i <= n; ++i) {
        scanf("%d", a+i);
    }
    sort(a+1, a+n+1);
    s[0] = 0;
    for (int i = 1; i <= n; ++i) {
        tot += a[i];
        tot %= mod;
        s[i] = tot;
    }
    const LL invn = inv(n, mod);

    for (int i = 1; i <= n; ++i) {
        int j = n-i;
        LL ans = 0;
        int t = 1;
        int pre = n-i;
        for (j-=i; j >=0 ; j -= i) {
            ans += (s[pre] - s[j] + mod)*1ll * t % mod;
            ans %= mod;
            //cout<<s[pre] - s[j]<<endl;
            pre = j;
            t++;
        }
        ans += (s[pre] - s[0] + mod)*1ll * t % mod;
        ans %= mod;
        //cout<<ans<<endl;
        cout<<ans*invn%mod<<endl;

    }

}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = 1000005;
const int mod = 998244353;
int a[maxn];
LL s[maxn];

LL inv(LL a, LL m)
{
    if(a == 1)return 1;
    return inv(m%a,m)*(m-m/a)%m;
}
int main(){
    int n;
    LL tot = 0;
    cin>>n;
    for (int i = 1; i <= n; ++i) {
        scanf("%d", a+i);
    }
    sort(a+1, a+n+1);
    s[0] = 0;
    for (int i = 1; i <= n; ++i) {
        tot += a[i];
        tot %= mod;
        s[i] = tot;
    }
    const LL invn = inv(n, mod);

    for (int i = 1; i <= n; ++i) {
        int j = n-i;
        LL ans = 0;
        int t = 1;
        int pre = n-i;
        for (j-=i; j >=0 ; j -= i) {
            ans += (s[pre] - s[j] + mod)*1ll * t % mod;
            //cout<<s[pre] - s[j]<<endl;
            pre = j;
            t++;
        }
        ans += (s[pre] - s[0] + mod)*1ll * t % mod;
        //cout<<ans<<endl;
        cout<<ans*invn%mod<<endl;

    }

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pll pair<ll,ll>
#define fi first
#define se second
#define MOD (ll(998244353))
ll bow (ll a, ll x)
{
	if (!x) return 1;
	ll res=bow(a,x/2);
	res*=res;
	res%=MOD;
	if (x%2) res*=a;
	return res%MOD;
}
vector<ll> buc[500001];
ll arr[500001],presum[500001];
ll n,m,i,j,k,t,u,v,a,b,res;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	for (i=1;i<=n;i++)
	{
		cin>>arr[i];
	}
	sort(arr+1,arr+n+1,[](ll a, ll b){
		return (a>b);
	});
//	for (i=1;i<=n;i++) cout<<arr[i]<<' ';cout<<endl;
	for (i=1;i<=n;i++) presum[i]=presum[i-1]+arr[i];
	for (k=1;k<=n;k++)
	{
		ll cur=0;
		for (j=1;j<=n/k;j++) cur+=(presum[j*k]-presum[j*k-k])*(j-1);
		cur+=(presum[n]-presum[j*k-k])*(j-1);
		cur%=MOD;
//		cout<<cur<<endl;
		cur*=bow(n,MOD-2);
		cur%=MOD;
		cout<<cur<<' ';
	}
}


#include <bits/stdc++.h>

using namespace std;
const int c=300002;
long long n, t[c], kom[c], inv, mod=998244353;
long long h(long long n) {
    long long ans=1, p=mod-2;
    while(p) {
        if (p%2) ans*=n, ans%=mod;
        p/=2, n*=n, n%=mod;
    }
    return ans;
}
int main()
{
    cin >> n, inv=h(n);
    for (int i=1; i<=n; i++) cin >> t[i];
    sort(t+1, t+n+1);
    for (int i=1; i<=n; i++) kom[i]=kom[i-1]+t[i];
    for (int i=1; i<n; i++) {
        long long db=n-i, sum=0, x=db%i;
        if (!x) x+=i;
        sum+=kom[x]*((db+i-1)/i);
        for (int j=(db-1)/i; j>0; j--) sum+=(kom[x+i]-kom[x])*j, x+=i, sum%=mod;
        cout << sum*inv%mod << "\n";
    }
    cout << 0 << "\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const long long c=300002;
long long n, t[c], kom[c], inv, mod=998244353;
long long h(long long n) {
    long long ans=1, p=mod-2;
    while(p) {
        if (p%2) ans*=n, ans%=mod;
        p/=2, n*=n, n%=mod;
    }
    return ans;
}
int main()
{
    cin >> n, inv=h(n);
    for (long long i=1; i<=n; i++) cin >> t[i];
    sort(t+1, t+n+1);
    for (long long i=1; i<=n; i++) kom[i]=kom[i-1]+t[i];
    for (long long i=1; i<n; i++) {
        long long db=n-i, sum=0, x=db%i;
        if (!x) x+=i;
        sum+=kom[x]*((db+i-1)/i), sum%=mod;
        for (long long j=(db-1)/i; j>0; j--) sum+=(kom[x+i]-kom[x])*j, x+=i, sum%=mod;
        cout << sum*inv%mod << "\n";
    }
    cout << 0 << "\n";
    return 0;
}


#pragma warning( disable : 4996 )
//#include <bits/stdc++.h>
#include <cstring>
#include <cstdio>
#include <numeric>
#include <random>
#include <stdio.h>
#include <vector>
#include <iostream>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <cmath>
#include <queue>
#include <algorithm>
#include <set>

using namespace std;

typedef long long ll;
typedef vector<int> vi;

class SegmentTree {                              // OOP style
private:
    int n;                                         // n = (int)A.size()
    vi A, st, lazy;                                // the arrays

    int l(int p) { return  p << 1; }                 // go to left child
    int r(int p) { return (p << 1) + 1; }              // go to right child

    int conquer(int a, int b) {
        if (a == -1) return b;                       // corner case
        if (b == -1) return a;
        return max(a, b);                            // RMQ
    }

    void build(int p, int L, int R) {              // O(n)
        if (L == R)
            st[p] = A[L];                              // base case
        else {
            int m = (L + R) / 2;
            build(l(p), L, m);
            build(r(p), m + 1, R);
            st[p] = conquer(st[l(p)], st[r(p)]);
        }
    }

    void propagate(int p, int L, int R) {
        if (lazy[p] != 0) {                         // has a lazy flag
            st[p] = st[p] + lazy[p];                           // [L..R] has same value
            if (L != R) {                          // not a leaf
                lazy[l(p)] = lazy[l(p)] == 0 ? lazy[p] : lazy[l(p)] + lazy[p];
                lazy[r(p)] = lazy[r(p)] == 0 ? lazy[p] : lazy[r(p)] + lazy[p];
            }// propagate downwards
            else {            // L == R, a single index
                A[L] = A[L] + lazy[p];
            }// time to update this
            lazy[p] = 0;                              // erase lazy flag
        }
    }

    int RMQ(int p, int L, int R, int i, int j) {   // O(log n)
        propagate(p, L, R);                          // lazy propagation
        if (i > j) return -1;                        // infeasible
        if ((L >= i) && (R <= j)) return st[p];      // found the segment
        int m = (L + R) / 2;
        return conquer(RMQ(l(p), L, m, i, min(m, j)),
            RMQ(r(p), m + 1, R, max(i, m + 1), j));
    }

    void update(int p, int L, int R, int i, int j, int val) { // O(log n)
        propagate(p, L, R);                          // lazy propagation
        if (i > j) return;
        if ((L >= i) && (R <= j)) {                  // found the segment
            lazy[p] = val;                             // update this
            propagate(p, L, R);                        // lazy propagation
        }
        else {
            int m = (L + R) / 2;
            update(l(p), L, m, i, min(m, j), val);
            update(r(p), m + 1, R, max(i, m + 1), j, val);
            int lsubtree = (lazy[l(p)] != 0) ? lazy[l(p)] + st[l(p)] : st[l(p)];
            int rsubtree = (lazy[r(p)] != 0) ? lazy[r(p)] + st[r(p)] : st[r(p)];
            st[p] = (lsubtree >= rsubtree) ? st[l(p)] : st[r(p)];
        }
    }

    void forcePropagate(int p, int L, int R) {
        st[p] = st[p] + lazy[p];                           // [L..R] has same value
        if (L != R) {                          // not a leaf
            lazy[l(p)] = lazy[l(p)] == 0 ? lazy[p] : lazy[l(p)] + lazy[p];
            lazy[r(p)] = lazy[r(p)] == 0 ? lazy[p] : lazy[r(p)] + lazy[p];
            int m = (L + R) / 2;
            forcePropagate(l(p), L, m);
            forcePropagate(r(p), m + 1, R);
        }// propagate downwards
        else {            // L == R, a single index
            A[L] = A[L] + lazy[p];
        }// time to update this
        lazy[p] = 0;
    }

public:
    SegmentTree(int sz) : n(sz), st(4 * n), lazy(4 * n, 0) {}

    SegmentTree(const vi _A) : SegmentTree((int)_A.size()) {
        A = _A;
        build(1, 0, n - 1);
    }

    void update(int i, int j, int val) { update(1, 0, n - 1, i, j, val); }

    int RMQ(int i, int j) { return RMQ(1, 0, n - 1, i, j); }

    void forcePrint() {
        forcePropagate(1, 0, n - 1);
        for (int c : A) {
            cout << c << " ";
        }
        cout << endl;
    }
};

typedef vector<ll> vl;

int lsone(int l) {
    return l & (-1 * l);
}

struct pos {
    int key;
    int value;

    bool operator < (const pos& str) const
    {
        if (value != str.value) {
            return value < str.value;
        }
        else {
            return key < str.key;
        }
    }
};

typedef pair<int, int> ii;

// Lowest Common Ancestor
/**

const int L = 20;

int n, m, T = 0;

vi ori, cur, parent, tin, tout, psum;
vector<ii> adj;
vector<vi> ancestors;

void dfs(int u, int p) {
    tin[u] = T;
    T++;
    parent[u] = p;
    ancestors[u][0] = p;
    for (int i = 1; i < L; i++) {
        ancestors[u][i] = ancestors[ancestors[u][i - 1]][i - 1];
    }
    if (u >= m) {
        int left = adj[u - m].first, right = adj[u - m].second;
        dfs(left, u);
        dfs(right, u);
    }
    tout[u] = T;
}

bool is_ancestor(int a, int b) {
    return tin[a] <= tin[b] && tout[a] >= tout[b];
}

int lca(int u, int v) {
    if (is_ancestor(u, v)) {
        return u;
    }
    if (is_ancestor(v, u)) {
        return v;
    }
    for (int i = L - 1; i >= 0; i--) {
        if (!is_ancestor(ancestors[u][i], v)) {
            u = ancestors[u][i];
        }
    }
    return parent[u];
}
**/

const ll MOD = 998244353;

ll modpow(int a, int p) {
    if (p == 0) {
        return 1;
    }
    if (p == 1) {
        return a;
    }
    ll ans = modpow(a, p / 2);
    ans = (ans * ans) % MOD;
    if (p % 2) {
        return (ans * a) % MOD;
    }
    else {
        return ans;
    }
}

ll inverse(int m) {
    return modpow(m, MOD - 2);
}

int n;
vector<ll> chests, psum;

int main() {
    cin >> n;
    chests.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> chests[i];
    }
    sort(chests.begin(), chests.end(), greater<ll>());
    psum.resize(n + 1); psum[0] = 0L;
    psum[1] = chests[0];
    for (int i = 1; i < n; i++) {
        psum[i + 1] = psum[i] + chests[i];
    }
    ll base = inverse(n);
    for (int k = 1; k < n; k++) {
        int i = k, mul = 0;
        ll ans = 0;
        for (; i <= n; i += k) {
            ans += mul * (psum[i] - psum[i - k]);
            mul++;
        }
        if (i != n) {
            ans += mul * (psum[n] - psum[i - k]);
        }
        cout << (base * ans) % MOD << " ";
    }
    cout << 0 << endl;
    return 0;
}


#pragma warning( disable : 4996 )
//#include <bits/stdc++.h>
#include <cstring>
#include <cstdio>
#include <numeric>
#include <random>
#include <stdio.h>
#include <vector>
#include <iostream>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <cmath>
#include <queue>
#include <algorithm>
#include <set>

using namespace std;

typedef long long ll;
typedef vector<int> vi;

class SegmentTree {                              // OOP style
private:
    int n;                                         // n = (int)A.size()
    vi A, st, lazy;                                // the arrays

    int l(int p) { return  p << 1; }                 // go to left child
    int r(int p) { return (p << 1) + 1; }              // go to right child

    int conquer(int a, int b) {
        if (a == -1) return b;                       // corner case
        if (b == -1) return a;
        return max(a, b);                            // RMQ
    }

    void build(int p, int L, int R) {              // O(n)
        if (L == R)
            st[p] = A[L];                              // base case
        else {
            int m = (L + R) / 2;
            build(l(p), L, m);
            build(r(p), m + 1, R);
            st[p] = conquer(st[l(p)], st[r(p)]);
        }
    }

    void propagate(int p, int L, int R) {
        if (lazy[p] != 0) {                         // has a lazy flag
            st[p] = st[p] + lazy[p];                           // [L..R] has same value
            if (L != R) {                          // not a leaf
                lazy[l(p)] = lazy[l(p)] == 0 ? lazy[p] : lazy[l(p)] + lazy[p];
                lazy[r(p)] = lazy[r(p)] == 0 ? lazy[p] : lazy[r(p)] + lazy[p];
            }// propagate downwards
            else {            // L == R, a single index
                A[L] = A[L] + lazy[p];
            }// time to update this
            lazy[p] = 0;                              // erase lazy flag
        }
    }

    int RMQ(int p, int L, int R, int i, int j) {   // O(log n)
        propagate(p, L, R);                          // lazy propagation
        if (i > j) return -1;                        // infeasible
        if ((L >= i) && (R <= j)) return st[p];      // found the segment
        int m = (L + R) / 2;
        return conquer(RMQ(l(p), L, m, i, min(m, j)),
            RMQ(r(p), m + 1, R, max(i, m + 1), j));
    }

    void update(int p, int L, int R, int i, int j, int val) { // O(log n)
        propagate(p, L, R);                          // lazy propagation
        if (i > j) return;
        if ((L >= i) && (R <= j)) {                  // found the segment
            lazy[p] = val;                             // update this
            propagate(p, L, R);                        // lazy propagation
        }
        else {
            int m = (L + R) / 2;
            update(l(p), L, m, i, min(m, j), val);
            update(r(p), m + 1, R, max(i, m + 1), j, val);
            int lsubtree = (lazy[l(p)] != 0) ? lazy[l(p)] + st[l(p)] : st[l(p)];
            int rsubtree = (lazy[r(p)] != 0) ? lazy[r(p)] + st[r(p)] : st[r(p)];
            st[p] = (lsubtree >= rsubtree) ? st[l(p)] : st[r(p)];
        }
    }

    void forcePropagate(int p, int L, int R) {
        st[p] = st[p] + lazy[p];                           // [L..R] has same value
        if (L != R) {                          // not a leaf
            lazy[l(p)] = lazy[l(p)] == 0 ? lazy[p] : lazy[l(p)] + lazy[p];
            lazy[r(p)] = lazy[r(p)] == 0 ? lazy[p] : lazy[r(p)] + lazy[p];
            int m = (L + R) / 2;
            forcePropagate(l(p), L, m);
            forcePropagate(r(p), m + 1, R);
        }// propagate downwards
        else {            // L == R, a single index
            A[L] = A[L] + lazy[p];
        }// time to update this
        lazy[p] = 0;
    }

public:
    SegmentTree(int sz) : n(sz), st(4 * n), lazy(4 * n, 0) {}

    SegmentTree(const vi _A) : SegmentTree((int)_A.size()) {
        A = _A;
        build(1, 0, n - 1);
    }

    void update(int i, int j, int val) { update(1, 0, n - 1, i, j, val); }

    int RMQ(int i, int j) { return RMQ(1, 0, n - 1, i, j); }

    void forcePrint() {
        forcePropagate(1, 0, n - 1);
        for (int c : A) {
            cout << c << " ";
        }
        cout << endl;
    }
};

typedef vector<ll> vl;

int lsone(int l) {
    return l & (-1 * l);
}

struct pos {
    int key;
    int value;

    bool operator < (const pos& str) const
    {
        if (value != str.value) {
            return value < str.value;
        }
        else {
            return key < str.key;
        }
    }
};

typedef pair<int, int> ii;

// Lowest Common Ancestor
/**

const int L = 20;

int n, m, T = 0;

vi ori, cur, parent, tin, tout, psum;
vector<ii> adj;
vector<vi> ancestors;

void dfs(int u, int p) {
    tin[u] = T;
    T++;
    parent[u] = p;
    ancestors[u][0] = p;
    for (int i = 1; i < L; i++) {
        ancestors[u][i] = ancestors[ancestors[u][i - 1]][i - 1];
    }
    if (u >= m) {
        int left = adj[u - m].first, right = adj[u - m].second;
        dfs(left, u);
        dfs(right, u);
    }
    tout[u] = T;
}

bool is_ancestor(int a, int b) {
    return tin[a] <= tin[b] && tout[a] >= tout[b];
}

int lca(int u, int v) {
    if (is_ancestor(u, v)) {
        return u;
    }
    if (is_ancestor(v, u)) {
        return v;
    }
    for (int i = L - 1; i >= 0; i--) {
        if (!is_ancestor(ancestors[u][i], v)) {
            u = ancestors[u][i];
        }
    }
    return parent[u];
}
**/

const ll MOD = 998244353;

ll modpow(int a, int p) {
    if (p == 0) {
        return 1L;
    }
    if (p == 1) {
        return (ll) a;
    }
    ll ans = modpow(a, p / 2);
    ans = (ans * ans) % MOD;
    if (p % 2) {
        return (ans * a) % MOD;
    }
    else {
        return ans;
    }
}

ll inverse(int m) {
    return modpow(m, MOD - 2);
}

int n;
vector<ll> chests, psum;

int main() {
    cin >> n;

    ll base = inverse(n);
    chests.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> chests[i];
    }
    sort(chests.begin(), chests.end(), greater<ll>());
    psum.resize(n + 1); psum[0] = 0L;
    psum[1] = chests[0];
    for (int i = 1; i < n; i++) {
        psum[i + 1] = psum[i] + chests[i];
    }
    for (int k = 1; k < n; k++) {
        int i = k, mul = 0;
        ll ans = 0;
        for (; i <= n; i += k) {
            ans = (ans + mul * (psum[i] - psum[i - k])) % MOD;
            mul++;
        }
        if (i != n) {
            ans = (ans + mul * (psum[n] - psum[i - k])) % MOD;
        }
        cout << (base * ans) % MOD << " ";
    }
    cout << 0 << endl;
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef   long long int ll;
typedef unsigned long long int sll;
typedef  long double ld;
typedef tree <int,null_type,less <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define rep(g, i, n) for (ll g = i; g < n; g++)
#define rev(g, n, i) for (ll g = n - 1; g >= i; g--)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(), v.end()
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mp make_pair

#define um unordered_multiset
#define us unordered_set
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define br break
#define rem 500009
#define PI 3.1415926535
#define INF 9223372036854775807
ll n,m,k=0,z,cnt=0,cnt1=0;
ll A=998244353;
long long int f[200005];
long long int power(long long int a, long long int b, long long int m) {
    a %= m;
    long long int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
long long int modInverse( long long int n, long long  int p)
{
    return power(n, p - 2, p);
}

void solve()
{
cin>>n;
ve<ll>a(n);
rep(i,0,n)cin>>a[i];
sort(all(a));reverse(all(a));
ve<ll>p;
p.pb(0);
rep(i,0,n){p.pb(p.back()+a[i]);}
ll x=modInverse(n,A);
rep(k,1,n+1)
{ ll cnt=0;
   ll ans=0;
   for(int i=0;i<n;i++)
   {
        ans+=( ( (p[i+k]-p[i]+A)%A )*cnt  )%A;
        ans%=A;
        cnt++;
   }
   ans*=x;ans%=A;
   cout<<ans<<endl;

}

}

int main()
{ FAST;

    ll tt=1;

///cin>>tt;

    while(tt--){
                 solve();

    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef   long long int ll;
typedef unsigned long long int sll;
typedef  long double ld;
typedef tree <int,null_type,less <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define rep(g, i, n) for (ll g = i; g < n; g++)
#define rev(g, n, i) for (ll g = n - 1; g >= i; g--)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(), v.end()
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mp make_pair

#define um unordered_multiset
#define us unordered_set
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define br break
#define rem 500009
#define PI 3.1415926535
#define INF 9223372036854775807
ll n,m,k=0,z,cnt=0,cnt1=0;
ll A=998244353;
long long int f[200005];
long long int power(long long int a, long long int b, long long int m) {
    a %= m;
    long long int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
long long int modInverse( long long int n, long long  int p)
{
    return power(n, p - 2, p);
}

void solve()
{
cin>>n;
ve<ll>a(n);
rep(i,0,n)cin>>a[i];
sort(all(a));reverse(all(a));
ve<ll>p;
p.pb(0);
rep(i,0,n){p.pb(p.back()+a[i]);}
ll x=modInverse(n,A);
rep(k,1,n+1)
{ ll cnt=0;
   ll ans=0;
   for(int i=0;i<n;i+=k)
   {
        ans+=( ( (p[min(n,i+k)]-p[i]+A)%A )*cnt  )%A;
        ans%=A;
        cnt++;
   }
   ans*=x;ans%=A;
   cout<<ans<<endl;

}

}

int main()
{ FAST;

    ll tt=1;

///cin>>tt;

    while(tt--){
                 solve();

    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 998244353;
const int maxn = 200005;
ll pm(int x, int p) {
	ll ret = 1;
	ll now = x;
	while (p) {
		if (p & 1) {
			ret *= now;
			ret %= mod;
		}
		now *= now;
		now %= mod;
		p >>= 1;
	}
	return ret;
}
void solve() {
	int n;
	cin >> n;
	vector<int>v(n);
	for (auto &i : v) {
		cin >> i;
	}
	sort(all(v));
	vector<ll>pre{0};
	for (auto &i : v) {
		pre.pb(pre.back() + i);
	}
	ll inv = pm(n, mod - 2);
	for (int i = 1 ; i <= n ; i++) {
		ll sum = 0;
		int rem = n - i;
		int gp = i;
		int sig = (rem - 1) / gp + 1;
		for (int j = 1 ; j <= sig ; j++) {
			sum += pre[rem];
			rem -= gp;

		}
		sum %= mod;
		cout << sum * inv % mod <<' ';
	}
	cout << '\n';
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int c = 0;
    int t;
    if (!c) {
        t = 1;
    }
    else {
        cin >> t;
    }
    while (t--) {
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 998244353;
const int maxn = 200005;
ll pm(int x, int p) {
	ll ret = 1;
	ll now = x;
	while (p) {
		if (p & 1) {
			ret *= now;
			ret %= mod;
		}
		now *= now;
		now %= mod;
		p >>= 1;
	}
	return ret;
}
void solve() {
	int n;
	cin >> n;
	vector<int>v(n);
	for (auto &i : v) {
		cin >> i;
	}
	sort(all(v));
	vector<ll>pre{0};
	for (auto &i : v) {
		pre.pb(pre.back() + i);
	}
	ll inv = pm(n, mod - 2);
	for (int i = 1 ; i <= n ; i++) {
		ll sum = 0;
		int rem = n - i;
		int gp = i;
		int sig = (rem - 1) / gp + 1;
		for (int j = 1 ; j <= sig ; j++) {
			sum += pre[rem];
			if (rem % gp == 0) {
				rem -= gp;
			}
			else {
				rem /= gp;
				rem *= gp;
			}
		}
		sum %= mod;
		cout << sum * inv % mod <<' ';
	}
	cout << '\n';
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int c = 0;
    int t;
    if (!c) {
        t = 1;
    }
    else {
        cin >> t;
    }
    while (t--) {
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 998244353;
const int maxn = 200005;
ll pm(int x, int p) {
	ll ret = 1;
	ll now = x;
	while (p) {
		if (p & 1) {
			ret *= now;
			ret %= mod;
		}
		now *= now;
		now %= mod;
		p >>= 1;
	}
	return ret;
}
void solve() {
	int n;
	cin >> n;
	vector<int>v(n);
	for (auto &i : v) {
		cin >> i;
	}
	sort(all(v));
	vector<ll>pre{0};
	for (auto &i : v) {
		pre.pb(pre.back() + i);
	}
	ll inv = pm(n, mod - 2);
	for (int i = 1 ; i <= n ; i++) {
		ll sum = 0;
		int rem = n - i;
		int gp = i;
		int sig = (rem - 1) / gp + 1;
		for (int j = 1 ; j <= sig ; j++) {
			sum += pre[min(j * gp, rem)];
		}
		cout << sum * inv % mod <<' ';
	}
	cout << '\n';
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int c = 0;
    int t;
    if (!c) {
        t = 1;
    }
    else {
        cin >> t;
    }
    while (t--) {
        solve();
    }
}


//#pragma GCC optimize("O3")
//#pragma GCC target("sse4,avx2,abm,fma,tune=native")
#include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES

#define FILENAME sadcactussociety

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;
typedef complex<ld> pt;

const char nl = '\n';
const ll INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll MOD = 998244353;
const ld EPS = 1e-9;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

ll power(ll n, ll e) {
  ll r = 1;
  for(;e;e/=2) {
    if(e&1) r = r*n % MOD;
    n = n*n % MOD;
  }
  return r;
}

ll inverse(ll n) {
  return power(n, MOD-2);
}

// double-check correctness
// read limits carefully
// characterize valid solutions
int main() {
  ios::sync_with_stdio(0); cin.tie(0);
  cout << fixed << setprecision(10);
/*
#ifdef ONLINE_JUDGE
  freopen(FILENAME ".in", "r", stdin);
  freopen(FILENAME ".out", "w", stdout);
#endif
*/

  int n;
  cin >> n;
  vector<ll> a(2*n);
  for(int i=0; i<n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end(), greater<int>());
  vector<ll> s(2*n+1);
  partial_sum(a.begin(), a.end(), s.begin() + 1);

  for(int k=1; k<=n; k++) {
    //cerr<<"DO "<<k<<nl;
    ll ans = 0;
    for(int i=0; i*k<n; i++) {
      ans = (ans + i * ((s[i*k+k] - s[i*k]) % MOD)) % MOD;
      //cerr<<"add "<<i<<" * "<<s[i*k+k]-s[i*k]<<nl;
    }
    //cerr << ans << nl;
    ans = ans * inverse(n) % MOD;
    cout << ans << " ";
  }
  cout << nl;

  return 0;
}