#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int MOD = 1000000007;
int n, len, k;
int ar[MAXN];
long long curs, mins;
multiset<int> mink, neg;
void add(int a) {
  curs += a;
  if (!k || a >= 0) return;
  if (mink.size() < k) {
    mink.insert(a);
    mins += a;
  } else {
    multiset<int>::iterator f = mink.end();
    f--;
    int v = *f;
    if (a < v) {
      mink.erase(f);
      mink.insert(a);
      neg.insert(v);
      mins += a;
      mins -= v;
    } else
      neg.insert(a);
  }
}
void rem(int a) {
  curs -= a;
  if (!k || a >= 0) return;
  multiset<int>::iterator fa = mink.find(a);
  if (fa != mink.end()) {
    mink.erase(fa);
    mins -= a;
    if (!neg.empty()) {
      multiset<int>::iterator b = neg.begin();
      mins += *b;
      mink.insert(*b);
      neg.erase(b);
    }
    return;
  }
  neg.erase(neg.find(a));
}
long long mainp() {
  curs = mins = 0;
  neg.clear();
  mink.clear();
  long long best = -100000000000000;
  for (int i = 0; i < n; i++) {
    add(ar[i]);
    if (i >= len - 1) {
      best = max(best, curs - mins * 2);
      rem(ar[i - len + 1]);
    }
  }
  return best;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> len;
  for (int i = 0; i < n; i++) cin >> ar[i];
  cin >> k;
  long long ans = mainp();
  for (int i = 0; i < n; i++) ar[i] *= -1;
  cout << max(ans, mainp()) << '\n';
}
