#include <bits/stdc++.h>

using namespace std;

bool sort_func(const pair<long long, int>& a, const pair<long long, int>& b){

    return a.first>b.first;
}

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

    int n,x,k;

    cin>>n>>k>>x;

    vector<long long> a(n);
    vector<long long> psum(n);

    cin>>a[0];
    psum[0] = a[0];

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



    for(int i = 0;i<n-k+1;i++){

        vector<pair<long long, int>> q;

        for(int j = i;j<i+k;j++){
            long long desno = 0;
            if(j+1 < n){
                desno = psum[i+k-1] - psum[j];
            }

            q.push_back({desno,j});
        }

        sort(q.begin(),q.end(),sort_func);

        vector<int> indeksi;
        for(int j=0;j<x;j++){
            indeksi.push_back(q[j].second);
        }

        long long sum = 0;
        int c = 1;
        int st = 0;
        for(int j = i;j<i+k;j++){
            sum += a[j]*c;
            if(indeksi[st] == j && c<x){
                c++;
                st++;
            }
        }
        cout<<sum<<' ';

    }

    return 0;
}