#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, l, k;
  cin >> n >> l;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  cin >> k;
  long long int maxx, sum;
  maxx = 0;
  for (int z = 0; z < 2; z++) {
    sum = 0;
    multiset<int> s1, s2;
    if (z == 1) {
      for (int i = 0; i < n; i++) arr[i] = -arr[i];
    }
    for (int i = 0; i < n; i++) {
      if (arr[i] >= 0)
        sum += arr[i];
      else if (s1.size() < k) {
        sum += -arr[i];
        s1.insert(arr[i]);
      } else if (k && arr[i] < *(--s1.end())) {
        sum += -arr[i];
        int tmp = *(--s1.end());
        s1.erase(s1.find(tmp));
        s1.insert(arr[i]);
        sum += 2 * tmp;
        s2.insert(tmp);
      } else {
        s2.insert(arr[i]);
        sum += arr[i];
      }
      int ind = i - l;
      if (ind >= 0) {
        if (arr[ind] >= 0)
          sum -= arr[ind];
        else if (s1.find(arr[ind]) != s1.end()) {
          s1.erase(s1.find(arr[ind]));
          sum += arr[ind];
          if (!s2.empty()) {
            int tmp = *(s2.begin());
            s2.erase(s2.find(tmp));
            s1.insert(tmp);
            sum += -2 * tmp;
          }
        } else {
          s2.erase(s2.find(arr[ind]));
          sum += -arr[ind];
        }
      }
      if (i + 1 >= l) maxx = max(maxx, sum);
    }
  }
  cout << maxx << endl;
}
