#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, len, k, a[N];
long long cum[N];
long long solve() {
  multiset<int> best, waiting;
  long long sum = 0;
  for (int i = 1; i <= len; ++i) {
    if (a[i] < 0) {
      if (best.size() < k) {
        best.insert(a[i]);
        sum += a[i];
      } else if (best.size() && *best.rbegin() > a[i]) {
        sum -= *best.rbegin();
        waiting.insert(*best.rbegin());
        best.erase(best.find(*best.rbegin()));
        best.insert(a[i]);
        sum += a[i];
      } else {
        waiting.insert(a[i]);
      }
    }
  }
  long long ret = cum[len] + (-sum * 2);
  for (int i = len + 1; i <= n; ++i) {
    if (a[i - len] < 0) {
      if (waiting.find(a[i - len]) != waiting.end()) {
        waiting.erase(waiting.find(a[i - len]));
      } else if (best.find(a[i - len]) != best.end()) {
        best.erase(best.find(a[i - len]));
        sum -= a[i - len];
        if (waiting.size()) {
          sum += *waiting.begin();
          best.insert(*waiting.begin());
          waiting.erase(waiting.begin());
        }
      }
    }
    if (a[i] < 0) {
      if (best.size() < k) {
        best.insert(a[i]);
        sum += a[i];
      } else if (best.size() && *best.rbegin() > a[i]) {
        sum -= *best.rbegin();
        waiting.insert(*best.rbegin());
        best.erase(best.find(*best.rbegin()));
        best.insert(a[i]);
        sum += a[i];
      } else {
        waiting.insert(a[i]);
      }
    }
    long long cur = cum[i] - cum[i - len] + (-sum * 2);
    ret = max(ret, cur);
  }
  return ret;
}
int main() {
  scanf("%d %d", &n, &len);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    cum[i] = cum[i - 1] + a[i];
  }
  scanf("%d", &k);
  long long result = solve();
  for (int i = 1; i <= n; ++i) {
    a[i] *= -1;
    cum[i] = cum[i - 1] + a[i];
  }
  result = max(result, solve());
  printf("%lld\n", result);
  return 0;
}
