#include <bits/stdc++.h>
using namespace std;
long long len, n, k, a[100005];
long long curNeg, curPos, curNegK, curPosK, totNeg, totPos, ans = -1, x, num;
multiset<long long, greater<long long>> pos, posK;
multiset<long long> neg, negK;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> len;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  cin >> k;
  curNeg = 0, curPos = 0, curNegK = 0, curPosK = 0;
  for (int i = 1; i <= len; i++) {
    x = a[i];
    if (a[i] < 0) {
      curNeg += (x);
      negK.insert(x);
      curNegK += (x);
      if (negK.size() > k) {
        neg.insert(*negK.rbegin());
        curNegK -= (*negK.rbegin());
        negK.erase(negK.find(*negK.rbegin()));
      }
    } else {
      curPos += (x);
      posK.insert(x);
      curPosK += (x);
      if (posK.size() > k) {
        pos.insert(*posK.rbegin());
        curPosK -= (*posK.rbegin());
        posK.erase(posK.find(*posK.rbegin()));
      }
    }
  }
  totNeg = (curNegK * -1) + curPos + (curNeg - curNegK);
  if (totNeg < 0) totNeg *= -1;
  totPos = (curPosK * -1) + curNeg + (curPos - curPosK);
  if (totPos < 0) totPos *= -1;
  ans = max(ans, max(totPos, totNeg));
  for (int i = len + 1; i <= n; i++) {
    x = a[i - len];
    if (a[i - len] < 0) {
      if (negK.find(x) != negK.end()) {
        curNegK -= x;
        negK.erase(negK.find(x));
        if (neg.size() > 0) {
          num = (*neg.begin());
          curNegK += num;
          negK.insert(num);
          neg.erase(neg.find(num));
        }
      } else
        neg.erase(neg.find(x));
      curNeg -= x;
    } else {
      if (posK.find(x) != posK.end()) {
        curPosK -= x;
        posK.erase(posK.find(x));
        if (pos.size() > 0) {
          num = (*pos.begin());
          curPosK += num;
          posK.insert(num);
          pos.erase(pos.find(num));
        }
      } else
        pos.erase(pos.find(x));
      curPos -= x;
    }
    x = a[i];
    if (a[i] < 0) {
      curNeg += (x);
      negK.insert(x);
      curNegK += (x);
      if (negK.size() > k) {
        neg.insert(*negK.rbegin());
        curNegK -= (*negK.rbegin());
        negK.erase(negK.find(*negK.rbegin()));
      }
    } else {
      curPos += (x);
      posK.insert(x);
      curPosK += (x);
      if (posK.size() > k) {
        pos.insert(*posK.rbegin());
        curPosK -= (*posK.rbegin());
        posK.erase(posK.find(*posK.rbegin()));
      }
    }
    totNeg = (curNegK * -1) + curPos + (curNeg - curNegK);
    if (totNeg < 0) totNeg *= -1;
    totPos = (curPosK * -1) + curNeg + (curPos - curPosK);
    if (totPos < 0) totPos *= -1;
    ans = max(ans, max(totPos, totNeg));
  }
  cout << ans << "\n";
  return 0;
}
