using System;
using System.Collections.Generic;

public class Programme
{
    public static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split(' ');
        int n = int.Parse(input[0]);
        int k = int.Parse(input[1]);
        int x = int.Parse(input[2]);
        input = Console.ReadLine().Split(' ');
        long[] arr = new long[n];
        bool positive = true;
        for (int i = 0; i < n; i++)
        {
            arr[i] = long.Parse(input[i]);
            if (arr[i] < 0)
            {
                positive = false;
            }
        }
        long[] results = new long[n - k + 1];
        if (positive)
        {
            long sum = 0;
            int c = 1;
            for (int j = 0; j < k; j++)
            {
                sum += c * arr[j];
                if (c < x)
                {
                    c++;
                }
            }
            results[0] = sum;
            for (int i = 1; i < n - k + 1; i++)
            {
                for (int j = i - 1; j < i + x - 1; j++)
                {
                    sum -= arr[j];
                }
                sum += x * arr[i + k - 1];
                results[i] = sum;
            }
            Console.Write(results[0]);
            for (int i = 1; i < n - k + 1; i++)
            {
                Console.Write(" " + results[i]);
            }
            return;
        }
        if (x == 2)
        {
            for (int i = 0; i < n - k + 1; i++)
            {
                long leftSum = arr[i];
                long rightSum = 0;
                long maxSum = 0;
                int maxSumIndex = i + k;
                for (int j = i + k - 1; j > i; j--)
                {
                    rightSum += arr[j];
                    if (rightSum > maxSum)
                    {
                        maxSum = rightSum;
                        maxSumIndex = j;
                    }
                }
                for (int j = i + 1; j < maxSumIndex; j++)
                {
                    leftSum += arr[j];
                }
                long sum = leftSum + 2 * maxSum;
                if (i == 0)
                {
                    Console.Write(sum);
                }
                else
                {
                    Console.Write(" " + sum);
                }
            }
            return;
        }
        for (int i = 0; i < n - k + 1; i++)
        {
            int c = x + 1;
            int maxSumIndex = i + k;
            long sum = 0;
            long leftSum = 0;
            long rightSum = 0;
            long maxSum = 0;
            int oldMaxSumIndex = maxSumIndex;
            for (int l = 0; l < x - 1; l++)
            {
                c--;
                for (int j = oldMaxSumIndex - 1; j > k - x - l + i; j--)
                {
                    rightSum += arr[j];
                    if (rightSum > maxSum)
                    {
                        maxSum = rightSum;
                        maxSumIndex = j;
                    }
                }
                sum += c * maxSum;
                maxSum = long.MinValue;
                oldMaxSumIndex = maxSumIndex;
                rightSum = 0;
            }
            for (int j = i; j < maxSumIndex; j++)
            {
                leftSum += arr[j];
            }
            sum += leftSum;
            if (i == 0)
            {
                Console.Write(sum);
            }
            else
            {
                Console.Write(" " + sum);
            }
        }
    }
}