#include <iostream>
#include <vector>
#include <queue>
#define ll long long
using namespace std;

vector<vector<int>> vq;

// range od 1 do n
// k = c
void combBezP(int n, int k, int start, vector<int>& curr) {
    if (curr.size() == k) {
        vector<int> cq;
        for (int x : curr) cq.push_back(x);
        vq.push_back(cq);
        return;
    }

    for (int i=start; i<=n; i++) {
        curr.push_back(i);
        combBezP(n, k, i+1, curr);
        curr.pop_back();
    }
}

int main()
{
    int n, x, k;
    scanf("%d %d %d", &n, &k, &x);
    ll a[n];
    for (int i=0; i<n; i++) {
        scanf("%lld", &a[i]);
    }



    if (x == 1) {
        vector<int> tempv;
        tempv.push_back(k);
        vq.push_back(tempv);
    } else {
        vector<int> curr;
        combBezP(k, x-1, 1, curr); // sta ako x == 1?
    }

    for (int l=0; l<n; l++) {
        int r = l+k-1;
        if (r>=n) break;
        ll maxs = -1000000001;
        for (auto q : vq) {
            ll s = 0;
            ll c = 1; // ll?
            int qfront = 0;
            for (int i=l; i<=r; i++) {
                s += c*a[i];
                if (i+1 == l+q[qfront]) {
                    c++;
                    qfront++;
                }

            }
            if (s > maxs) maxs = s;
        }
        printf("%lld ", maxs);

    }


    return 0;
}