7
576460752303423487 2
82 9
101 104
10 21
31 10
0 1
10 30
 1
128817972817282999 327672410994637530
 66
7 0
5 7
1 3
3 2
3 5
0 6
1 2
0 7
4 5
4 7
5 1
2 0
4 0
0 5
3 6
7 3
6 0
5 2
6 6
1 7
5 6
2 2
3 4
2 1
5 3
4 6
6 2
3 3
100000000000 1000000000000000000
0 1
4 1
2 6
5 5
4 3
0 3
3 7
3 1
1 0
4 4
1000000000000000000 100000000000
7 6
4 2
7 5
1 6
6 1
2 7
7 7
6 7
2 4
0 2
2 5
7 2
0 0
5 0
5 4
7 4
6 4
0 4
1 1
6 5
1 4
2 3
1 5
7 1
6 3
3 0
 1
100000000000 100000000001
 1
23917 1000000000000000000

First
Second
Second
First
Second
Second
First
 First
 Second
Second
First
Second
First
Second
First
Second
Second
First
First
Second
Second
Second
First
First
Second
First
First
First
Second
First
Second
First
First
Second
First
First
First
Second
First
First
First
Second
Second
First
First
Second
First
First
Second
First
Second
First
First
First
First
Second
First
Second
First
First
Second
Second
Second
First
Second
Second
First
Second
First
Second
First
First
First
Second
 Second
 Second

#include <bits/stdc++.h>
using namespace std;
const int N = 100050;
long long sum[N << 2], orig[N];
int size[N << 2];
map<long long, int> compr;
inline int lc(int x) { return x * 2; }
inline int rc(int x) { return x * 2 + 1; }
inline void update(int x) {
  sum[x] = sum[lc(x)] + sum[rc(x)];
  size[x] = size[lc(x)] + size[rc(x)];
}
void increase(int t, int l, int r, int x, int de) {
  if (l == r)
    size[t] += de, sum[t] += de * orig[l];
  else {
    int m = (l + r) >> 1;
    if (x <= m)
      increase(lc(t), l, m, x, de);
    else
      increase(rc(t), m + 1, r, x, de);
    update(t);
  }
}
int select(int t, int l, int r, int k) {
  k = max(k, 1);
  if (l == r) return l;
  int sz = size[lc(t)], m = (l + r) >> 1;
  if (k <= sz)
    return select(lc(t), l, m, k);
  else
    return select(rc(t), m + 1, r, k - sz);
}
long long getsum(int t, int l, int r, int ql, int qr) {
  if (qr < ql) return 0;
  if (ql <= l && r <= qr) return sum[t];
  int m = (l + r) >> 1;
  long long res(0);
  if (ql <= m) res += getsum(lc(t), l, m, ql, qr);
  if (qr > m) res += getsum(rc(t), m + 1, r, ql, qr);
  return res;
}
long long getsize(int t, int l, int r, int ql, int qr) {
  if (qr < ql) return 0;
  if (ql <= l && r <= qr) return size[t];
  int m = (l + r) >> 1;
  long long res(0);
  if (ql <= m) res += getsize(lc(t), l, m, ql, qr);
  if (qr > m) res += getsize(rc(t), m + 1, r, ql, qr);
  return res;
}
long long dt[N];
int zeropos, maxsize;
long long getAns(int k) {
  if (!k) return abs(getsum(1, 1, maxsize, 1, maxsize));
  int t = select(1, 1, maxsize, k), t2 = select(1, 1, maxsize, size[1] - k);
  long long r1 = -getsum(1, 1, maxsize, 1, t) +
                 getsum(1, 1, maxsize, t + 1, maxsize),
            r2 = -getsum(1, 1, maxsize, 1, t2) +
                 getsum(1, 1, maxsize, t2 + 1, maxsize),
            r3 = -(~0ULL >> 2);
  long long te = getsize(1, 1, maxsize, 1, zeropos);
  if (te <= k || size[1] - te <= k)
    r3 = abs(-getsum(1, 1, maxsize, 1, zeropos) +
             getsum(1, 1, maxsize, zeropos + 1, maxsize));
  return max(max(abs(r1), abs(r2)), r3);
}
int main() {
  int n, len;
  cin >> n >> len;
  for (int i = 1; i <= n; ++i) {
    cin >> dt[i];
    compr[dt[i]] = 1;
  }
  for (__typeof(compr.begin()) it = compr.begin(); it != compr.end(); ++it) {
    ++maxsize;
    it->second = maxsize;
    orig[maxsize] = it->first;
  }
  int k;
  cin >> k;
  for (int i = n - len + 1; i <= n; ++i)
    increase(1, 1, maxsize, compr[dt[i]], +1);
  __typeof(compr.begin()) it = compr.lower_bound(0);
  if (it == compr.end())
    zeropos = maxsize;
  else if (it->first > 0)
    if (it == compr.begin())
      zeropos = 0;
    else
      zeropos = (--it)->second;
  else
    zeropos = it->second;
  long long res = getAns(k), cur;
  for (int i = n - len; i >= 1; --i) {
    increase(1, 1, maxsize, compr[dt[i]], +1);
    increase(1, 1, maxsize, compr[dt[i + len]], -1);
    res = max(res, cur = getAns(k));
  }
  cout << res << endl;
  return 0;
}
