#include <bits/stdc++.h>
using namespace std;
const int N = 400100;
struct arr {
  long long F, S, T;
} a[N];
int l[N], h[N], leaf[N], bit[N], n, k, len;
long long sum[N], ans;
void build(int r, int low, int high) {
  l[r] = low;
  h[r] = high;
  if (low == high) {
    leaf[low] = r;
    return;
  }
  int mid = (low + high) / 2;
  build(r * 2, low, mid);
  build(r * 2 + 1, mid + 1, high);
}
void update(int i, long long v) {
  int j = leaf[i];
  while (j > 0) {
    bit[j]++;
    sum[j] += v;
    j /= 2;
  }
}
void delete_(int i) {
  int j = leaf[i];
  long long v = sum[j];
  while (j > 0) {
    bit[j]--;
    sum[j] -= v;
    j /= 2;
  }
}
int NodeAt(int r, int k) {
  if (l[r] == h[r] && bit[r] == k) return l[r];
  if (bit[r] >= k)
    return NodeAt(r * 2, k);
  else
    return NodeAt(r + 1, k - bit[r]);
}
long long GetSum(int r, int low, int high) {
  if (l[r] > high || h[r] < low) return 0;
  if (l[r] >= low && h[r] <= high) return sum[r];
  return (GetSum(r * 2, low, high) + GetSum(r * 2 + 1, low, high));
}
bool ss(arr i, arr j) { return i.S < j.S; }
bool sss(arr i, arr j) { return i.F < j.F; }
void process() {
  sort(a + 1, a + n + 1, sss);
  for (int i = 1; i <= n; i++) a[i].T = a[i - 1].T + 1;
  int pivot;
  for (int i = 1; i <= n; i++)
    if (a[i].F > 0) {
      pivot = a[i].T;
      break;
    }
  sort(a + 1, a + n + 1, ss);
  memset(sum, 0, sizeof(sum));
  memset(bit, 0, sizeof(bit));
  for (int i = 1; i < len; i++) update(a[i].T, a[i].F);
  int last = 0;
  long long SUM;
  int ii;
  for (int i = len; i <= n; i++) {
    update(a[i].T, a[i].F);
    delete_(a[last].T);
    SUM = GetSum(1, 1, n);
    if (k == 0)
      ii = 0;
    else
      ii = NodeAt(1, k);
    ii = min(ii, pivot - 1);
    ans = max(ans, abs(SUM - 2 * GetSum(1, 1, ii)));
    last++;
  }
}
int main() {
  scanf("%d%d", &n, &len);
  int u;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &u);
    a[i].S = i;
    a[i].F = u;
  }
  scanf("%d", &k);
  k = min(k, len);
  build(1, 1, n);
  process();
  for (int i = 1; i <= n; i++) a[i].F = -a[i].F;
  process();
  cout << ans;
}
