#include <iostream>
#include <vector>
#include <queue>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n, k, x;
    cin >> n >> k>>x;
    vector<long long>v(n);
    
    for (int i = 0; i < n; i++) {
        cin >> v[i];
        //q.push(make_pair(v[i],i));
    }
    /*while (!q.empty()) {
        long long c = q.top().first;
        int j = q.top().second;
        q.pop(); cout << c <<" "<<j<< endl;
    }*/
    vector<long long>suf(n+1,0);
    suf[n - 1] = v[n - 1];
    for (int i = n - 2; i > -1; i--) {
        suf[i] += suf[i + 1] + v[i];
    }
    vector<long long>res(k);
    for (int i = 0; i <= n - k; i++) {
        long long sum = suf[i]-suf[i+k];
        priority_queue<long long>q;
        for (int j = i+1; j < i + k; j++) {
            q.push(suf[j] - suf[i + k]);
        }
        //cout << i << " " << sum << endl;
        for (int j = 0; j < x - 1; j++) {
            if (j == x - 2 && q.top() < 0) break;
            sum += q.top();
            q.pop();
        }
        cout << sum<<" ";
    }
}