#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:200000000")
const double EPS = 1E-9;
const int INF = 1000000000;
const long long INF64 = (long long)1E18;
const double PI = 3.1415926535897932384626433832795;
int n, len, k;
long long a[110000];
long long sq;
set<pair<long long, int> > q1, q2;
void add(int id) {
  if (a[id] < 0) {
    q1.insert(make_pair(-2 * a[id], id));
    sq += -2 * a[id];
    if ((int)q1.size() > k) {
      sq -= q1.begin()->first;
      q2.insert(*q1.begin());
      q1.erase(q1.begin());
    }
  }
}
void del(int id) {
  if (a[id] < 0) {
    if (q1.count(make_pair(-2 * a[id], id))) {
      sq -= -2 * a[id];
      q1.erase(make_pair(-2 * a[id], id));
    } else
      q2.erase(make_pair(-2 * a[id], id));
    if ((int)q1.size() < k && !q2.empty()) {
      sq += q2.rbegin()->first;
      q1.insert(*q2.rbegin());
      q2.erase(--q2.end());
    }
  }
}
long long solve() {
  sq = 0;
  q1.clear();
  q2.clear();
  long long sum = 0;
  for (int i = 0; i < (int)(len); i++) {
    add(i);
    sum += a[i];
  }
  long long res = sum + sq;
  for (int i = len; i < n; i++) {
    del(i - len);
    add(i);
    sum -= a[i - len];
    sum += a[i];
    res = max(res, sum + sq);
  }
  return res;
}
int main() {
  cin >> n >> len;
  for (int i = 0; i < (int)(n); i++) scanf("%I64d", &a[i]);
  cin >> k;
  k = min(k, len);
  long long res = solve();
  for (int i = 0; i < (int)(n); i++) a[i] *= -1;
  res = max(res, solve());
  cout << res << endl;
  return 0;
}
