#include <bits/stdc++.h>
using namespace std;
const int MAX = 100005;
int64_t a[MAX];
int n, len, k;
multiset<int64_t> rest;
multiset<int64_t> topk;
queue<int64_t> pos;
int64_t sum_topk, sum_rest, sum_pos;
void print() {
  cout << "print:" << endl;
  for (set<int64_t>::iterator it = topk.begin(); it != topk.end(); ++it) {
    cout << *it << " ";
  }
  cout << endl;
  for (set<int64_t>::iterator it = rest.begin(); it != rest.end(); ++it) {
    cout << *it << " ";
  }
  cout << endl;
  cout << "sums:" << sum_pos << " " << sum_topk << " " << sum_rest << endl;
}
void insert(int64_t val) {
  if (val >= 0) {
    pos.push(val);
    sum_pos += val;
  } else {
    int64_t elem = -val;
    topk.insert(elem);
    sum_topk += elem;
    if (topk.size() > k) {
      multiset<int64_t>::iterator kth = topk.begin();
      sum_rest += *kth;
      rest.insert(*kth);
      sum_topk -= *kth;
      topk.erase(kth);
    }
  }
}
void erase(int64_t val) {
  if (val >= 0) {
    sum_pos -= val;
    pos.pop();
  } else {
    int64_t elem = -val;
    multiset<int64_t>::iterator it = rest.find(elem);
    if (it != rest.end()) {
      sum_rest -= elem;
      rest.erase(it);
    } else {
      topk.erase(topk.find(elem));
      sum_topk -= elem;
      if (!rest.empty()) {
        int64_t to_move = *rest.rbegin();
        sum_topk += to_move;
        sum_rest -= to_move;
        topk.insert(to_move);
        rest.erase(rest.find(to_move));
      }
    }
  }
}
int64_t optim() {
  sum_pos = 0;
  sum_rest = 0;
  sum_topk = 0;
  queue<int64_t> empty;
  pos = empty;
  rest.clear();
  topk.clear();
  int i = 0;
  for (; i < len; i++) {
    insert(a[i]);
  }
  int64_t maximum = sum_pos + sum_topk - sum_rest;
  for (; i < n; i++) {
    insert(a[i]);
    erase(a[i - len]);
    maximum = max(maximum, sum_pos + sum_topk - sum_rest);
  }
  return maximum;
}
int main(int argv, char** argc) {
  cin >> n >> len;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cin >> k;
  int64_t max1 = optim();
  for (int i = 0; i < n; i++) {
    a[i] = -a[i];
  }
  int64_t max2 = optim();
  cout << max(max1, max2) << endl;
  return 0;
}
