#include <bits/stdc++.h>
using namespace std;
struct node {
  int val, id;
  bool operator<(const node& a) const {
    if (val == a.val) return id < a.id;
    return val < a.val;
  }
} b[100005];
int a[100005], pos[100005], num[100005 * 3];
long long tree[100005 * 3];
int n, k, len;
long long solve() {
  long long ans, tp, sum;
  int i, j, m, s;
  tp = 0;
  for (i = 1; i <= n; i++) {
    b[i].val = a[i];
    b[i].id = i;
  }
  sort(b + 1, b + n + 1);
  for (i = 1; i <= n; i++) pos[b[i].id] = i;
  memset(tree, 0, sizeof(tree));
  memset(num, 0, sizeof(num));
  for (s = 1; s < n; s <<= 1)
    ;
  s--;
  for (i = 1; i < len; i++) {
    if (a[i] < 0)
      for (j = s + pos[i]; j; j >>= 1) tree[j] += a[i], num[j]++;
    tp += a[i];
  }
  for (i = len; i <= n; i++) {
    tp += a[i] - a[i - len];
    if (a[i - len] < 0)
      for (j = s + pos[i - len]; j; j >>= 1) tree[j] -= a[i - len], num[j]--;
    if (a[i] < 0)
      for (j = s + pos[i]; j; j >>= 1) tree[j] += a[i], num[j]++;
    j = k;
    sum = 0;
    for (m = 1; m <= n + s;) {
      if (num[m] <= j) {
        sum += tree[m];
        break;
      }
      if (num[2 * m] >= j)
        m *= 2;
      else {
        sum += tree[2 * m];
        j -= num[2 * m];
        m = 2 * m + 1;
      }
    }
    if (i == len || ans < tp - sum * 2) ans = tp - sum * 2;
  }
  return ans;
}
int main() {
  long long ans;
  cin >> n >> len;
  for (int i = 1; i <= n; i++) cin >> a[i];
  cin >> k;
  ans = solve();
  for (int i = 1; i <= n; i++) a[i] = -a[i];
  ans = ((ans) > (solve()) ? (ans) : (solve()));
  cout << ans << endl;
  return 0;
}
