#include <bits/stdc++.h>
using namespace std;
int INF = 999999999;
double EPSILON = 0.00000001;
long long solve(vector<long long> seq, int maxk, int len) {
  int n = seq.size();
  multiset<long long> negated, others;
  int k = 0;
  long long sum = 0;
  for (int i = 0; i < len; i++) {
    if (seq[i] >= 0)
      sum += seq[i];
    else {
      if (k < maxk) {
        negated.insert(seq[i]);
        k++;
        sum += -seq[i];
      } else if (maxk > 0) {
        multiset<long long>::iterator it = negated.end();
        it--;
        if (*it > seq[i]) {
          others.insert(*it);
          sum += (*it) * 2;
          negated.erase(it);
          negated.insert(seq[i]);
          sum += -seq[i];
        } else {
          sum += seq[i];
          others.insert(seq[i]);
        }
      } else {
        sum += seq[i];
        others.insert(seq[i]);
      }
    }
  }
  long long best = sum;
  for (int i = len; i < n; i++) {
    long long out = seq[i - len];
    long long in = seq[i];
    if (in >= 0 and out >= 0) {
      sum -= out;
      sum += in;
    } else if (in >= 0 and out < 0) {
      multiset<long long>::iterator it = others.find(out);
      if (it != others.end()) {
        others.erase(it);
        sum -= out;
        sum += in;
      } else {
        it = negated.find(out);
        negated.erase(it);
        k--;
        sum -= -out;
        sum += in;
        if (not others.empty()) {
          it = others.begin();
          negated.insert(*it);
          sum -= 2 * (*it);
          others.erase(it);
          k++;
        }
      }
    } else if (in < 0 and out >= 0) {
      sum -= out;
      if (k < maxk) {
        negated.insert(in);
        sum += -in;
        k++;
      } else if (maxk > 0) {
        multiset<long long>::iterator it = negated.end();
        it--;
        if (*it > in) {
          sum += (*it) * 2;
          sum += -in;
          others.insert(*it);
          negated.erase(it);
          negated.insert(in);
        } else {
          others.insert(in);
          sum += in;
        }
      } else {
        others.insert(in);
        sum += in;
      }
    } else if (in < 0 and out < 0) {
      multiset<long long>::iterator it = negated.find(out);
      if (it != negated.end()) {
        sum -= -out;
        others.insert(in);
        sum += in;
        it = others.begin();
        negated.insert(*it);
        sum -= 2 * (*it);
        others.erase(it);
      } else {
        it = others.find(out);
        sum -= out;
        others.erase(it);
        if (k < maxk) {
          negated.insert(in);
          sum += -in;
          k++;
        } else if (maxk > 0) {
          it = negated.end();
          it--;
          if (*it > in) {
            sum += (*it) * 2;
            sum += -in;
            others.insert(*it);
            negated.erase(it);
            negated.insert(in);
          } else {
            others.insert(in);
            sum += in;
          }
        } else {
          others.insert(in);
          sum += in;
        }
      }
    }
    best = ((best) > (sum) ? (best) : (sum));
  }
  return best;
}
int main() {
  int n, len, maxk;
  cin >> n >> len;
  vector<long long> seq(n);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &seq[i]);
  }
  cin >> maxk;
  long long best = solve(seq, maxk, len);
  for (int i = 0; i < n; i++) seq[i] = -seq[i];
  best = ((best) > (solve(seq, maxk, len)) ? (best) : (solve(seq, maxk, len)));
  cout << best << endl;
  return 0;
}
