#include <iostream>
#include <algorithm>
using namespace std;

const int maks = 200005;

long long niz[maks];
long long zbir[maks];
long long pom[maks];

int main() 
{
    int n, k, x;
    cin >> n >> k >> x;
    for (int i = 1; i <= n; i++)
        cin >> niz[i];
    zbir[0] = 0;
    for (int i = 1; i <= n; i++)
        zbir[i] = zbir[i - 1] + niz[i];
    for (int l = 1; l <= n - k + 1; l++)
    {
        int r = l + k - 1;
        int br = 0;
        for (int i = l; i <= r; i++)
            pom[br++] = zbir[i];
        sort(pom, pom + br);
        long long suma = 0;
        for (int i = 0; i < x - 1; i++)
            suma += pom[i];
        long long rez = 1LL * x * zbir[r] - zbir[l - 1] - suma;
        cout << rez << " ";
    }
    return 0;
}