#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int min(vector<int> a, int l, int d)
{
    int minn = 1000000000;
    for (size_t i = l; i < d; i++)
    {
        if (minn > a[i]) minn = a[i];
    }
    return minn;
}
int main()
{
    int n, k, x,tem;
    cin >> n;
    cin >> k;
    cin >> x;
    vector<int> a;
    a.push_back(0);
    vector<int> resenja;
    //sort(a.begin(),a.end());
        for (size_t i = 1; i < n + 1; i++)
        {
            cin >> tem;
                a.push_back(a[i - 1] + tem);
        }
        for (size_t i = 0; i < n - k + 1; i++)
        {
            int najveci = a[i + k];
            int minn = min(a, i + 1, i + k);
            
            resenja.push_back(najveci + najveci - minn - a[i]);
        }
        cout << '\n';
        for (size_t i = 0; i < n - k + 1; i++)
        {
            cout << resenja[i] << " ";
        }
}
/*7 4 2
-10 2 2 -5 -4 5 7*/