#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct heap {
  long long sum, k;
  multiset<int, T> rest, active;
  heap(int k_) : sum(0), k(k_) {}
  void balance() {
    while (rest.size() > 0 && active.size() < k) {
      auto from = rest.rbegin();
      sum += *from;
      active.insert(*from);
      rest.erase(rest.find(*from));
    }
    while (active.size() > k) {
      auto from = active.begin();
      sum -= *from;
      rest.insert(*from);
      active.erase(from);
    }
    while (active.size() > 0 && rest.size() > 0) {
      if (T()(*active.begin(), *rest.rbegin())) {
        auto from = active.begin();
        auto to = rest.rbegin();
        active.insert(*to);
        rest.insert(*from);
        sum -= *from - *to;
        rest.erase(rest.find(*to));
        active.erase(from);
      } else
        break;
    }
  }
  void del(long long n) {
    auto it = active.find(n);
    if (it != active.end()) {
      active.erase(it);
      sum -= n;
      balance();
    } else {
      rest.erase(rest.find(n));
    }
  }
  void add(long long n) {
    rest.insert(n);
    balance();
  }
};
void test() {}
int main() {
  test();
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  int n, len;
  cin >> n >> len;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int k;
  cin >> k;
  heap<less<int> > pos(k);
  heap<greater<int> > neg(k);
  long long sum = 0;
  for (int i = 0; i < len; i++) {
    if (a[i] > 0) {
      pos.add(a[i]);
    } else if (a[i] < 0) {
      neg.add(a[i]);
    }
    sum += a[i];
  }
  long long ans =
      max(abs(sum), max(abs(sum - 2 * neg.sum), abs(sum - 2 * pos.sum)));
  for (int i = len; i < n; i++) {
    if (a[i] > 0) {
      pos.add(a[i]);
    } else if (a[i] < 0) {
      neg.add(a[i]);
    }
    if (a[i - len] > 0) {
      pos.del(a[i - len]);
    } else if (a[i - len] < 0) {
      neg.del(a[i - len]);
    }
    sum += a[i] - a[i - len];
    ans = max(ans, abs(sum - 2 * neg.sum));
    ans = max(ans, abs(sum - 2 * pos.sum));
    ans = max(ans, abs(sum));
  }
  cout << ans << endl;
  return 0;
}
