#include <bits/stdc++.h>
using namespace std;
int getsmallest(map<int, int>& x) {
  if (x.empty()) return -1;
  map<int, int>::iterator it = x.begin();
  return it->first;
}
int getlargest(map<int, int>& x) {
  if (x.empty()) return -1;
  map<int, int>::iterator it = x.end();
  it--;
  return it->first;
}
void RemoveElement(map<int, int>& x, int element) {
  x[element]--;
  if (!x[element]) x.erase(x.find(element));
  return;
}
long long solve(vector<int>& vec, int n, int len, int k) {
  long long ret = 0;
  int taken = 0;
  long long sum = 0, sum2 = 0;
  map<int, int> x1, x2;
  for (int i = 0; i < len; i++) {
    sum += vec[i];
    if (vec[i] > 0) {
      int sm1 = getsmallest(x1);
      if (taken < k) {
        taken++;
        x1[vec[i]]++;
        sum2 += vec[i];
      } else if (vec[i] > sm1) {
        sum2 -= sm1;
        sum2 += vec[i];
        x1[vec[i]]++;
        RemoveElement(x1, sm1);
        x2[sm1]++;
      } else {
        x2[vec[i]]++;
      }
    }
  }
  ret = max(ret, max(abs(sum), abs(sum - 2 * sum2)));
  for (int i = len; i < n; i++) {
    int element = vec[i - len];
    sum -= element;
    sum += vec[i];
    if (element > 0) {
      int sm1 = getsmallest(x1);
      if (element >= sm1) {
        taken--;
        RemoveElement(x1, element);
        sum2 -= element;
        int lg2 = getlargest(x2);
        if (lg2 != -1) {
          taken++;
          x1[lg2]++;
          sum2 += lg2;
          RemoveElement(x2, lg2);
        }
      } else {
        RemoveElement(x2, element);
      }
    }
    if (vec[i] > 0) {
      int sm1 = getsmallest(x1);
      if (taken < k) {
        taken++;
        x1[vec[i]]++;
        sum2 += vec[i];
      } else if (vec[i] > sm1) {
        x1[vec[i]]++;
        sum2 += vec[i];
        sum2 -= sm1;
        RemoveElement(x1, sm1);
        x2[sm1]++;
      } else {
        x2[vec[i]]++;
      }
    }
    ret = max(ret, max(abs(sum), abs(sum - 2 * sum2)));
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, len, k;
  cin >> n >> len;
  vector<int> vec(n);
  for (auto& x : vec) cin >> x;
  cin >> k;
  if (k == 0) {
    long long ans = 0, sum = 0;
    for (int i = 0; i < len; i++) sum += vec[i];
    ans = abs(sum);
    for (int i = len; i < n; i++) {
      sum -= vec[i - len];
      sum += vec[i];
      ans = max(ans, abs(sum));
    }
    cout << ans;
    return 0;
  }
  long long ans = solve(vec, n, len, k);
  for (auto& x : vec) x *= -1;
  ans = max(ans, solve(vec, n, len, k));
  cout << ans;
  return 0;
}
