#include <iostream>

using namespace std;
int main()
{
    int n, k, x;
    cin >> n >> k >> x;
    int p [n];
    for (int i = 0; i < n; i++)
        cin >> p[i];
    for (int i = 0; i < k; i++)
    {
        int a = 0, c = 1;
        for (int j = i; j < n-k+1+i; j++)
        {
            a += c*p[j];
            if (c != x && c*p[j]<(c-1)*p[j]) c++;
        }
        cout << a << " ";
    }
    return 0;
}