#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int n;
  cin >> n;
  int len;
  cin >> len;
  vector<long long int> va;
  for (int i = 0; i < n; ++i) {
    long long int val;
    cin >> val;
    va.push_back(val);
  }
  int k;
  cin >> k;
  long long int maxSum = 0;
  for (int gIdx = 0; gIdx < 2; ++gIdx) {
    if (gIdx == 1) {
      for (int i = 0; i < va.size(); ++i) va[i] = -va[i];
    }
    multiset<long long int> kSet;
    multiset<long long int> vSet;
    long long int sum = 0;
    for (int i = 0; i < va.size(); ++i) {
      if (i >= len) {
        multiset<long long int>::iterator vIt = vSet.find(va[i - len]);
        if (vIt != vSet.end()) {
          vSet.erase(vIt);
          sum -= va[i - len];
        } else {
          multiset<long long int>::iterator kIt = kSet.find(va[i - len]);
          kSet.erase(kIt);
          sum -= -va[i - len];
        }
      }
      vSet.insert(va[i]);
      sum += va[i];
      if (kSet.size() < k) {
        long long int val = *(vSet.begin());
        if (val < 0) {
          vSet.erase(vSet.begin());
          sum -= val;
          kSet.insert(val);
          sum += -val;
        }
      }
      if (!kSet.empty() && !vSet.empty()) {
        long long int val = *(vSet.begin());
        long long int kVal = *(--kSet.end());
        if (kVal > val) {
          kSet.erase(--kSet.end());
          vSet.erase(vSet.begin());
          sum += 2 * kVal;
          sum -= 2 * val;
          kSet.insert(val);
          vSet.insert(kVal);
        }
      }
      if (i >= len - 1) {
        if (maxSum < sum) maxSum = sum;
        if (maxSum < -sum) maxSum = -sum;
      }
    }
  }
  cout << maxSum;
  return 0;
}
