#include <bits/stdc++.h>
using namespace std;
multiset<int> s;
map<pair<int, int>, long long> mp;
int n, len, k;
int block = 0;
int arr[100005];
struct Query {
  int L, R;
  Query(int L, int R) { this->L = L, this->R = R; }
};
bool MO_CMP(Query &a, Query &b) {
  if (a.L / block != b.L / block) {
    return a.L / block < b.L / block;
  } else {
    return a.R < b.R;
  }
}
multiset<int> curr, out;
long long sum = 0;
long long tmp = 0;
void remove(int ind) {
  if (arr[ind] >= 0) {
    tmp -= arr[ind];
    return;
  }
  long long x = -arr[ind];
  if (curr.find(x) == curr.end()) {
    out.erase(out.find(x));
    tmp += x;
  } else {
    curr.erase(curr.find(x));
    tmp -= x;
    if (((int)((out).size())) > 0) {
      curr.insert(*out.rbegin());
      tmp += *out.rbegin() * 2;
      out.erase(out.find(*out.rbegin()));
    }
  }
}
void add(int ind) {
  if (arr[ind] >= 0) {
    tmp += arr[ind];
    return;
  }
  long long x = -arr[ind];
  if (((int)((curr).size())) < k) {
    curr.insert(x);
    tmp += x;
  } else {
    if (x > *curr.begin() && k) {
      tmp -= *curr.begin() * 2;
      tmp += x;
      out.insert(*curr.begin());
      curr.erase(curr.begin());
      curr.insert(x);
    } else {
      out.insert(x);
      tmp -= x;
    }
  }
}
long long pref[100005];
long long getBest() {
  sum = 0;
  curr.clear(), out.clear();
  mp.clear();
  vector<Query> queries;
  for (int i = 0; i + len - 1 < n; ++i) {
    queries.push_back(Query(i, i + len - 1));
  }
  int currentL = 0;
  int currentR = -1, L, R;
  sort((queries).begin(), (queries).end(), MO_CMP);
  tmp = 0;
  for (int i = 0; i < ((int)((queries).size())); i++) {
    L = queries[i].L;
    R = queries[i].R;
    while (currentR < R) {
      currentR++;
      add(currentR);
    }
    while (currentR > R) {
      remove(currentR);
      currentR--;
    }
    while (currentL < L) {
      remove(currentL);
      currentL++;
    }
    while (currentL > L) {
      currentL--;
      add(currentL);
    }
    mp[pair<int, int>(L, R)] = abs(tmp);
  }
  long long ans = -(1LL << 52);
  for (int i = 0; i + len - 1 < n; ++i) {
    long long bef = 0;
    if (i > 0) bef = pref[i - 1];
    ans = max(ans, mp[pair<int, int>(i, i + len - 1)]);
  }
  return ans;
}
int main() {
  scanf("%d %d", &n, &len);
  block = sqrt(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &arr[i]);
    pref[i] = arr[i];
    if (i > 0) pref[i] += 1LL * pref[i - 1];
  }
  scanf("%d", &k);
  long long ans = getBest();
  for (int i = 0; i < n; ++i) {
    arr[i] = -arr[i];
    pref[i] = arr[i];
    if (i > 0) pref[i] += 1LL * pref[i - 1];
  }
  cout << max(ans, getBest()) << "\n";
}
