#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T maxm(T& a, T b) {
  return a = a < b ? b : a;
}
template <class T>
inline T minm(T& a, T b) {
  return a = a > b ? b : a;
}
const int MAXN = 1e5;
const int S = 1 << 17;
int N, L, A[MAXN], ind[MAXN];
int cnt[S << 1], sml[S << 1], big[S << 1];
long long sum[S << 1];
void init() {
  for (int i = 0; i < (S << 1); i++) {
    sml[i] = 1e9;
    big[i] = -1e9;
  }
}
void fix(int i) {
  for (int node = (S + i) / 2; node; node >>= 1) {
    cnt[node] = cnt[node << 1] + cnt[node << 1 | 1];
    sum[node] = sum[node << 1] + sum[node << 1 | 1];
    sml[node] = min(sml[node << 1], sml[node << 1 | 1]);
    big[node] = max(big[node << 1], big[node << 1 | 1]);
  }
}
void del(int i) {
  cnt[S + ind[i]] = sum[S + ind[i]] = 0;
  sml[S + ind[i]] = 1e9;
  big[S + ind[i]] = -1e9;
  fix(ind[i]);
}
void ins(int i) {
  cnt[S + ind[i]] = 1;
  sum[S + ind[i]] = A[i];
  sml[S + ind[i]] = A[i];
  big[S + ind[i]] = A[i];
  fix(ind[i]);
}
long long smallK(int k, int node = 1, int s = 0, int e = S - 1) {
  if (sml[node] >= 0) return 0;
  if (cnt[node] <= k && big[node] <= 0) return sum[node];
  if (cnt[node << 1] >= k)
    return smallK(k, node << 1, s, (s + e) / 2);
  else
    return smallK(cnt[node << 1], node << 1, s, (s + e) / 2) +
           smallK(k - cnt[node << 1], node << 1 | 1, (s + e) / 2 + 1, e);
}
long long bigK(int k, int node = 1, int s = 0, int e = S - 1) {
  if (big[node] <= 0) return 0;
  if (cnt[node] <= k && sml[node] >= 0) return sum[node];
  if (cnt[node << 1 | 1] >= k)
    return bigK(k, node << 1 | 1, (s + e) / 2 + 1, e);
  else
    return bigK(cnt[node << 1 | 1], node << 1 | 1, (s + e) / 2 + 1, e) +
           bigK(k - cnt[node << 1 | 1], node << 1, s, (s + e) / 2);
}
int main() {
  cin >> N >> L;
  for (int i = 0; i < N; i++) cin >> A[i];
  int K;
  cin >> K;
  vector<pair<int, int> > V(N);
  for (int i = 0; i < N; i++) V[i] = make_pair(A[i], i);
  sort(V.begin(), V.end());
  for (int i = 0; i < N; i++) ind[V[i].second] = i;
  long long curSum = 0;
  long long ans = -1e9;
  for (int i = 0; i < L; i++) {
    ins(i);
    curSum += A[i];
  }
  maxm(ans, max(abs(curSum - 2 * bigK(K)), abs(curSum - 2 * smallK(K))));
  for (int i = 1; i + L - 1 < N; i++) {
    curSum += A[i + L - 1];
    curSum -= A[i - 1];
    ins(i + L - 1);
    del(i - 1);
    maxm(ans, max(abs(curSum - 2 * bigK(K)), abs(curSum - 2 * smallK(K))));
  }
  cout << ans << '\n';
  return 0;
}
