#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
int n, l, k;
struct classcomp {
  bool operator()(const ll& lhs, const ll& rhs) const { return lhs > rhs; }
};
ll sol(vector<ll>& P, vector<ll>& N) {
  ll cp = 0;
  for (int i = 0; i < l; ++i) {
    cp += P[i] - N[i];
  }
  multiset<ll, classcomp> S(N.begin(), N.begin() + l);
  multiset<ll> Sk;
  multiset<ll, classcomp> Sx;
  int c = 0;
  ll cn = 0;
  for (ll s : S) {
    if (c < k) {
      Sk.insert(s);
      cn += s;
    } else
      Sx.insert(s);
    c++;
  }
  ll result = cp + 2 * cn;
  for (int i = l; i < n; ++i) {
    cp = cp - P[i - l] + P[i] + N[i - l] - N[i];
    if (Sk.find(N[i - l]) == Sk.end()) {
      Sx.erase(Sx.find(N[i - l]));
      if (!Sk.empty()) {
        Sx.insert(*Sk.begin());
        cn -= *Sk.begin();
        Sk.erase(Sk.begin());
      }
    } else {
      Sk.erase(Sk.find(N[i - l]));
      cn -= N[i - l];
    }
    Sx.insert(N[i]);
    if (Sk.size() < k) {
      Sk.insert(*Sx.begin());
      cn += *Sx.begin();
      Sx.erase(Sx.begin());
    }
    result = max(result, cp + 2 * cn);
  }
  return result;
}
int main() {
  ios::sync_with_stdio(false);
  cout.precision(20);
  cin >> n >> l;
  vector<ll> P(n, 0);
  vector<ll> N(n, 0);
  for (int i = 0; i < n; ++i) {
    ll a;
    cin >> a;
    P[i] = max(ll(0), a);
    N[i] = max(ll(0), -a);
  }
  cin >> k;
  k = min(k, l);
  cout << max(sol(P, N), sol(N, P)) << endl;
  return 0;
}
