#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long n, len, a[N], K, pre[N];
long long ans;
multiset<long long> s1, s2;
void solve() {
  long long sum = 0;
  multiset<long long>::iterator it;
  for (int i = 1; i <= n; i++) {
    if (a[i] >= 0)
      sum += a[i];
    else {
      if (s1.size() == K) {
        if (a[i] <= *s1.rbegin()) {
          s1.insert(a[i]), sum += -a[i];
          int k = *s1.rbegin();
          s2.insert(k), s1.erase(s1.find(k));
          sum -= -k, sum += k;
        } else {
          sum += a[i];
          s2.insert(a[i]);
        }
      } else {
        sum += -a[i];
        s1.insert(a[i]);
      }
    }
    if (i > len) {
      if (a[i - len] >= 0)
        sum -= a[i - len];
      else {
        if (s1.size() == K) {
          if (a[i - len] <= *s1.rbegin()) {
            sum -= -a[i - len];
            s1.erase(s1.find(a[i - len]));
            if (s2.size()) {
              int k = *s2.begin();
              s1.insert(k);
              s2.erase(s2.begin());
              sum -= k;
              sum += -k;
            }
          } else {
            sum -= a[i - len];
            s2.erase(s2.find(a[i - len]));
          }
        } else {
          sum -= -a[i - len];
          s1.erase(s1.find(a[i - len]));
        }
      }
    }
    if (i >= len) ans = max(ans, sum);
  }
}
int main() {
  cin >> n >> len;
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]), pre[i] = pre[i - 1] + a[i];
  cin >> K;
  if (!K) {
    for (int i = len; i <= n; i++) ans = max(ans, abs(pre[i] - pre[i - len]));
    cout << ans << endl;
    return 0;
  }
  solve();
  s1.clear(), s2.clear();
  for (int i = 1; i <= n; i++) a[i] = -a[i];
  solve();
  cout << ans << endl;
  return 0;
}
