#include <bits/stdc++.h>
using namespace std;
int a[100005], n, m, kk;
long long now, ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= (n); i++) scanf("%d", &a[i]);
  scanf("%d", &kk);
  for (int sgn = (0); sgn <= (1); sgn++) {
    for (int i = (1); i <= (n); i++) a[i] = -a[i];
    now = 0;
    multiset<int> b, c;
    for (int i = (1); i <= (n); i++) {
      if (a[i] >= 0)
        now += a[i];
      else if (((int)((b).size())) < kk) {
        b.insert(a[i]);
        now -= a[i];
      } else if (kk && a[i] < *(--b.end())) {
        c.insert(*(--b.end()));
        now += (*(--b.end())) * 2;
        b.erase(--b.end());
        b.insert(a[i]);
        now -= a[i];
      } else {
        c.insert(a[i]);
        now += a[i];
      }
      int j = i - m;
      if (j > 0)
        if (a[j] >= 0)
          now -= a[j];
        else if (b.find(a[j]) != b.end()) {
          b.erase(b.find(a[j]));
          now += a[j];
          if (!c.empty()) {
            int v = *c.begin();
            c.erase(c.begin());
            b.insert(v);
            now -= 2 * v;
          }
        } else {
          c.erase(c.find(a[j]));
          now -= a[j];
        }
      if (j >= 0 && now > ans) ans = now;
    }
  }
  cout << ans << endl;
  return 0;
}
