#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 50;
long long a[N];
int main() {
  int n, len;
  cin >> n >> len;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int k;
  cin >> k;
  auto solve = [&](int flag) -> long long {
    for (int i = 1; i <= n; i++) a[i] *= flag;
    multiset<long long> x, y;
    long long now = 0, ans = -1e18;
    for (int i = 1; i <= n; i++) {
      if (a[i] >= 0)
        now += a[i];
      else if (x.size() < k) {
        now += -a[i];
        x.insert(a[i]);
      } else if (k && a[i] < *--x.end()) {
        now += -a[i];
        now += 2 * (*--x.end());
        y.insert(*--x.end());
        x.erase(--x.end());
        x.insert(a[i]);
      } else {
        y.insert(a[i]);
        now += a[i];
      }
      int j = i - len;
      if (j >= 1) {
        if (a[j] >= 0)
          now -= a[j];
        else if (x.find(a[j]) != x.end()) {
          now -= -a[j];
          x.erase(x.find(a[j]));
          if (y.size()) {
            now -= 2 * (*y.begin());
            x.insert(*y.begin());
            y.erase(y.begin());
          }
        } else {
          y.erase(y.find(a[j]));
          now -= a[j];
        }
      }
      if (j >= 0) ans = max(ans, now);
    }
    return ans;
  };
  cout << max(solve(-1), solve(1)) << endl;
  return 0;
}
