#include <bits/stdc++.h>
using namespace std;
typedef struct item {
  item *l, *r;
  int key, prior, cnt;
  long long sum;
  item(int key) : key(key), cnt(1), sum(key), l(0), r(0), prior(rand()) {}
} * pitem;
void print(pitem t) {
  if (!t) return;
  print(t->l);
  printf("%d ", t->key);
  print(t->r);
}
int cnt(pitem t) { return t ? t->cnt : 0; }
long long sum(pitem t) { return t ? t->sum : 0; }
void upd(pitem t) {
  if (!t) return;
  t->cnt = cnt(t->l) + cnt(t->r) + 1;
  t->sum = t->key + sum(t->l) + sum(t->r);
}
void merge(pitem &t, pitem l, pitem r) {
  if (!l || !r) return (void)(t = l ? l : r);
  if (l->prior > r->prior)
    merge(l->r, l->r, r), t = l;
  else
    merge(r->l, l, r->l), t = r;
  upd(t);
}
void split(pitem t, pitem &l, pitem &r, int key) {
  if (!t) return (void)(l = r = 0);
  if (t->key > key)
    split(t->l, l, t->l, key), r = t;
  else
    split(t->r, t->r, r, key), l = t;
  upd(l);
  upd(r);
}
void insert(pitem &t, int key) {
  pitem l = 0;
  split(t, l, t, key);
  merge(l, l, new item(key));
  merge(t, l, t);
}
void erase(pitem &t, int key) {
  pitem l = 0, r = 0;
  split(t, l, t, key - 1);
  split(t, t, r, key);
  merge(t, t->l, t->r);
  merge(t, l, t);
  merge(t, t, r);
}
long long getLastKSum(pitem t, int k) {
  if (!t || !k) return 0;
  if (cnt(t) <= k) return t->sum;
  if (cnt(t->r) >= k) return getLastKSum(t->r, k);
  return sum(t->r) + t->key + getLastKSum(t->l, k - cnt(t->r) - 1);
}
pitem positive, negative;
const int MAXN = 200000;
int n, k, len;
int a[MAXN];
long long res;
int main() {
  scanf("%d%d", &n, &len);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  scanf("%d", &k);
  for (int i = 0; i < len; ++i) {
    if (a[i] < 0) insert(negative, -a[i]);
    if (a[i] > 0) insert(positive, a[i]);
    res += a[i];
  }
  for (int i = 0; i <= n - len; ++i) {
    if (i != 0) {
      if (a[i - 1] < 0) erase(negative, -a[i - 1]);
      if (a[i - 1] > 0) erase(positive, a[i - 1]);
      if (a[i + len - 1] < 0) insert(negative, -a[i + len - 1]);
      if (a[i + len - 1] > 0) insert(positive, a[i + len - 1]);
    }
    long long s = sum(positive) - sum(negative);
    res = max(res, max(abs(s - 2 * getLastKSum(positive, k)),
                       abs(s + 2 * getLastKSum(negative, k))));
  }
  printf("%I64d", res);
}
