#include <bits/stdc++.h>
using namespace std;
long long int maxi;
int tree[100009], n, a[100009], N, len, k;
void update(int idx, int val) {
  while (idx <= n) {
    tree[idx] += val;
    idx += (idx & -idx);
  }
}
int sum(int idx) {
  int val = 0;
  while (idx > 0) {
    val += tree[idx];
    idx -= (idx & -idx);
  }
  return val;
}
int query(int val) {
  int low = 0;
  int high = n;
  int mid = (low + high) / 2;
  while (low < high) {
    int mid = (low + high) / 2;
    if (sum(mid) >= val)
      high = mid;
    else
      low = mid + 1;
  }
  return low;
}
vector<int> neg;
int idx(int num) {
  int ans = lower_bound(neg.begin(), neg.end(), num) - neg.begin();
  return (ans + 1);
}
void solve() {
  memset(tree, 0, sizeof(tree));
  neg.clear();
  set<int> tmp;
  for (int i = int(0); i <= int(N - 1); i++) {
    if (a[i] < 0) tmp.insert(a[i]);
  }
  set<int>::iterator it = tmp.begin();
  while (it != tmp.end()) {
    neg.push_back(*it);
    it++;
  }
  neg.push_back(0);
  n = neg.size();
  long long int su = 0;
  int i = 0, j = 0;
  while (j < N) {
    while (j - i + 1 <= len) {
      if (a[j] < 0) {
        int id1 = query(k), id2 = idx(a[j]);
        if (id2 < id1) {
          su -= (2 * -1 * 1ll * neg[id1 - 1]);
          su += (-1 * 1ll * neg[id2 - 1]);
        } else
          su += a[j];
        update(id2, 1);
      } else
        su += a[j];
      j++;
    }
    maxi = max(maxi, su);
    if (a[i] >= 0)
      su -= a[i];
    else {
      int id1 = idx(a[i]);
      if (sum(id1) <= k) {
        update(id1, -1);
        su += (a[i]);
        id1 = query(k);
        su += (2 * 1ll * -1 * neg[id1 - 1]);
      } else {
        update(id1, -1);
        su += (-1 * 1ll * a[i]);
      }
    }
    i++;
  }
}
int main() {
  scanf("%d", &N);
  scanf("%d", &len);
  maxi = -1 * 1ll * 1000000000 * 1000000000;
  for (int i = int(0); i <= int(N - 1); i++) {
    scanf("%d", &a[i]);
  }
  scanf("%d", &k);
  solve();
  for (int i = int(0); i <= int(N - 1); i++) {
    a[i] *= -1;
  }
  solve();
  printf("%lld\n", maxi);
  return 0;
}
