#include <iostream>
#include <algorithm>
#include <queue>



using namespace std;

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

    int n, k, x;
    cin >> n >> k >> x;
    int a[n];
    int sume[n+1];sume[0]=0;
    int s=0;
    for (int i = 0; i<n; i++){
        cin >> a[i];
        s+=a[i];
        sume[i+1]=s;
        //cout << s << " ";
    }
    //cout << endl;

    for (int i = 0; i<n-k+1; i++){
        int psum = sume[i+k]-sume[i];
        int fsum = psum;
        priority_queue<int> pq;
        for(int j = i; j<i+k-1; j++){
            psum-=a[j];
            pq.push(psum);
            //cout << "p " << psum << endl;
        }
        int brojac = 0;
        for (int j = 0; j< x-1; j++){
            int l = pq.top();
            pq.pop();
            //cout << i << " " << j <<  " " << l << endl;
            if (j==x-2 && l<0){
                break;
            }
            fsum += l;
        }
        cout << fsum << " ";


    }



    return 0;
}