#include <iostream>
using namespace std;
int potencijal (int p[], int P, int E, int a, int c, int x)
{
    if (c <= x) a += c*p[P];
    else a += x*p[P];
    if (P+1<E) return max (potencijal(p, P+1, E, a, c, x), potencijal(p, P+1, E, a, c+1, x));
    return a;
}
int main()
{
    int n, k, x;
    cin >> n >> k >> x;
    int p [n];
    for (int i = 0; i < n; i++)
        cin >> p[i];
    for (int i = 0; i < k; i++)
        cout << potencijal (p, i, n-k+i+1, 0, 1, x) << " ";
    return 0;
}