#include <bits/stdc++.h>
using namespace std;
int N, len, K;
long long A[100005];
long long ans = -1e18;
long long sum1, sum2;
set<pair<long long, int>> mn;
set<pair<long long, int>, greater<pair<long long, int>>> mx;
void clean() {
  mn.clear();
  mx.clear();
  sum1 = sum2 = 0;
}
void balance() {
  while (!mn.empty() && !mx.empty() &&
         (*mn.begin()).first < (*mx.begin()).first) {
    sum1 += (*mx.begin()).first;
    sum2 -= (*mx.begin()).first;
    mn.emplace(*mx.begin());
    mx.erase(mx.begin());
  }
  while (mx.size() < K && !mn.empty() && (*mn.begin()).first < 0) {
    sum1 -= (*mn.begin()).first;
    sum2 += (*mn.begin()).first;
    mx.emplace(*mn.begin());
    mn.erase(mn.begin());
  }
  while (mx.size() > K || (!mx.empty() && (*mx.begin()).first >= 0)) {
    sum1 += (*mx.begin()).first;
    sum2 -= (*mx.begin()).first;
    mn.emplace(*mx.begin());
    mx.erase(mx.begin());
  }
}
void del(int pos) {
  auto it = mx.find({A[pos], pos});
  if (it != mx.end()) {
    mx.erase(it);
    sum2 -= A[pos];
  } else {
    sum1 -= A[pos];
    mn.erase({A[pos], pos});
  }
}
void print(int id) {
  cout << id << ":\n";
  for (pair<long long, int> now : mn)
    cout << now.first << " " << now.second << "\n";
  cout << sum1 << " <=\n";
  for (pair<long long, int> now : mx)
    cout << now.first << " " << now.second << "\n";
  cout << sum2 << " <=\n";
}
void solve() {
  clean();
  for (int i = 1; i <= N; i++) {
    if (i > len) del(i - len);
    if (A[i] > 0) {
      mn.emplace(A[i], i);
      sum1 += A[i];
    } else {
      mx.emplace(A[i], i);
      sum2 += A[i];
    }
    balance();
    if (i >= len) ans = max(ans, -sum2 + sum1);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> N >> len;
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
  }
  cin >> K;
  solve();
  for (int i = 1; i <= N; i++) {
    A[i] = -A[i];
  }
  solve();
  cout << ans << "\n";
  cin >> N;
}
