#include <bits/stdc++.h>
using namespace std;
void ASS(bool bb) {
  if (!bb) {
    ++*(int*)0;
  }
}
#pragma comment(linker, "/STACK:106777216")
int Z = 1;
struct S {
  int x;
  S() { x = 0; }
  bool operator<(const S& s) const { return Z * x < Z * s.x; }
};
const int N = 1 << 17;
int K;
S a[N];
const S Zero;
set<pair<S, int> > neg;
set<pair<S, int> > negOther;
long long posSum, negSum, negOtherSum;
void Init() {
  negSum = 0;
  posSum = 0;
  negOtherSum = 0;
  neg.clear();
  negOther.clear();
}
void Add(S x, int id) {
  if (x < Zero) {
    if (neg.size() == K) {
      if (K > 0 && x < neg.rbegin()->first) {
        set<pair<S, int> >::iterator it = neg.end();
        it--;
        negOther.insert(*it);
        negOtherSum += it->first.x;
        negSum -= it->first.x;
        neg.erase(it);
        negSum += x.x;
        neg.insert(make_pair(x, id));
      } else {
        negOtherSum += x.x;
        negOther.insert(make_pair(x, id));
      }
    } else {
      negSum += x.x;
      neg.insert(make_pair(x, id));
    }
  } else {
    posSum += x.x;
  }
}
void Del(S x, int id) {
  if (x < Zero) {
    set<pair<S, int> >::iterator it = neg.find(make_pair(x, id));
    if (it != neg.end()) {
      negSum -= it->first.x;
      neg.erase(it);
      if (negOther.size() > 0) {
        negSum += negOther.begin()->first.x;
        neg.insert(*negOther.begin());
        negOtherSum -= negOther.begin()->first.x;
        negOther.erase(negOther.begin());
      }
    } else {
      it = negOther.find(make_pair(x, id));
      if (negOther.end() != it) {
        negOtherSum -= x.x;
        negOther.erase(it);
      }
    }
  } else {
    posSum -= x.x;
  }
}
long long Res() { return Z * (-negSum + posSum + negOtherSum); }
int n, Len;
long long Max() {
  Init();
  for (int i = 0; i < (int)(Len); i++) Add(a[i], i);
  long long res = Res();
  for (int i = Len; i < n; i++) {
    Add(a[i], i);
    Del(a[i - Len], i - Len);
    long long t = Res();
    res = max(res, t);
  }
  return res;
}
int main() {
  cin >> n >> Len;
  for (int i = 0; i < (int)(n); i++) cin >> a[i].x;
  cin >> K;
  long long res = Max();
  Z = -1;
  res = max(res, Max());
  cout << res << endl;
  return 0;
}
