#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const double EPS = 1e-9;
int mods(int a, int b) { return (b + (a % b)) % b; }
int n, len, k, j, mnIdx;
pair<long long, int> tmp;
bool included[100005];
long long mn, ans, cur, arr, a[100005];
multiset<pair<long long, int>> partitions, changed;
void relax() {
  while (k && partitions.begin()->first < 0) {
    auto it = partitions.begin();
    tmp = *it;
    cur -= tmp.first;
    partitions.erase(it);
    changed.insert(tmp);
    tmp.first = -tmp.first;
    cur += tmp.first;
    included[tmp.second] = 1;
    partitions.insert(tmp);
    k--;
  }
}
void process() {
  j = cur = 0;
  for (int i = 0; i < len; i++) {
    partitions.insert(make_pair(a[i], i));
    cur += a[i];
  }
  relax();
  ans = max(ans, abs(cur));
  for (int i = len; i < n; i++) {
    arr = a[j];
    if (included[j]) {
      included[j] = 0;
      k++;
      changed.erase(make_pair(arr, j));
      arr = -arr;
    }
    cur -= arr;
    partitions.erase(make_pair(arr, j));
    j++;
    partitions.insert(make_pair(a[i], i));
    cur += a[i];
    if (!changed.empty() && a[i] < changed.rbegin()->first) {
      auto it = changed.rbegin();
      cur += 2 * it->first;
      included[it->second] = 0;
      k++;
      partitions.erase(make_pair(-it->first, it->second));
      partitions.insert(*it);
      changed.erase(*it);
    }
    relax();
    ans = max(ans, abs(cur));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> len;
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> k;
  int remember = k;
  process();
  for (int i = 0; i < n; i++) a[i] = -a[i];
  partitions.clear();
  changed.clear();
  memset(included, 0, sizeof(included));
  k = remember;
  process();
  cout << ans << '\n';
  return 0;
}
