#include <bits/stdc++.h>
using namespace std;
bool debug = false;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
int len, a[100005];
long long s[100005];
long long ans, ss;
multiset<int> big, small;
void add(int x) {
  big.insert(x);
  ss += x;
  if (big.size() > k) {
    int y = *big.begin();
    small.insert(y);
    big.erase(big.begin());
    ss -= y;
  }
}
void remove(int x) {
  if (small.find(x) != small.end()) {
    small.erase(small.find(x));
    return;
  }
  big.erase(big.find(x));
  ss -= x;
  if (!small.empty()) {
    auto itr = small.end();
    itr--;
    int y = (*itr);
    small.erase(itr);
    big.insert(y);
    ss += y;
  }
}
void cal() {
  big.clear();
  small.clear();
  for (int(i) = 0; (i) < (int)(n); (i)++) s[i + 1] = s[i] + (long long)a[i];
  ss = 0;
  for (int(i) = 0; (i) < (int)(len); (i)++)
    if (a[i] < 0) add(-a[i]);
  for (int i = len; i <= n; i++) {
    long long tp = s[i] - s[i - len] + ss + ss;
    ans = max(ans, tp);
    if (i == n) break;
    if (a[i] < 0) add(-a[i]);
    if (a[i - len] < 0) remove(-a[i - len]);
  }
}
int main() {
  scanf("%d%d", &n, &len);
  for (int(i) = 0; (i) < (int)(n); (i)++) scanf("%d", a + i);
  scanf("%d", &k);
  cal();
  for (int(i) = 0; (i) < (int)(n); (i)++) a[i] = -a[i];
  cal();
  printf("%lld\n", ans);
  return 0;
}
