#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
const int M = 1e3;
const int inf = 1000000009;
const long long base = 1e18;
const double pi = acos(-1);
const double ep = 1e-9;
multiset<int> big, small;
int n, k, len;
long long sum = 0;
int a[N];
void add(int x) {
  big.insert(x);
  sum += x;
  if (big.size() > k) {
    multiset<int>::iterator it = big.end();
    it--;
    small.insert(*it);
    sum -= *it;
    big.erase(it);
  }
}
void erase(int x) {
  if (small.find(x) != small.end()) {
    small.erase(small.find(x));
    return;
  }
  big.erase(big.find(x));
  sum -= x;
  if (!small.empty()) {
    multiset<int>::iterator it = small.begin();
    big.insert(*it);
    sum += *it;
    small.erase(it);
  }
}
long long solve() {
  long long ans = 0;
  long long cur = 0;
  sum = 0;
  big.clear();
  small.clear();
  for (int i = 1; i < len; i++) {
    if (a[i] < 0) add(a[i]);
    cur += a[i];
  }
  for (int i = len; i <= n; i++) {
    if (a[i] < 0) add(a[i]);
    cur += a[i];
    if (a[i - len] < 0) erase(a[i - len]);
    cur -= a[i - len];
    ans = max(ans, abs(cur - 2 * sum));
  }
  return ans;
}
int main() {
  cin >> n >> len;
  for (int i = 1; i < n + 1; i++) scanf("%d", a + i);
  cin >> k;
  k = min(k, len);
  long long ret = solve();
  for (int i = 1; i < n + 1; i++) a[i] = -a[i];
  ret = max(ret, solve());
  cout << ret;
}
