#include <iostream>
#include <vector>

using namespace std;

int collect_aura(vector<int> ar, int k, int start, int max_c);
int collect_recursive(vector<int> ar,
                      int k,
                      int start,
                      int current_i,
                      int aura,
                      int cc,
                      int max_c);

int main()
{
    int aura = 0;
    int n;
    int k;
    int x;

    vector<int> ar;
    cin >> n;
    cin >> k;
    cin >> x;

    for(int i = 0; i < n; i++)
    {
        int tmp;
        cin >> tmp;
        ar.push_back(tmp);
    }

    for(int i = 0; i < n - k + 1; i++)
    {
        //int ra = collect_aura(ar, k, i, x);
        int ra = collect_recursive(ar, k, i, i, 0, 1, x);
        cout << ra << " ";
    }
    cout << endl;


    return 0;
}

int collect_aura(vector<int> ar, int k, int start, int max_c)
{
    int c = 1;
    int aura = 0;
    for(int i = start; i < k + start; i++)
    {
        aura += ar[i] * c;
        if(c < max_c)
            c++;
    }
    return aura;
}

int collect_recursive(vector<int> ar,
                      int k,
                      int start,
                      int current_i,
                      int aura,
                      int cc,
                      int max_c)
{
    if(current_i >= k + start)
    {
        return aura; // Hell nah
    }
    aura += ar[current_i] * cc;
    int r1 = -99999999;
    if(k + start >= max_c - cc)
    {
        r1 = collect_recursive(ar, k, start, current_i + 1, aura, cc, max_c);
    }
    if(cc < max_c)
    {
        int r2 = collect_recursive(ar, k, start, current_i + 1, aura, cc + 1, max_c);
        return max(r1, r2);
    }
    return r1;
}