#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, l, k;
  cin >> n >> l;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  cin >> k;
  multiset<long long> plus_k, minus_k;
  multiset<long long, greater<long long> > plus, minus;
  long long s_plus = 0, s_plus_k = 0, s_minus = 0, s_minus_k = 0;
  for (long long i = 0; i < n && i < l; i++) {
    if (v[i] == 0) continue;
    if (v[i] > 0) {
      plus_k.insert(v[i]);
      s_plus_k += v[i];
      if (plus_k.size() > k) {
        long long x = *(plus_k.begin());
        plus_k.erase(plus_k.begin());
        s_plus_k -= x;
        s_plus += x;
        plus.insert(x);
      }
    } else {
      minus_k.insert(-v[i]);
      s_minus_k -= v[i];
      if (minus_k.size() > k) {
        long long x = *(minus_k.begin());
        minus_k.erase(minus_k.begin());
        s_minus_k -= x;
        s_minus += x;
        minus.insert(x);
      }
    }
  }
  long long res = max(s_plus + s_plus_k + s_minus_k - s_minus,
                      s_minus + s_minus_k + s_plus_k - s_plus);
  for (long long i = 0; i < n - l; i++) {
    if (v[i] > 0) {
      auto it = plus.find(v[i]);
      if (it != plus.end()) {
        plus.erase(it);
        s_plus -= v[i];
      } else {
        auto it = plus_k.find(v[i]);
        plus_k.erase(it);
        s_plus_k -= v[i];
        while (plus.size() && plus_k.size() < k) {
          long long x = *(plus.begin());
          plus.erase(plus.begin());
          s_plus -= x;
          s_plus_k += x;
          plus_k.insert(x);
        }
      }
    } else if (v[i] < 0) {
      auto it = minus.find(-v[i]);
      if (it != minus.end()) {
        minus.erase(it);
        s_minus += v[i];
      } else {
        auto it = minus_k.find(-v[i]);
        minus_k.erase(it);
        s_minus_k += v[i];
        while (minus.size() && minus_k.size() < k) {
          long long x = *(minus.begin());
          minus.erase(minus.begin());
          s_minus -= x;
          s_minus_k += x;
          minus_k.insert(x);
        }
      }
    }
    if (v[i + l] > 0) {
      plus_k.insert(v[i + l]);
      s_plus_k += v[i + l];
      if (plus_k.size() > k) {
        long long x = *(plus_k.begin());
        plus_k.erase(plus_k.begin());
        s_plus_k -= x;
        s_plus += x;
        plus.insert(x);
      }
    } else if (v[i + l] < 0) {
      minus_k.insert(-v[i + l]);
      s_minus_k -= v[i + l];
      if (minus_k.size() > k) {
        long long x = *(minus_k.begin());
        minus_k.erase(minus_k.begin());
        s_minus_k -= x;
        s_minus += x;
        minus.insert(x);
      }
    }
    res = max(res, s_plus + s_plus_k + s_minus_k - s_minus);
    res = max(res, s_minus + s_minus_k + s_plus_k - s_plus);
  }
  cout << res << endl;
}
