using System;
    internal class Program
{
    static void Main(string[] args)
    {
        string[] unos = Console.ReadLine().Split();
        int n = Convert.ToInt32(unos[0]);
        int k = Convert.ToInt32(unos[1]);
        int x = Convert.ToInt32(unos[2]);
        int[] p = new int[n];
        int a = 0;
        int c = 1;
        int[] izlaz = new int[n-k+1];
        string[] unos2 = Console.ReadLine().Split();
        for(int i = 0; i < n; i++)
        {
            p[i] = Convert.ToInt32(unos2[i]);
        }
        int pom = 0;
        while(true)
        {
            int i = 0;
            if (pom == n-k+2)
                break;
            int[] podniz = new int[k];
            if(pom == k-1)
            {
                a = 0;
                int min = podniz[0];
                for (int j = 1; j < podniz.Length; j++)
                {
                    if (podniz[j] <= min)
                    {
                        min = podniz[j];
                        int index = j;
                        for (int u = 0; u < podniz.Length; u++)
                        {
                            a = a + c * podniz[u];
                            if (u == index)
                                c++;
                        }
                        izlaz[i] = a;

                    }
                }
            }
            podniz[pom] = Convert.ToInt32(p[i]);
            pom++;
            i++;
        }
        for(int i = 0; i < izlaz.Length; i++)
            Console.WriteLine(izlaz[i]);
    }
}