#include <bits/stdc++.h>

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> pref(n+1);
    pref[0] = 0;
    for(int i = 1; i <= n; i++){
        long long t;
        cin >> t;
        pref[i] = t+pref[i-1];
    }
    vector<long long> kon;
    for(int i = 1; i <= n-k+1; i++){
        long long res = pref[i+k-1]-pref[i-1];
        //cout << pref[i+k-1] << " " << pref[i-1] << "\n\n";
        long long maks = LLONG_MIN;
        for(int j = 1; j < k+1; j++){
            long long c = pref[i+k-1]-pref[j+i-1];
            //cout << pref[i+k-1] << " " << pref[j+i-1] << "\n";
            if(c > maks){
                maks = c;
            }
        }
        kon.push_back(res+maks);
    }
    for(int i = 0; i < n-k+1; i++){
        cout << kon[i] << " ";
    }
    cout << "\n";
    return 0;
}