#include<bits/stdc++.h>

using namespace std;

#define int long long

void solve(){
    int n, k, x;
    cin>>n>>k>>x;
    vector<int> v(n+3);
    for(int i = 1;i<=n;i++) cin>>v[i];
    for(int i = k;i<=n;i++){
        vector<int> suf(k+2);
        suf[k+1] = 0;
        suf[k] = v[i];
        for(int j = i-1;j>=i-k+1;j--){
            suf[k+j-i] = suf[k+j-i+1]+v[j];
        }
        vector<int> a;
        for(int i = 2;i<=k+1;i++) a.push_back(suf[i]);
        sort(a.begin(), a.end(), greater<int>());
        int ans = suf[1];
        for(int i = 0;i<x-1;i++) ans+=a[i];
        cout<<ans<<" ";
    }
    cout<<endl;
}

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t = 1;
    //cin>>t;
    while(t--){
        solve();
    }
}