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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, k, x;
    cin >> n >> k >> x;

    vector<long long> p(n);
    for (int i = 0; i < n; i++)
        cin >> p[i];

    for (int start = 0; start + k <= n; start++) {

        vector<long long> b(k);
        for (int i = 0; i < k; i++)
            b[i] = p[start + i];

        long long base = 0;
        for (long long v : b)
            base += v;

        vector<long long> gain;
        long long suffix = 0;

        // suffix sums
        for (int i = k - 1; i >= 1; i--) {
            suffix += b[i];
            gain.push_back(suffix);
        }

        sort(gain.begin(), gain.end(), greater<long long>());

        long long ans = base;
        for (int i = 0; i < x - 1 && i < (int)gain.size(); i++)
            ans += gain[i];

        cout << ans << " ";
    }

    cout << "\n";
    return 0;
}