#include <bits/stdc++.h>
using namespace std;
int n, len, k;
long long x1, x2, a[200005];
long long solve() {
  long long sum = 0, ma = -1e18;
  multiset<long long> s1, s2;
  for (int i = 1; i <= n; i++) {
    if (a[i] >= 0)
      sum += a[i];
    else if (s1.size() < k) {
      s1.insert(a[i]);
      sum -= a[i];
    } else if (k && a[i] < *(--s1.end())) {
      long long x = *(--s1.end());
      sum += 2 * x;
      s1.erase(--s1.end());
      s2.insert(x);
      s1.insert(a[i]);
      sum -= a[i];
    } else {
      s2.insert(a[i]);
      sum += a[i];
    }
    int j = i - len;
    if (j > 0) {
      if (a[j] >= 0)
        sum -= a[j];
      else if (s1.find(a[j]) != s1.end()) {
        s1.erase(s1.find(a[j]));
        sum += a[j];
        if (s2.size() > 0) {
          long long x = *(s2.begin());
          s1.insert(x);
          s2.erase(s2.begin());
          sum -= 2 * x;
        }
      } else {
        s2.erase(s2.find(a[j]));
        sum -= a[j];
      }
    }
    if (j >= 0) ma = max(ma, sum);
  }
  return ma;
}
int main() {
  scanf("%d%d", &n, &len);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  scanf("%d", &k);
  x1 = solve();
  for (int i = 1; i <= n; i++) a[i] = -a[i];
  x2 = solve();
  printf("%lld\n", max(x1, x2));
  return 0;
}
