#include <bits/stdc++.h>
using namespace std;
const int MAXn = 1e5 + 100;
int a[MAXn], l, n, k;
multiset<int> s1, s2;
long long sum;
void ins(multiset<int>& s, int x) {
  s.insert(x);
  &s == &s1 ? sum += -x : sum += x;
}
void del(multiset<int>& s, int x) {
  s.erase(s.find(x));
  &s == &s1 ? sum -= -x : sum -= x;
}
long long solve() {
  s1.clear();
  s2.clear();
  sum = 0;
  long long mx = -1e18;
  for (int i = 0; i < n; i++) {
    if (a[i] >= 0)
      sum += a[i];
    else {
      if (k == 0)
        ins(s2, a[i]);
      else if (int(s1.size()) < k)
        ins(s1, a[i]);
      else if (*s1.rbegin() > a[i]) {
        ins(s2, *s1.rbegin());
        del(s1, *s1.rbegin());
        ins(s1, a[i]);
      } else
        ins(s2, a[i]);
    }
    if (i - l >= 0) {
      if (a[i - l] >= 0)
        sum -= a[i - l];
      else if (s2.count(a[i - l]))
        del(s2, a[i - l]);
      else {
        del(s1, a[i - l]);
        if (int(s2.size()) > 0) {
          ins(s1, *s2.begin());
          del(s2, *s2.begin());
        }
      }
    }
    if (i >= l - 1) mx = max(mx, sum);
  }
  return mx;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> l;
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> k;
  long long tmp = solve();
  for (int i = 0; i < n; i++) a[i] *= -1;
  cout << max(tmp, solve()) << endl;
  return 0;
}
