#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const double Pi = acos(-1.0);
const double EPS = 1e-8;
int n, k, len, a[N];
bool vis[N];
long long solve() {
  memset(vis, false, sizeof(vis));
  long long sum = 0, ret = 0;
  int op = k;
  priority_queue<pair<int, int> > que, rev;
  for (int i = (0); i < (len); ++i) {
    sum += a[i];
    if (a[i] < 0) que.push(make_pair(-a[i], i));
  }
  while (op > 0 && !que.empty()) {
    --op;
    vis[que.top().second] = true;
    sum += que.top().first * 2ll;
    rev.push(make_pair(-que.top().first, que.top().second));
    que.pop();
  }
  ret = max(ret, sum);
  for (int i = (len); i < (n); ++i) {
    if (vis[i - len]) {
      ++op, sum += a[i - len];
    } else {
      sum -= a[i - len];
    }
    sum += a[i];
    if (a[i] < 0) que.push(make_pair(-a[i], i));
    while (op > 0 && !que.empty()) {
      if (que.top().second <= i - len) {
        que.pop();
        continue;
      }
      --op;
      vis[que.top().second] = true;
      sum += que.top().first * 2ll;
      rev.push(make_pair(-que.top().first, que.top().second));
      que.pop();
    }
    while (!que.empty() && !rev.empty()) {
      if (que.top().second <= i - len) {
        que.pop();
        continue;
      }
      if (rev.top().second <= i - len) {
        rev.pop();
        continue;
      }
      if (que.top().first > -rev.top().first) {
        pair<int, int> q = que.top(), r = rev.top();
        que.pop(), rev.pop();
        vis[q.second] = true, vis[r.second] = false;
        sum -= 2ll * a[q.second], sum += 2ll * a[r.second];
        rev.push(make_pair(a[q.second], q.second));
        que.push(make_pair(-a[r.second], r.second));
      } else {
        break;
      }
    }
    ret = max(ret, sum);
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &len);
  for (int i = (0); i < (n); ++i) scanf("%d", a + i);
  scanf("%d", &k);
  long long ans = solve();
  for (int i = (0); i < (n); ++i) a[i] = -a[i];
  ans = max(ans, solve());
  cout << ans << endl;
  return 0;
}
