#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
set<pii> neg_rem, neg_top;
set<pii> pos_rem, pos_top;
ll neg_sum, pos_sum;
ll neg_top_sum, pos_top_sum;
ll mx = LLONG_MIN, mn = LLONG_MAX;
ll a[111111];
int n, len, k;
void upd() {
  while ((int)pos_top.size() > k) {
    auto t = pos_top.begin();
    pos_rem.insert(*t);
    pos_top_sum -= t->first;
    pos_top.erase(t);
  }
  while ((int)neg_top.size() > k) {
    auto t = neg_top.find(*neg_top.rbegin());
    neg_rem.insert(*t);
    neg_top_sum -= t->first;
    neg_top.erase(t);
  }
  while ((int)pos_top.size() < k && !pos_rem.empty()) {
    auto t = pos_rem.find(*pos_rem.rbegin());
    pos_top.insert(*t);
    pos_top_sum += t->first;
    pos_rem.erase(t);
  }
  while ((int)neg_top.size() < k && !neg_rem.empty()) {
    auto t = neg_rem.begin();
    neg_top.insert(*t);
    neg_top_sum += t->first;
    neg_rem.erase(t);
  }
  while (!pos_top.empty() && !pos_rem.empty()) {
    auto tp = pos_top.begin(), rm = pos_rem.find(*pos_rem.rbegin());
    if (tp->first >= rm->first) break;
    pos_top_sum -= tp->first, pos_top_sum += rm->first;
    pos_top.insert(*rm), pos_rem.insert(*tp);
    pos_top.erase(*tp), pos_rem.erase(*rm);
  }
  while (!neg_top.empty() && !neg_rem.empty()) {
    auto tp = neg_top.find(*neg_top.rbegin()), rm = neg_rem.begin();
    if (tp->first <= rm->first) break;
    neg_top_sum -= tp->first, neg_top_sum += rm->first;
    neg_top.insert(*rm), neg_rem.insert(*tp);
    neg_top.erase(*tp), neg_rem.erase(*rm);
  }
  mx = max({mx, pos_sum + neg_sum, pos_sum + neg_sum - 2 * neg_top_sum});
  mn = min({mn, pos_sum + neg_sum, pos_sum + neg_sum - 2 * pos_top_sum});
}
int main() {
  cin >> n >> len;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < len; ++i) {
    if (a[i] > 0) {
      pos_top.insert({a[i], i});
      pos_sum += a[i];
      pos_top_sum += a[i];
    } else if (a[i] < 0) {
      neg_top.insert({a[i], i});
      neg_sum += a[i];
      neg_top_sum += a[i];
    }
  }
  cin >> k;
  upd();
  for (int i = len; i < n; ++i) {
    if (a[i - len] > 0)
      pos_sum -= a[i - len];
    else if (a[i - len] < 0)
      neg_sum -= a[i - len];
    pii old = pii(a[i - len], i - len);
    if (neg_top.count(old)) neg_top.erase(old), neg_top_sum -= a[i - len];
    if (neg_rem.count(old)) neg_rem.erase(old);
    if (pos_top.count(old)) pos_top.erase(old), pos_top_sum -= a[i - len];
    if (pos_rem.count(old)) pos_rem.erase(old);
    if (a[i] > 0) {
      pos_sum += a[i];
      pos_top.insert({a[i], i});
      pos_top_sum += a[i];
    } else if (a[i] < 0) {
      neg_sum += a[i];
      neg_top.insert({a[i], i});
      neg_top_sum += a[i];
    }
    upd();
  }
  cout << max(abs(mx), abs(mn)) << endl;
  return 0;
}
