#include <bits/stdc++.h>
using namespace std;
struct node {
  long long int sm, c = 0;
};
node po[100005 * 4], ne[100005 * 4];
long long int n, k, res, a[100005], l, g = 0, cur, x, y, t[100005];
pair<long long int, long long int> p[100005];
void update(long long int low, long long int high, long long int pos,
            long long int qpos, bool b, node sg[], long long int va) {
  if (low > qpos || high < qpos) return;
  if (low == high) {
    if (b)
      sg[pos].sm = va, sg[pos].c = 1;
    else
      sg[pos].sm = sg[pos].c = 0;
    return;
  }
  long long int mid = (high + low) / 2;
  update(low, mid, pos * 2 + 1, qpos, b, sg, va);
  update(mid + 1, high, pos * 2 + 2, qpos, b, sg, va);
  sg[pos].sm = sg[pos * 2 + 1].sm + sg[pos * 2 + 2].sm;
  sg[pos].c = sg[pos * 2 + 1].c + sg[pos * 2 + 2].c;
}
long long int ans(long long int low, long long int high, long long int pos,
                  node sg[], long long int mt, long long int taken = 0LL) {
  if (low == high) return 0;
  long long int mid = (high + low) / 2;
  if (sg[pos * 2 + 1].c + taken > mt)
    return ans(low, mid, pos * 2 + 1, sg, mt, taken);
  else
    return sg[pos * 2 + 1].sm +
           ans(mid + 1, high, pos * 2 + 2, sg, mt, taken + sg[pos * 2 + 1].c);
}
long long int mot(long long int nm) { return max(nm, -nm); }
int main() {
  scanf("%lld%lld", &n, &l);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]), p[i] = make_pair(a[i], i);
  scanf("%lld", &k);
  sort(p, p + n);
  for (int i = 0; i < n; i++) t[p[i].second] = i;
  for (int i = 0; i < l; i++)
    cur += a[i], update(0, n, 0, t[i], true, (a[i] >= 0) ? po : ne, a[i]);
  res = max(res, cur);
  x = po[0].sm - ans(0, n, 0, po, po[0].c - min(po[0].c, k));
  y = ans(0, n, 0, ne, min(ne[0].c, k));
  res = max(res, mot(cur - 2 * x));
  res = max(res, mot(cur - 2 * y));
  for (int i = l, j = 0; i < n; i++, j++) {
    update(0, n, 0, t[j], false, (a[j] >= 0) ? po : ne, a[j]);
    update(0, n, 0, t[i], true, (a[i] >= 0) ? po : ne, a[i]);
    cur -= a[j], cur += a[i];
    res = max(res, cur);
    x = po[0].sm - ans(0, n, 0, po, po[0].c - min(po[0].c, k));
    y = ans(0, n, 0, ne, min(ne[0].c, k));
    res = max(res, mot(cur - 2 * x));
    res = max(res, mot(cur - 2 * y));
  }
  printf("%lld\n", res);
  return 0;
}
