#include <bits/stdc++.h>
using namespace std;
long long n, len, k;
vector<long long> arr;
long long solve() {
  long long ans = 0;
  set<pair<long long, long long> > active, avaliable;
  vector<long long> location(n);
  long long boost = 0, sum = 0;
  for (long long i = 0; i < len - 1; ++i) {
    sum += arr[i];
    if (arr[i] < 0) {
      avaliable.insert({2 * arr[i], i});
      location[i] = 2;
    }
  }
  for (long long i = len - 1; i < n; ++i) {
    sum += arr[i];
    if (arr[i] < 0) {
      avaliable.insert({2 * arr[i], i});
      location[i] = 2;
    }
    if (i - len >= 0) {
      if (location[i - len] == 1) {
        active.erase({2 * arr[i - len], i - len});
        location[i - len] = 0;
        boost += 2 * arr[i - len];
      }
      if (location[i - len] == 2) {
        avaliable.erase({2 * arr[i - len], i - len});
        location[i - len] = 0;
      }
      sum -= arr[i - len];
    }
    while (!avaliable.empty() && active.size() < k) {
      pair<long long, long long> best = *avaliable.begin();
      avaliable.erase(avaliable.begin());
      location[best.second] = 1;
      active.insert(best);
      boost -= best.first;
    }
    while (!avaliable.empty() && !active.empty()) {
      pair<long long, long long> _new = *avaliable.begin(),
                                 _old = *active.rbegin();
      if (_new.first >= _old.first) break;
      active.erase(--active.end());
      avaliable.erase(avaliable.begin());
      location[_new.second] = 1;
      location[_old.second] = 2;
      active.insert(_new);
      avaliable.insert(_old);
      boost -= (_new.first);
      boost += (_old.first);
    }
    ans = max(ans, sum + boost);
  }
  return ans;
}
int main() {
  cin >> n >> len;
  arr.resize(n);
  for (long long i = 0; i < n; ++i) cin >> arr[i];
  cin >> k;
  long long ans = 0;
  ans = max(ans, solve());
  for (long long i = 0; i < n; ++i) arr[i] *= -1;
  ans = max(ans, solve());
  cout << ans << '\n';
}
