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

class Program
{
    static void Main(string[] args)
    {
        string[] str = Console.ReadLine().Split();
        int n = int.Parse(str[0]);
        int k = int.Parse(str[1]);
        int x = int.Parse(str[2]);
        int[] p = new int[n];
        string[] st = Console.ReadLine().Split();
        for (int i = 0; i < n; i++)
            p[i] = int.Parse(st[i]);

        for(int i = 0; i < n - k + 1; i++)
        {
            int a = 0;
            int c = 1;
            //int max = int.MinValue;
            //int maxi = -1;
            //for(int j = 0; j < k; j++)
            //{
                //if (p[i + j] > max)
                //{
                    //max = p[i + j];
                    //maxi = i + j;
                //}            
            //}

            for (int j = 0; j < k - 1; j++)
            {
                if (p[i + j] < p[i + j + 1])
                {
                    a += c * p[i + j];
                    c++;
                }
                if (p[i + j] >= p[i + j + 1])
                    a += c * p[i + j];               
            }
            a += c * p[i + k - 1];
            Console.Write(a + " ");

            Console.ReadLine();
        }
    }
}