#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
int n, len, k;
long long ans;
long long num[MAXN];
multiset<int> s1, s2;
multiset<int>::iterator it;
void solve() {
  long long sum = 0, nsum = 0;
  s1.clear();
  s2.clear();
  for (int i = 1; i <= n; ++i) {
    sum += num[i];
    if (num[i] < 0) {
      if (s1.size() < k) {
        nsum += num[i];
        s1.insert(num[i]);
      } else {
        if (k > 0) {
          it = s1.end();
          it--;
          if (num[i] < *it) {
            long long va = *it;
            s1.erase(it);
            s1.insert(num[i]);
            s2.insert(va);
            nsum += num[i];
            nsum -= va;
          } else
            s2.insert(num[i]);
        } else
          s2.insert(num[i]);
      }
    }
    if (i > len) {
      sum -= num[i - len];
      it = s1.find(num[i - len]);
      if (it == s1.end()) {
        it = s2.find(num[i - len]);
        if (it != s2.end()) s2.erase(it);
      } else {
        nsum -= *it;
        s1.erase(it);
        if (s2.size()) {
          it = s2.begin();
          long long va = *it;
          s2.erase(it);
          s1.insert(va);
          nsum += va;
        }
      }
    }
    if (i >= len) ans = max(ans, sum - 2 * nsum);
  }
}
int main() {
  while (~scanf("%d%d", &n, &len)) {
    for (int i = 1; i <= n; ++i) scanf("%I64d", num + i);
    scanf("%d", &k);
    ans = 0;
    solve();
    for (int i = 1; i <= n; ++i) num[i] = -num[i];
    solve();
    printf("%I64d\n", ans);
  }
  return 0;
}
