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

namespace ConsoleApp2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] ulaz = Console.ReadLine().Split(' ');
            int n = int.Parse(ulaz[0]);
            int k = int.Parse(ulaz[1]);
            int x = int.Parse(ulaz[2]);
            int c = 1;

            string[] ulaz2 = Console.ReadLine().Split(' ');

            List<int> l = new List<int>();
            List<int> l2 = new List<int>();

            for (int i = 0; i < ulaz2.Length; i++) 
            {
                l.Add(int.Parse(ulaz2[i]));
            }

            int b = -1;

            
            

            while (b != l.Count - k) 
            {
                b++;
                int t = 0;
                List<int> l1 = new List<int>();
                for (int i = b; i < b + k; i++) 
                {
                    
                    l1.Add(l[i]);
                }

                l1.Reverse();

                

                c = x;
                for (int i = 0; i < l1.Count; i++)
                {

                    
                    if (l1[i] < 0)
                    {
                        if (c != 1) 
                        {
                            c--;
                        }
                        
                        t += l1[i] * c;
                    }
                    else 
                    {
                        t += l1[i] * c;
                    }
                    
                }
                l2.Add(t);
                

            }

            
            foreach (int i in l2) 
            {
                Console.Write(i + " ");
            }   




        }
    }
}