#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, k, x;
    cin >> n >> k >> x;
    vector<long long> p(n);
    for (int i = 0; i < n; i++) cin >> p[i];
    vector<long long> res;
    for (int i = 0; i <= n - k; i++) {
        vector<long long> sub(p.begin() + i, p.begin() + i + k);
        long long total = accumulate(sub.begin(), sub.end(), 0LL);
        if (x > 1) {
            priority_queue<long long, vector<long long>, greater<long long>> pq;
            for (auto val : sub) {
                pq.push(val);
                if ((int)pq.size() > x - 1) pq.pop();
            }
            while (!pq.empty()) {
                total += pq.top();
                pq.pop();
            }
        }
        res.push_back(total);
    }
    for (size_t i = 0; i < res.size(); i++) {
        if (i)cout << " ";
        cout<<res[i];
    }
    cout << "\n";
    return 0;
}