#include <bits/stdc++.h>
long long mod = 1e9 + 7;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
using namespace std;
long long fastpow(long long base, long long pow) {
  if (!base) return 0;
  if (!pow) return 1;
  if (pow == 1) return base;
  long long x = fastpow(base, pow / 2) % mod;
  x *= x;
  x %= mod;
  if (pow % 2) x *= base;
  return x % mod;
}
long long inverse(long long x) { return fastpow(x, mod - 2) % mod; }
long long gethighest(map<long long, long long> &m) {
  if (!m.size()) return -1;
  map<long long, long long>::iterator it = m.end();
  it--;
  return it->first;
}
long long getlowest(map<long long, long long> &m) {
  if (!m.size()) return -1;
  return m.begin()->first;
}
void FUCKINGDELETE(map<long long, long long> &m, long long TOFUCKINGDELETE) {
  m[TOFUCKINGDELETE]--;
  if (!m[TOFUCKINGDELETE]) m.erase(m.find(TOFUCKINGDELETE));
}
long long solve(int n, int k, int len, long long arr[]) {
  map<long long, long long> taken, waiting;
  long long sum = 0, sum2 = 0, ctr = 0, res = 0;
  for (int i = 0; i < len; i++) {
    long long curr = arr[i];
    sum += curr;
    if (curr > 0) {
      long long smallest = getlowest(taken);
      if (ctr < k) {
        sum2 += curr;
        ctr++;
        taken[curr]++;
      } else if (curr > smallest) {
        sum2 -= smallest;
        sum2 += curr;
        taken[curr]++;
        FUCKINGDELETE(taken, smallest);
        waiting[smallest]++;
      } else {
        waiting[curr]++;
      }
    }
  }
  res = max(abs(sum), abs(sum - 2 * sum2));
  int l = 0, r = len;
  while (r < n) {
    long long Add = arr[r], Delete = arr[l];
    sum -= Delete;
    sum += Add;
    if (Delete > 0) {
      long long smallest = getlowest(taken);
      if (Delete >= smallest) {
        sum2 -= Delete;
        FUCKINGDELETE(taken, Delete);
        ctr--;
        long long largest = gethighest(waiting);
        if (largest != -1) {
          ctr++;
          taken[largest]++;
          sum2 += largest;
          FUCKINGDELETE(waiting, largest);
        }
      } else {
        FUCKINGDELETE(waiting, Delete);
      }
    }
    if (Add > 0) {
      long long smallest = getlowest(taken);
      if (ctr < k) {
        ctr++;
        sum2 += Add;
        taken[Add]++;
      } else if (Add > smallest) {
        taken[Add]++;
        sum2 += Add;
        sum2 -= smallest;
        FUCKINGDELETE(taken, smallest);
        waiting[smallest]++;
      } else {
        waiting[Add]++;
      }
    }
    res = max(res, max(abs(sum), abs(sum - 2 * sum2)));
    r++;
    l++;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, len;
  cin >> n >> len;
  long long arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int k;
  cin >> k;
  if (k == 0) {
    long long tot = 0, res = 0;
    for (int i = 0; i < len; i++) tot += arr[i];
    res = abs(tot);
    for (int i = len; i < n; i++) {
      tot -= arr[i - len];
      tot += arr[i];
      res = max(abs(tot), res);
    }
    return cout << res, 0;
  }
  long long first = solve(n, k, len, arr);
  for (int i = 0; i < n; i++) arr[i] *= -1;
  long long second = solve(n, k, len, arr);
  cout << max(second, first);
  return 0;
}
