#include <bits/stdc++.h>
#define ll long long
using namespace std;
mt19937_64 rng(1);
int N, K, X;
ll A[200002], PS[200002];
void Special()
{
  for(int i = 1; i <= N; i++) if(A[i] < 0) return;
  for(int i = 1; i <= N; i++) PS[i] = PS[i - 1] + A[i];
  ll sum = PS[K];
  for(int i = 1; i < X; i++) sum += PS[K] - PS[i];
  cout << sum << ' ';
  for(int i = K + 1; i <= N; i++)
  {
    sum -= A[i - K];
    sum += (X + 1) * A[i];
    sum -= PS[i] - PS[i - K];
    cout << sum << ' ';
  }
  exit(0);
}
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];
  Special();
  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;
}