using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _1takm2025_26
{
    internal class Program
    {
        static List<long> X2(int n, int k, int x, int[] p)
        {
            List<long> temp = new List<long>();
            int ind = 0;
            while(ind + k-1 < n)
            {
                List <long> templist = new List <long>();
                for (int i = ind; i < ind + k; i++)
                {
                    templist.Add(p[i]);
                }
                long max = long.MinValue;
                long temporary = 0;
                for(int i = 0; i < k; i++)
                {
                    temporary += templist.Sum();
                    for(int j = i+1;  j <k; j++)
                    {
                        temporary += templist[j];
                    } 
                    if(max < temporary)
                    {
                        max = temporary;
                    }
                    temporary = 0;
                }
                temp.Add(max);
                ind++;
            }
            return temp;
        }
        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();
            int[] p = new int[n];
            for(int i = 0; i < n; i++)
            {
                p[i] = int.Parse(input[i]);
            }
            List<long> res = X2(n,k,x,p);
            for(int i = 0; i <  res.Count; i++)
            {
                Console.Write(res[i] + " ");
            }
        }
    }
}