#include <stdio.h>
#include <stdlib.h>

int main()
{
    long long n,p[10000],k,x,c=1,b[10000],s1,s2,max;
    scanf("%lld%lld%lld",&n,&k,&x);
    for(long long i=0;i<n;i++)
        scanf("%lld",&p[i]);
    for(long long i=0;i<(n-k+1);i++){
            max=p[i];
            s1=p[i];
            s2=p[i];
            c=1;
        for(long long j=i+1;j<(i+k);j++){
            s1=max+c*p[j];
            s2=max+(c+1)*p[j];
            if(c==x){
                max=s1;
            }
            else if((j+1<i+k)&&(p[j+1]<p[j])){
                max=s1;
            }
            else if((i+k-j+1)==(x-c)){
                max=s2;
                c=c+1;
            }
            else if(s1>=s2){
                max=s1;
            }
            else{
                max=s2;
                c=c+1;
            }

        }
        b[i]=max;
    }
    for(long long i=0;i<(n-k+1);i++)
        printf("%lld ",b[i]);
    return 0;
}