#include <bits/stdc++.h>
using namespace std;
int N, L, K;
int A[100001];
long long P[100001];
long long ans = (long long)1e18 * (-1);
void ins(multiset<int> &q1, multiset<int> &q2, long long &s, int a) {
  if (q1.size() < K) {
    q1.insert(a);
    s += a;
  } else {
    multiset<int>::iterator it = q1.begin();
    if (K && a > *it) {
      q2.insert(*it);
      s -= *it;
      q1.erase(it);
      q1.insert(a);
      s += a;
    } else {
      q2.insert(a);
    }
  }
}
void rem(multiset<int> &q1, multiset<int> &q2, long long &s, int a) {
  multiset<int>::iterator it = q1.find(a);
  if (it != q1.end()) {
    q1.erase(it);
    s -= a;
    if (q2.size()) {
      it = q2.end();
      --it;
      q1.insert(*it);
      s += *it;
      q2.erase(it);
    }
  } else {
    multiset<int>::iterator it = q2.find(a);
    assert(it != q2.end());
    q2.erase(it);
  }
}
void solve() {
  P[1] = A[1];
  for (int i = 2; i <= N; i++) P[i] = P[i - 1] + A[i];
  multiset<int> q1, q2;
  long long s = 0;
  for (int i = 1; i <= L; i++)
    if (A[i] < 0) ins(q1, q2, s, -A[i]);
  int r = L;
  while (1) {
    long long cur = P[r] - P[r - L] + 2 * s;
    ans = max(ans, cur);
    if (r == N) break;
    int l = r - L + 1;
    int a = A[l];
    if (a < 0) rem(q1, q2, s, -a);
    a = A[++r];
    if (a < 0) ins(q1, q2, s, -a);
  }
}
int main(int argc, char **argv) {
  ios::sync_with_stdio(false);
  cin >> N >> L;
  for (int i = 1; i <= N; i++) cin >> A[i];
  cin >> K;
  solve();
  for (int i = 1; i <= N; i++) A[i] *= -1;
  solve();
  cout << ans << endl;
  return 0;
}
