using System;

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

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

        long sum = 0;
        for (int i = 0; i < k; i++) sum += p[i];

        long pref = 0;
        long minPref = long.MaxValue;
        for (int i = 0; i < k; i++)
        {
            pref += p[i];
            if (pref < minPref) minPref = pref;
        }

        long[] res = new long[n - k + 1];
        res[0] = 2 * sum - minPref;

        for (int i = 1; i <= n - k; i++)
        {
            sum -= p[i - 1];
            sum += p[i + k - 1];

            pref = 0;
            minPref = long.MaxValue;
            for (int j = 0; j < k; j++)
            {
                pref += p[i + j];
                if (pref < minPref) minPref = pref;
            }

            res[i] = 2 * sum - minPref;
        }

        for (int i = 0; i < res.Length; i++)
        {
            if (i > 0) Console.Write(" ");
            Console.Write(res[i]);
        }
        Console.WriteLine();
    }
}