#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
long long a[200001], pref[200001];
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    long long n, k, x, i, j;
    cin >> n >> k >> x;
    for (i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    priority_queue <long long> kju;
    kju.push(0);
    for (i = k; i >= 1; i--)
    {
        pref[i] = pref[i+1]+a[i];
        if (i != 1) kju.push(pref[i]);
    }
    long long res = pref[1];
    for (i = 1; i <= (x-1); i++)
    {
        res += kju.top();
        kju.pop();
    }
    cout << res << endl;
    for (j = 2; j <= (n-k+1); j++)
    {
        priority_queue <long long> kju;
        kju.push(0);
        for (i = k; i >= 1; i--)
        {
            pref[i] = pref[i+1]+a[i+j-1];
            if (i != 1) kju.push(pref[i]);
        }
        long long res = pref[1];
        for (i = 1; i <= (x-1); i++)
        {
            res += kju.top();
            kju.pop();
        }
        cout << res << endl;
    }
    return 0;
}