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

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

#define N 500007

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



    ll n,k,x;
    cin >> n >> k >> x;

    vi p(n);
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }

    vi prefix(n+1);
    vi curr(k);

    prefix[0] = 0;
    for (int i = 0; i < n; i++) {
        prefix[i+1] = prefix[i] + p[i];
    }
    for (int i = 0; i <= n-k; i++) {
        for (int j = 0; j < k; j++) {
            curr[j] = prefix[i+k] - prefix[i+j+1];


        }
        sort(curr.rbegin(), curr.rend());
        ll sum = prefix[i+k] - prefix[i];
        for (int j = 1; j < x; j++) {

            //cout << sum << ' ';
            sum += curr[j-1];
            //cout << '\n';
        }
        cout << sum << ' ';
    
    cout << '\n';
    }
}