#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
template <class T>
inline int len(const T &a) {
  return a.size();
}
const double EPS = 1e-9;
const double PI = 3.14159265358979323846264338328;
const long long LINF = (long long)1e16 + 5;
template <class T>
inline int toInt(const T &t) {
  int n;
  stringstream ss;
  ss << t;
  ss >> n;
  return n;
}
template <class T>
inline string toStr(const T &t) {
  stringstream ss;
  ss << t;
  return ss.str();
}
template <class T>
inline long long toInt64(const T &t) {
  long long n;
  stringstream ss;
  ss << t;
  ss >> n;
  return n;
}
template <typename T>
int sgn(T val) {
  return (T(0) < val) - (val < T(0));
}
template <class T>
T gcd(T a, T b) {
  T r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T1, typename T2>
inline std::ostream &operator<<(std::ostream &os, const std::pair<T1, T2> &p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
inline std::ostream &operator<<(std::ostream &os, const std::vector<T> &v) {
  bool first = true;
  os << "[";
  for (unsigned int i = 0; i < v.size(); i++) {
    if (!first) os << ", ";
    os << v[i];
    first = false;
  }
  return os << "]";
}
template <typename T>
inline std::ostream &operator<<(std::ostream &os, const std::set<T> &S) {
  bool first = true;
  os << "set([";
  for (typename std::set<T>::const_iterator it = S.begin(); it != S.end();
       ++it) {
    if (!first) os << ", ";
    os << *it;
    first = false;
  }
  return os << "])";
}
template <typename T1, typename T2>
inline std::ostream &operator<<(std::ostream &os, const std::map<T1, T2> &d) {
  bool first = true;
  os << "{";
  for (typename std::map<T1, T2>::const_iterator it = d.begin(); it != d.end();
       ++it) {
    if (!first) os << ", ";
    os << it->first << ": " << it->second;
    first = false;
  }
  return os << "}";
}
struct debugger {
  template <typename T>
  debugger &operator,(const T v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
long long a[100005];
int N, L, K;
long long diff = 0;
set<pair<long long, int> > pq1, pq2;
void add(int idx) {
  if (a[idx] >= 0) return;
  pq1.insert(make_pair(-2 * a[idx], idx));
  diff += -2 * a[idx];
  if (len(pq1) > K) {
    pair<long long, int> p = *pq1.begin();
    pq2.insert(p);
    pq1.erase(pq1.begin());
    diff -= p.first;
  }
}
void del(int idx) {
  if (a[idx] >= 0) return;
  pair<long long, int> p = make_pair(-2 * a[idx], idx);
  if (pq1.count(p)) {
    diff -= -2 * a[idx];
    pq1.erase(p);
  } else
    pq2.erase(p);
  if (len(pq1) < K && (!pq2.empty())) {
    diff += pq2.rbegin()->first;
    pq1.insert(*pq2.rbegin());
    pq2.erase(--pq2.end());
  }
}
long long solve() {
  diff = 0;
  long long ret = 0, sum = 0;
  pq1.clear();
  pq2.clear();
  for (int i = 0; i < L; i++) {
    sum += a[i];
    add(i);
  }
  ret += sum + diff;
  for (int i = L; i < N; i++) {
    del(i - L);
    add(i);
    sum += a[i] - a[i - L];
    ret = max(ret, sum + diff);
  }
  return ret;
}
int main() {
  scanf("%d %d", &N, &L);
  for (int i = 0; i < N; i++) scanf("%lld", a + i);
  scanf("%d", &K);
  K = min(K, L);
  long long ret = solve();
  for (int i = 0; i < N; i++) a[i] *= -1;
  ret = max(ret, solve());
  printf(
      "%lld"
      "\n",
      ret);
  return 0;
}
