#include <bits/stdc++.h>
using namespace std;
struct emin {
  long long x, i;
};
struct emax {
  long long x, i;
};
bool operator<(emin A, emin B) { return A.x > B.x; };
bool operator<(emax A, emax B) { return A.x < B.x; };
priority_queue<emax> all;
priority_queue<emin> need;
emin tmin;
emax tmax;
const long long N = 100010LL;
long long n, l, c, i, j, k, cur_all, cur_neg, res, neg_cnt;
long long a[N], s[N];
bool f[N], ff[N];
void read_data() {
  cin >> n >> l;
  for (i = 1LL; i <= n; i++) cin >> a[i];
  cin >> c;
}
void write_data() { cout << res << endl; }
void filling() {
  while (neg_cnt < c) {
    if (all.empty()) break;
    tmin.x = all.top().x;
    tmin.i = all.top().i;
    all.pop();
    if (f[tmin.i]) {
      ff[tmin.i] = true;
      need.push(tmin);
      cur_neg += tmin.x;
      neg_cnt++;
    }
  }
}
void addd(long long i) {
  if (a[i] >= 0LL) return;
  tmax.x = -a[i];
  tmax.i = i;
  all.push(tmax);
}
void lost(long long i) {
  f[i] = false;
  if (ff[i]) {
    ff[i] = false;
    cur_neg += a[i];
    neg_cnt--;
  }
}
void go() {
  while (!need.empty()) {
    if (!ff[need.top().i])
      need.pop();
    else
      break;
  }
  if (need.empty()) return;
  tmax.i = need.top().i;
  tmax.x = need.top().x;
  need.pop();
  all.push(tmax);
  ff[tmax.i] = false;
  cur_neg += a[tmax.i];
  neg_cnt--;
}
void work() {
  while (!all.empty()) all.pop();
  while (!need.empty()) need.pop();
  for (i = 1LL; i <= n; i++) s[i] = s[i - 1LL] + a[i];
  for (i = 1LL; i <= n; i++) f[i] = true;
  for (i = 1LL; i <= n; i++) ff[i] = false;
  for (i = 1LL; i <= l; i++) addd(i);
  neg_cnt = 0;
  cur_neg = 0;
  cur_all = s[l];
  filling();
  res = max(res, cur_all + 2LL * cur_neg);
  for (i = 1LL; i + l <= n; i++) {
    lost(i);
    addd(i + l);
    go();
    go();
    filling();
    cur_all = s[i + l] - s[i];
    res = max(res, cur_all + 2LL * cur_neg);
  }
}
int main() {
  read_data();
  work();
  for (i = 1LL; i <= n; i++) a[i] = -a[i];
  work();
  write_data();
}
