#include <iostream>
#include <bits/stdc++.h>

using namespace std;

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

    int n, k, x;
    cin >> n >> k >> x;
    vector<long long> b(n), pref(n+1, 0);
    bool p = true;

    for(int i = 0; i < n; i++){
        cin >> b[i];
        if(b[i] < 0) p = false;
        pref[i+1] = pref[i]+b[i];
    }

    if(p){
        long long a = 0;
        for(int i = 0; i < n-k+1; i++){
            if(i == 0){
                for(int j = 0; j < x; j++){
                    a += pref[i+k]-pref[i+j];
                }
            }
            else{
                a -= (pref[i+k-1] - pref[i-1]);
                a += x*b[i+k-1];
            }

            cout << a << " ";
        }
    }
    else{
        for(int i = 0; i < n-k+1; i++){
            long long a = pref[i+k]-pref[i];
            vector<long long> d;
            for(int j = i+1; j < i+k; j++){
                d.push_back(pref[i+k]-pref[j]);
            }
            d.push_back(0);
            sort(d.begin(), d.end());

            for(int j = 0; j < x-1; j++){
                a += d[d.size()-1-j];
            }

            cout << a << " ";
        }
    }

    return 0;
}