#include <bits/stdc++.h>
using namespace std;
long long n, k, len, sumneg, sumpos, sum, ans, pos, neg, a[100005];
map<long long, long long> mp, mpneg, mppos;
void erase(long long x, map<long long, long long>& m) {
  m[x]--;
  if (m[x] == 0) m.erase(x);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> len;
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> k;
  int i;
  for (i = 0; i < len; i++) {
    if (a[i] >= 0) {
      if (pos < k)
        mppos[a[i]]++, pos++, sumpos += a[i];
      else if (pos == k && k) {
        long long lo = (mppos.begin()->first);
        if (a[i] > lo) {
          erase(lo, mppos), sumpos -= lo, mp[lo]++, sum += lo, mppos[a[i]]++,
              sumpos += a[i];
        } else
          mp[a[i]]++, sum += a[i];
      } else
        mp[a[i]]++, sum += a[i];
    } else {
      if (neg < k)
        mpneg[a[i]]++, sumneg += a[i], neg++;
      else if (neg == k && k) {
        long long hi = (mpneg.rbegin()->first);
        if (a[i] < hi) {
          erase(hi, mpneg), sumneg -= hi, mp[hi]++, sum += hi;
          mpneg[a[i]]++, sumneg += a[i];
        } else
          mp[a[i]]++, sum += a[i];
      } else
        mp[a[i]]++, sum += a[i];
    }
  }
  long long ans1 = abs(sum + sumneg + sumpos);
  long long ans2 = abs(sum - sumneg + sumpos);
  long long ans3 = abs(sum + sumneg - sumpos);
  ans = max(max(ans, ans1), max(ans2, ans3));
  for (i = len; i < n; i++) {
    long long out = a[i - len], in = a[i];
    if (out >= 0) {
      if (mp.count(out))
        erase(out, mp), sum -= out;
      else {
        erase(out, mppos), sumpos -= out, pos--;
        if (!mp.empty()) {
          long long hi = mp.rbegin()->first;
          if (hi > -1) {
            mppos[hi]++, sumpos += hi, pos++;
            erase(hi, mp), sum -= hi;
          }
        }
      }
    } else {
      if (mp.count(out))
        erase(out, mp), sum -= out;
      else {
        erase(out, mpneg), sumneg -= out, neg--;
        if (!mp.empty()) {
          long long lo = mp.begin()->first;
          if (lo < 0) {
            mpneg[lo]++, sumneg += lo, neg++;
            erase(lo, mp), sum -= lo;
          }
        }
      }
    }
    if (in >= 0) {
      if (pos < k)
        mppos[in]++, sumpos += in, pos++;
      else if (pos == k && k) {
        long long lo = (mppos.begin()->first);
        if (in > lo) {
          erase(lo, mppos), sumpos -= lo, mp[lo]++, sum += lo, mppos[in]++,
              sumpos += in;
        } else
          mp[in]++, sum += in;
      } else
        mp[in]++, sum += in;
    } else {
      if (neg < k)
        mpneg[in]++, sumneg += in, neg++;
      else if (neg == k && k) {
        int hi = (mpneg.rbegin()->first);
        if (in < hi) {
          erase(hi, mpneg), sumneg -= hi, mp[hi]++, sum += hi, mpneg[in]++,
              sumneg += in;
        } else
          mp[in]++, sum += in;
      } else
        mp[in]++, sum += in;
    }
    long long ans1 = abs(sum + sumneg + sumpos);
    long long ans2 = abs(sum - sumneg + sumpos);
    long long ans3 = abs(sum + sumneg - sumpos);
    ans = max(max(ans, ans1), max(ans2, ans3));
  }
  cout << ans << endl;
  return 0;
}
