#include <bits/stdc++.h>
using namespace std;
multiset<pair<int, int> > q, w;
int n, len, kmax;
int d[100010], vis[100010];
long long sum[100010];
int sz;
long long ss, final;
void ins(int i) {
  if (kmax == 0) return;
  if (d[i] < 0)
    if (sz < kmax)
      sz++, q.insert(make_pair(d[i], i)), ss += d[i], vis[i] = 1;
    else {
      multiset<pair<int, int> >::iterator iter = --q.end();
      if (iter->first > d[i]) {
        vis[iter->second] = 0;
        ss = ss - iter->first + d[i];
        w.insert(*iter);
        q.erase(iter);
        q.insert(make_pair(d[i], i));
        vis[i] = 1;
      } else
        w.insert(make_pair(d[i], i));
    }
}
void del(int i) {
  if (kmax == 0) return;
  if (d[i] >= 0) return;
  if (!vis[i])
    w.erase(w.find(make_pair(d[i], i)));
  else {
    sz--;
    ss -= d[i];
    q.erase(q.find(make_pair(d[i], i)));
    if (!w.empty()) {
      multiset<pair<int, int> >::iterator iter = w.begin();
      sz++;
      ss += iter->first;
      vis[iter->second] = 1;
      q.insert(*iter);
      w.erase(iter);
    }
  }
}
void solve() {
  memset(vis, 0, sizeof vis);
  sum[0] = 0;
  for (int i = (1); i <= (n); i++) sum[i] = sum[i - 1] + d[i];
  q.clear();
  w.clear();
  sz = 0;
  ss = 0;
  for (int i = (1); i <= (len); i++) ins(i);
  for (int i = (len); i <= (n); i++) {
    final = max(final, sum[i] - sum[i - len] - 2 * ss);
    if (i != n) {
      del(i - len + 1);
      ins(i + 1);
    }
  }
}
void lemon() {
  scanf("%d%d", &n, &len);
  for (int i = (1); i <= (n); i++) scanf("%d", &d[i]);
  scanf("%d", &kmax);
  final = -1000000000000000000LL;
  solve();
  for (int i = (1); i <= (n); i++) d[i] = -d[i];
  solve();
  printf("%I64d\n", final);
}
int main() {
  ios::sync_with_stdio(true);
  lemon();
  return 0;
}
