#include <bits/stdc++.h>
#define ll long long
using namespace std;
mt19937_64 rng(1);
int N, K, X;
ll A[200002];
int main()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> N >> K >> X;
  for(int i = 1; i <= N; i++) cin >> A[i];
  vector <ll> V;
  for(int i = K; i <= N; i++)
  {
    ll sum = 0;
    for(int j = i; j > (i - K); j--)
    {
      V.push_back(sum);
      sum += A[j];
    }
    sort(V.begin(), V.end());
    for(int j = K - 1; j > (K - X); j--) sum += V[j];
    cout << sum << ' ';
    V.clear();
  }
  cout << '\n';

  return 0;
}