#include <bits/stdc++.h>
using namespace std;
const int M = 100000 + 10;
struct QUERY {
  int L, R;
  int totalblock;
  bool operator<(const QUERY& x) const {
    int interlen = sqrt(1.0 * totalblock);
    if ((L / interlen) != (x.L / interlen)) {
      return (L / interlen) < (x.L / interlen);
    } else {
      return R < x.R;
    }
  }
} query[M];
long long int maxksum;
multiset<int> maxk, candidatek;
int a[M];
long long int prefixsum[M];
int k;
void Add(int id) {
  if (a[id] >= 0) {
    return;
  } else {
    int isize = maxk.size();
    if (isize < k) {
      maxk.insert(-a[id]);
      maxksum = maxksum + (-a[id]);
    } else {
      multiset<int>::iterator it = maxk.begin();
      int lastval = (*it);
      if (lastval >= (-a[id])) {
        candidatek.insert(-a[id]);
      } else {
        maxksum = maxksum - lastval + (-a[id]);
        candidatek.insert(lastval);
        maxk.erase(it);
        maxk.insert(-a[id]);
      }
    }
  }
  return;
}
void Remove(int id) {
  if (a[id] >= 0) {
    return;
  } else {
    multiset<int>::iterator it = candidatek.find(-a[id]);
    if (it != candidatek.end()) {
      candidatek.erase(it);
    } else {
      it = maxk.find(-a[id]);
      maxksum = maxksum - (-a[id]);
      maxk.erase(it);
      int isize = candidatek.size();
      if (isize > 0) {
        multiset<int>::reverse_iterator rit = candidatek.rbegin();
        int lastval = (*rit);
        it = candidatek.find(lastval);
        candidatek.erase(it);
        maxksum = maxksum + lastval;
        maxk.insert(lastval);
      }
    }
    return;
  }
}
long long int ans = -1;
void Mo(int qnum) {
  maxk.clear();
  candidatek.clear();
  maxksum = 0;
  int curL = 0;
  int curR = -1;
  for (int i = 0; i < qnum; i++) {
    int L = query[i].L;
    int R = query[i].R;
    while (curR < R) {
      curR++;
      Add(curR);
    }
    while (curR > R) {
      Remove(curR);
      curR--;
    }
    while (curL < L) {
      Remove(curL);
      curL++;
    }
    while (curL > L) {
      curL--;
      Add(curL);
    }
    long long int num2 = prefixsum[R];
    long long int num1 = 0;
    if (L > 0) {
      num1 = prefixsum[L - 1];
    }
    long long int tsum = num2 - num1;
    tsum = tsum + 2 * maxksum;
    ans = max(ans, abs(tsum));
  }
}
int main() {
  int n, len;
  cin >> n >> len;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cin >> k;
  k = min(k, len);
  prefixsum[0] = a[0];
  for (int i = 1; i < n; i++) {
    prefixsum[i] = prefixsum[i - 1] + a[i];
  }
  int qnum = 0;
  for (int i = 0; i + len - 1 < n; i++) {
    query[qnum].L = i;
    query[qnum].R = i + len - 1;
    query[qnum].totalblock = n - len + 1;
    qnum++;
  }
  sort(query, query + qnum);
  if (k == 0) {
    for (int i = 0; i + len - 1 < n; i++) {
      long long int num2 = prefixsum[i + len - 1];
      long long int num1 = 0;
      if (i > 0) {
        num1 = prefixsum[i - 1];
      }
      long long int tsum = num2 - num1;
      ans = max(ans, abs(tsum));
    }
    cout << ans << endl;
  } else {
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < n; j++) {
        a[j] = (1 - 2 * i) * a[j];
        prefixsum[j] = (1 - 2 * i) * prefixsum[j];
      }
      Mo(qnum);
    }
    cout << ans << endl;
  }
  return 0;
}
