#include <bits/stdc++.h>
using namespace std;
int a[100005];
long long sum, sumK;
multiset<int> Kfirst, NKfirst;
int n, len, k;
void update(int &num, int tipe) {
  multiset<int>::iterator it;
  if (tipe < 0) {
    if (num >= 0) return;
    if (NKfirst.find(num) != NKfirst.end())
      NKfirst.erase(NKfirst.find(num));
    else {
      Kfirst.erase(Kfirst.find(num)), sumK -= num;
      if (NKfirst.size() > 0) {
        it = NKfirst.begin();
        sumK += *it;
        Kfirst.insert(*it);
        NKfirst.erase(it);
      }
    }
  } else {
    if (num >= 0) return;
    sumK += num;
    Kfirst.insert(num);
    if (Kfirst.size() > k) {
      it = Kfirst.end();
      --it;
      NKfirst.insert(*it);
      sumK -= *it;
      Kfirst.erase(it);
    }
  }
}
long long solve() {
  Kfirst.clear();
  NKfirst.clear();
  long long ans = -(1LL << 60);
  sum = 0, sumK = 0;
  for (int i = 0, j = 0; i < n; i++) {
    if (i > 0) update(a[i - 1], -1), sum -= a[i - 1];
    while (j < n && j - i < len) update(a[j], 1), sum += a[j], j++;
    if (j - i == len) ans = max(ans, abs(sum - 2 * sumK));
  }
  return ans;
}
int main() {
  while (cin >> n >> len) {
    for (int i = 0; i < n; i++) cin >> a[i];
    cin >> k;
    long long ans = solve();
    for (int i = 0; i < n; i++) a[i] = a[i] * -1;
    ans = max(ans, solve());
    cout << ans << endl;
  }
}
