#include <bits/stdc++.h>

using namespace std;

long long min(vector<long long> &p, int l, int d){
    long long minm = p[l];
    for (int i = l; i < d; i++){
        if (p[i] < minm)minm = p[i];
    }

    return minm;
}

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

    int n, k, x; cin >> n >> k >> x;
    long long a = 0;    
    long long c = 1;
    vector<long long> p;
    vector<long long> sume;

    for (int i = 0; i < n; i++){
        int suma = 0;
        long long g; cin >> g; suma += g;
        p.push_back(g); sume.push_back(suma);}


    for (int i = 0; i < n + 1 - k; i++){
        long long zbir = 0;
        for (int j = i; j < i + k; j++){
            //cout << "trenutni broj je: " << p[j] << " c je: " << c << " min je: " << min(p, i, i + k) << '\n';
            zbir += p[j] * c; 
            if (j < i + k - 1 && p[j] < 0 && p[j + 1] >= 0 && c <= x)c++;
            else if (p[j] == min(p, i, i + k) && c <= x)c++; 
        }
        cout << zbir << " ";
        c = 1;
        zbir = 0;
    }

    return 0;
}