using System;

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;
            }
        }
        if (positive)
        {
            for (int i = 0; i < n - k + 1; i++)
            {
                long sum = 0;
                int c = 1;
                for (int j = i; j < i + k; j++)
                {
                    sum += c* arr[j];
                    if (c < x)
                    {
                        c++;
                    }
                }
                if (i == 0)
                {
                    Console.Write(sum);
                }
                else
                {
                    Console.Write(" " + sum);
                }
            }
            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;
            for (int l = 0; l < x - 1; l++)
            {
                c--;
                for (int j = maxSumIndex - 1; j > k - x - l + i; j--)
                {
                    rightSum += arr[j];
                    if (rightSum > maxSum)
                    {
                        maxSum = rightSum;
                        maxSumIndex = j;
                    }
                }
                sum += c * maxSum;
                maxSum = long.MinValue;
                rightSum = 0;
            }
            for (int j = i; j < maxSumIndex; j++)
            {
                leftSum += arr[j];
            }
            sum += leftSum;
            if (i == 0)
            {
                Console.Write(sum);
            }
            else
            {
                Console.Write(" " + sum);
            }
        }
    }
}