#include <bits/stdc++.h>
using namespace std;
long long solve(vector<int>& A, int n, int len, int k) {
  multiset<int> neg, etc;
  long long sum = 0, mn = 0;
  for (int i = 1; i <= len; i++) {
    sum += A[i];
    if (A[i] < 0) neg.insert(A[i]), mn += A[i];
    if (neg.size() > k) {
      int mx = *neg.rbegin();
      mn -= mx;
      neg.erase(neg.find(mx));
      etc.insert(mx);
    }
  }
  long long ats = max(abs(sum), abs(sum - 2 * mn));
  for (int i = len + 1; i <= n; i++) {
    sum += A[i];
    if (A[i] < 0) neg.insert(A[i]), mn += A[i];
    if (neg.size() > k) {
      int mx = *neg.rbegin();
      mn -= mx;
      neg.erase(neg.find(mx));
      etc.insert(mx);
    }
    int rem = A[i - len];
    sum -= rem;
    if (rem < 0 && etc.count(rem))
      etc.erase(etc.find(rem));
    else if (rem < 0) {
      neg.erase(neg.find(rem));
      mn -= rem;
      if (!etc.empty()) {
        int add = *etc.begin();
        etc.erase(etc.find(add));
        neg.insert(add);
        mn += add;
      }
    }
    ats = max({ats, abs(sum), abs(sum - 2 * mn)});
  }
  return ats;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, len, k;
  cin >> n >> len;
  vector<int> A(n + 1);
  for (int i = 1; i <= n; i++) cin >> A[i];
  cin >> k;
  long long ats = solve(A, n, len, k);
  for (int i = 1; i <= n; i++) A[i] = -A[i];
  ats = max(ats, solve(A, n, len, k));
  cout << ats << "\n";
}
