#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  long long int len;
  cin >> n >> len;
  vector<long long int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  long long int k;
  cin >> k;
  long long int res = 0;
  for (long long int sgn = 0; sgn <= 1; sgn++) {
    if (sgn == 1) {
      for (int i = 0; i < n; i++) a[i] = -a[i];
    }
    std::multiset<long long int> s1, s2;
    std::multiset<long long int>::iterator it;
    vector<long long int> pre(n + 1, 0);
    for (int i = 0; i < n; i++) {
      pre[i + 1] = pre[i] + a[i];
    }
    for (int i = 0; i < len; i++) {
      if (a[i] < 0) {
        if (s1.size() < k)
          s1.insert(-a[i]);
        else {
          s2.insert(-a[i]);
          it = s2.end();
          --it;
          if (*it > *(s1.begin())) {
            long long int x1 = *(s1.begin());
            s1.erase(s1.find(x1));
            s1.insert(*it);
            s2.erase(s2.find(*it));
            s2.insert(x1);
          }
        }
      }
    }
    long long int negsum = 0;
    for (it = s1.begin(); it != s1.end(); ++it) {
      negsum += *(it);
    }
    long long int sum = 0;
    long long int cc = 0;
    sum = pre[len] - pre[0] + 2 * negsum;
    long long int ans = sum;
    res = max(ans, res);
    long long int i = 1;
    while (i + len - 1 < n) {
      if (a[i - 1] >= 0)
        sum -= a[i - 1];
      else {
        if (s1.find(-a[i - 1]) != s1.end()) {
          sum -= (-a[i - 1]);
          s1.erase(s1.find(-a[i - 1]));
          if (s2.size() > 0) {
            it = s2.end();
            --it;
            s1.insert(*it);
            long long int op = *it;
            s2.erase(s2.find(op));
            sum += 2 * (op);
          }
        } else {
          sum -= a[i - 1];
          if (s2.find(-a[i - 1]) != s2.end()) s2.erase(s2.find(-a[i - 1]));
        }
      }
      long long int ind = i + len - 1;
      if (a[ind] >= 0) {
        sum += a[ind];
      } else {
        sum += a[ind];
        s2.insert(-a[ind]);
        long long int flag = 1;
        while (s1.size() < k && s2.size() > 0) {
          it = s2.end();
          --it;
          long long int yyy = *(it);
          sum += (2 * (yyy));
          s1.insert(yyy);
          s2.erase(s2.find(yyy));
          flag = 0;
        }
        if (s1.size() == k && s2.size() > 0 && flag == 1) {
          it = --s2.end();
          long long int x1 = *(s1.begin());
          long long int yy = *(it);
          if (x1 < yy) {
            sum -= (2 * x1);
            sum += (2 * yy);
            s1.erase(s1.find(x1));
            s1.insert(yy);
            s2.erase(s2.find(yy));
            s2.insert(x1);
          }
        }
      }
      ans = max(ans, sum);
      ++i;
    }
    res = max(ans, res);
  }
  cout << res << endl;
}
