using System;
using System.Linq;

class Program
{
    static void Main()
    {
        string[] ss = Console.ReadLine().Split();
        int n = int.Parse(ss[0]);
        int k = int.Parse(ss[1]);
        int x = int.Parse(ss[2]);

        ss = Console.ReadLine().Split();
        int[] p = new int[n];
        for (int i = 0; i < n; i++)
            p[i] = int.Parse(ss[i]);

        long[] maxAuras = new long[n - k + 1];

        for (int ind = 0; ind <= n - k; ind++)
        {
            long[] dp = new long[x + 2];
            for (int i = 0; i <= x + 1; i++)
                dp[i] = long.MinValue;

            dp[1] = 0;

            for (int i = 0; i < k; i++)
            {
                int val = p[ind + i];
                long[] next = new long[x + 2];
                for (int c = 0; c <= x + 1; c++)
                    next[c] = long.MinValue;

                for (int c = 1; c <= x; c++)
                {
                    if (dp[c] != long.MinValue)
                    {
                        next[c] = Math.Max(next[c], dp[c] + c * val);
                        if (c + 1 <= x)
                            next[c + 1] = Math.Max(next[c + 1], dp[c] + c * val);
                    }
                }

                dp = next;
            }

            maxAuras[ind] = dp[x];
        }

        foreach (long aura in maxAuras)
            Console.Write(aura + " ");
    }
}