#include<bits/stdc++.h>
using namespace std;
long long n, k, x, niz[200050], ps, zbir[200050], maks, preostali, ind, koef, rez;
bool pos[200050];
int main()
{
    cin >> n >> k >> x;

    zbir[0] = 0;
    for(int i=1; i<=n; i++)
    {
        cin >> niz[i];
        zbir[i] = zbir[i-1] + niz[i];
    }

    /*for(int i=1; i<=n; i++)
        cout << zbir[i] << " ";
    cout << "\n";*/

    for(int i=1; i<=n-k+1; i++) /// PRODJEM KROZ SVE KOJE TREBAM OBRADITI
    {
        memset(pos, 0, sizeof(pos));

        for(int br=1; br<x; br++)
        {
            maks = -10000000000;
            for(int j=i; j<=i+k-1; j++)
            {
                ps = zbir[i+k-1] - zbir[j];
                //cout << j << ", " << ps << "\n";
                if(ps > maks and pos[j] == 0)
                {
                    maks = ps;
                    ind = j;
                }
            }
            pos[ind] = 1;
            //cout << ind << "\n";
        }

        /*cout << "KO JE POSECEN: ";
        for(int j=1; j<=n; j++)
        {
            if(pos[j])
                cout << j << " ";
        }
        cout << "\n";*/

        /// SIMULIRAM
        koef = 1;
        rez = 0;
        for(int j=i; j<=i+k-1; j++)
        {
            rez += koef * niz[j];
            if(pos[j])
                koef++;
        }
        cout << rez << "\n";
    }
    return 0;
}