#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:25600000")
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-9;
long long a[102400];
class maxpt {
 public:
  long long K;
  long long total_sum;
  long long gr_sum;
  multiset<long long> greatest;
  multiset<long long> others;
  maxpt(long long _k) {
    K = _k;
    total_sum = 0;
    gr_sum = 0;
  }
  void add(long long x) {
    total_sum += x;
    if (K == 0) {
      others.insert(x);
      return;
    }
    if (greatest.size() < K) {
      greatest.insert(x);
      gr_sum += x;
      return;
    }
    if (!greatest.empty() && x > *greatest.begin()) {
      long long t = *greatest.begin();
      others.insert(t);
      greatest.erase(greatest.begin());
      greatest.insert(x);
      gr_sum += x - t;
      return;
    }
    others.insert(x);
  }
  void remove(long long x) {
    total_sum -= x;
    if (!others.empty() && others.find(x) != others.end()) {
      multiset<long long>::iterator it = others.find(x);
      others.erase(it);
      return;
    }
    multiset<long long>::iterator it = greatest.find(x);
    greatest.erase(it);
    gr_sum -= x;
    if (others.size()) {
      multiset<long long>::iterator it = others.end();
      --it;
      greatest.insert(*it);
      gr_sum += *it;
      others.erase(it);
    }
  }
};
long long ABS(long long x) {
  if (x < 0) return -x;
  return x;
}
int main() {
  long long n, len;
  cin >> n >> len;
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long k;
  cin >> k;
  long long ans = 0;
  maxpt pos(k), neg(k);
  for (long long i = 0; i < len; i++) {
    if (a[i] >= 0)
      pos.add(a[i]);
    else
      neg.add(-a[i]);
  }
  long long start = 0;
  while (true) {
    assert(pos.greatest.size() <= k);
    ans = max(ans, ABS(pos.total_sum + 2 * neg.gr_sum - neg.total_sum));
    ans = max(ans, ABS(neg.total_sum + 2 * pos.gr_sum - pos.total_sum));
    if (a[start] >= 0)
      pos.remove(a[start]);
    else
      neg.remove(-a[start]);
    if (start + len >= n) break;
    if (a[start + len] >= 0)
      pos.add(a[start + len]);
    else
      neg.add(-a[start + len]);
    ++start;
  }
  cout << ans << endl;
}
