using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    internal class Program
    {

        static int Broj_manji(int[]min,int p, int k)
        {
            int r = 1;
            for(int i = p;i< k;i++)
            {
                if (min[i]<0 && r> min[i])
                {
                    r= min[i];
                }    
            }
            return r;
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
           int  n= int.Parse(s[0]);
            int k = int.Parse(s[1]);
            int x = int.Parse(s[2]);
            string[] s1;
            int[]p = new int[n];
            int a = 0;
            int c = 1;
            int b = 0;
            s1 = Console.ReadLine().Split(' ');
            for (int i = 0; i<n;i++)
            {
                
                p[i] = int.Parse(s1[i]);
            }
           while(k+b<=n)
            {
                for (int j = b; j < k+b; j++)
                {
                    a = a + c * p[j];
                    if (c < x)
                    {
                        if ( Math.Abs(p[j]) < Math.Abs(Broj_manji(p,b,k+b)))
                        {
                            c = c/1;


                        }
                        else
                        {
                            c++;
                        }

                    }
                   
                    
                }
                Console.Write(a + " ");
                a= 0;
                c = 1;
                if (n-k<k)
                {
                    b++;

                }

            }

        }


    }
}