#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const double err = 1e-12;
const double PI = 3.141592653589793;
const int N = 1e5 + 5;
int n, len, k;
vector<long long> V(N);
long long sm, ngsm, mxsm = 0;
set<pair<int, int> > ng1, ng2;
void ad(int idx) {
  if (k == 0) return;
  if (ng1.size() < k) {
    ng1.insert({V[idx], idx});
    ngsm += abs((long long)V[idx]);
  } else {
    auto it = prev(ng1.end());
    if ((*it).first >= V[idx]) {
      ng2.insert(*it);
      ngsm -= abs((long long)((*it).first));
      ng1.erase(it);
      ng1.insert({V[idx], idx});
      ngsm += abs((long long)V[idx]);
    } else {
      ng2.insert({V[idx], idx});
    }
  }
}
void er(int idx) {
  auto it = ng1.find({V[idx], idx});
  if (it != ng1.end()) {
    ngsm -= abs((long long)((*it).first));
    ng1.erase(it);
    if (ng2.size() > 0) {
      auto it2 = ng2.begin();
      ng1.insert(*it2);
      ngsm += abs((long long)((*it2).first));
      ng2.erase(it2);
    }
  } else {
    auto it2 = ng2.find({V[idx], idx});
    if (it2 != ng2.end()) ng2.erase(it2);
  }
}
void solve() {
  cin >> n >> len;
  for (int i = 0; i < n; i++) cin >> V[i];
  cin >> k;
  for (int t = 0; t < 2; t++) {
    if (t & 1) {
      for (int i = 0; i < n; i++) V[i] *= -1;
    }
    sm = 0;
    ngsm = 0;
    int l = 0;
    ng1.erase(ng1.begin(), ng1.end());
    ng2.erase(ng2.begin(), ng2.end());
    while (l < len) {
      sm += V[l];
      if (V[l] < 0) {
        ad(l);
      }
      l++;
    }
    l--;
    while (1) {
      mxsm = max(mxsm, sm + 2 * ngsm);
      l++;
      if (l >= n) break;
      sm -= V[l - len];
      if (V[l - len] < 0) er(l - len);
      sm += V[l];
      if (V[l] < 0) ad(l);
    }
  }
  cout << mxsm << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
