namespace tak2024
{
    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[] p = new int[n];
            string[] ulaz2 = Console.ReadLine().Split();
            for (int i = 0; i < n; i++)
            {
                p[i] = int.Parse(ulaz2[i]);
            }
            int a = 0;
            int c = 1;
            int[] izlaz = new int[k];
            for (int i = 0; i <= n - k; i++)
            {
                int[] pniz = new int[k];
                for (int j = 0; j < k; j++)
                {
                    pniz[j] = p[i + j];
                }
                // provera
                int res = 0;
                for (int j = 0; j < k; j++)
                {
                    int rest = 0;
                    int[] pniz1 = pniz;
                    int c1 = c;
                    for (int l = 0; l < k; l++)
                    {
                        rest += c1 * pniz1[l];
                        if (l == j && c1 < x) { c1++; }
                    }
                    if (rest > res) { res = rest; }
                }
                izlaz[i] = res; // ubaci
            }
            for (int i = 0; i < k; i++)
            {
                Console.Write(izlaz[i]);
                if (i != k - 1) { Console.Write(" "); }
            }
            // (x-c) * (k-1)
        }
    }
}