#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() 
{

    int n, k, x;
    cin >> n >> k >> x;
    vector<long long int> p(n);
    for (int i = 0; i < n; i++)
        cin >> p[i];
    int m = x - 1;

    for (int s = 0; s + k <= n; s++) 
    {
        vector<long long int> b(k);
        for (int j = 0; j < k; j++)
            b[j] = p[s + j];
        long long int best = -1000000000;
        if (m == 0) 
        {
            long long int akt = 0;
            for (int j = 0; j < k; j++) 
                akt += b[j];
            best = akt;
        }
        else 
        {
            vector<int> mas(k, 0);
            for (int i = 0; i < m; i++) 
                mas[i] = 1;
            sort(mas.begin(), mas.end());
            do {
                long long int akt = 0;
                int c = 1;
                for (int j = 0; j < k; j++) 
                {
                    akt += c * b[j];
                    if (mas[j]) 
                        c++;
                }
                if (akt > best) 
                    best = akt;
            } while (next_permutation(mas.begin(), mas.end()));
        }
        if (s) 
            cout << ' ';
        cout << best;
    }
    cout << endl;
    return 0;

}