#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<int>p(n);
    for(int i=0;i<n;i++)
    {

        cin>>p[i];
    }
    if(x!=1)x=2;
    int br=0;
    vector<int>q(n-k+1,0);

    while(br!=n-k+1)
    {
        int c=1;
        for(int i = br;i<k+br;i++)
        {
            q[br]=q[br]+p[i]*c;
            int sum1=c*p[i+1];
            int sum2=(c+1)*p[i+1];
            int sum3=c*p[i+1];
            for(int j=i+2;j<k+br;j++)
            {
                sum1 = sum1+(c+1)*p[j];
                sum2 = sum2+(c+1)*p[j];
                sum3 = sum3+c*p[j];
            }
            if(sum2 > sum1 && sum2 > sum3 && c<x)
            {
                c++;
            }
        }
        br++;
    }
    for(int i=0;i<n-k+1;i++)
    {
        cout<<q[i]<< " ";
    }

}