#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n, k, x;
	cin >> n >> k >> x;
	
	int p[n];
	for (int i=0; i<n; i++)
	{
		cin >> p[i];
	}
	int c=1;
	int i=0, j=k-1;
	while (j<n)
	{
		int maxS = -100000;
		for (int l=i; l<=j; l++)
		{
			int s = 0;
			
			c = 1;
			
			for (int m=i; m<=j; m++)
			{
				if ((m==l) && (l!=i)) c++;
				s += c*p[m];
			}	
			if (s > maxS) maxS = s;
		}
		cout << maxS << " ";
		
		i++;
		j++;
	}
	
}