#include <bits/stdc++.h>
using namespace std;
const int mxN = 1e5 + 5;
long long a[mxN];
class cf182c {
 public:
  long long sum1 = 0, sum2 = 0, n, len, k;
  multiset<long long> s, t;
  void solve(std::istream &in, std::ostream &out) {
    in >> n >> len;
    for (int i = 1; i <= n; i++) in >> a[i];
    in >> k;
    long long ans = answer();
    for (long long i = 1; i <= n; i++) a[i] *= -1;
    ans = max(ans, answer());
    out << ans;
  }
  long long answer() {
    sum1 = sum2 = 0;
    s.clear();
    t.clear();
    long long ans = 0;
    for (int i = 1; i <= len; i++) {
      insert(a[i]);
    }
    for (int i = 1; i <= n - len + 1; i++) {
      ans = max(ans, query());
      deletion(a[i]);
      if (i + len <= n) insert(a[i + len]);
    }
    return ans;
  }
  void insert(long long ele) {
    sum1 += ele;
    if (ele >= 0) return;
    if (check(ele)) {
      s.insert(ele);
      sum2 += ele;
      if (s.size() > k) {
        auto p = s.end();
        p--;
        t.insert(*p);
        sum2 -= *p;
        s.erase(p);
      }
    } else {
      t.insert(ele);
    }
  }
  bool check(long long ele) {
    if (s.size() < k) return true;
    if (k == 0) return false;
    auto p = s.end();
    p--;
    return ele < *p;
  }
  long long query() { return abs(sum1 - 2 * sum2); }
  void deletion(long long ele) {
    sum1 -= ele;
    if (ele >= 0) return;
    if (t.find(ele) != t.end()) {
      t.erase(t.find(ele));
      return;
    }
    s.erase(s.find(ele));
    sum2 -= ele;
    while (s.size() < k && !t.empty()) {
      auto p = t.begin();
      s.insert(*p);
      sum2 += *p;
      t.erase(p);
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cf182c solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}
