#include <bits/stdc++.h>
using namespace std;
int nextInt() {
  int x;
  scanf("%d", &x);
  return x;
}
long long nextLong() {
  long long x;
  scanf("%I64d", &x);
  return x;
}
double nextDouble() {
  double x;
  scanf("%lf", &x);
  return x;
}
const int BUFSIZE = 1000000;
char buf[BUFSIZE + 1];
string nextString() {
  scanf("%s", buf);
  return buf;
}
string nextLine() {
  gets(buf);
  return buf;
}
int stringToInt(string s) {
  stringstream in(s);
  int x;
  in >> x;
  return x;
}
struct Point {
  double x, y;
  Point() : x(0), y(0) {}
  Point(double x, double y) : x(x), y(y) {}
  Point operator-(Point op) const { return Point(x - op.x, y - op.y); }
  Point operator+(Point op) const { return Point(x + op.x, y + op.y); }
  Point operator*(double op) const { return Point(x * op, y * op); }
  double operator*(Point op) const { return x * op.x + y * op.y; }
  double operator%(Point op) const { return x * op.y - y * op.x; }
  double length2() { return x * x + y * y; }
  double length() { return sqrt(length2()); }
};
Point nextPoint() {
  double x = nextDouble();
  double y = nextDouble();
  return Point(x, y);
}
void add(multiset<long long> &neg, multiset<long long> &negK, long long &sumNeg,
         long long x, int k) {
  negK.insert(x);
  sumNeg += x;
  if (negK.size() > k) {
    sumNeg -= *negK.begin();
    neg.insert(*negK.begin());
    negK.erase(negK.begin());
  }
}
void remove(multiset<long long> &neg, multiset<long long> &negK,
            long long &sumNeg, long long x, int k) {
  if (neg.find(x) != neg.end()) {
    neg.erase(neg.find(x));
  } else {
    multiset<long long>::iterator it = negK.find(x);
    sumNeg -= x;
    negK.erase(it);
    if (negK.size() < k && !neg.empty()) {
      sumNeg += *neg.rbegin();
      negK.insert(*neg.rbegin());
      neg.erase(--neg.end());
    }
  }
}
long long solve(vector<long long> &a, int len, int k) {
  multiset<long long> neg;
  multiset<long long> negK;
  long long sumNeg = 0;
  long long sum = 0;
  for (int i = 0; i < len; ++i) {
    if (a[i] < 0) {
      add(neg, negK, sumNeg, -a[i], k);
    }
    sum += a[i];
  }
  long long res = sum + 2 * sumNeg;
  for (int i = len; i < a.size(); ++i) {
    if (a[i] < 0) {
      add(neg, negK, sumNeg, -a[i], k);
    }
    sum += a[i];
    int j = i - len;
    if (a[j] < 0) {
      remove(neg, negK, sumNeg, -a[j], k);
    }
    sum -= a[j];
    res = max(res, sum + 2 * sumNeg);
  }
  return res;
}
int main() {
  int n = nextInt();
  int len = nextInt();
  vector<long long> a(n);
  for (int i = 0; i < a.size(); ++i) {
    a[i] = nextInt();
  }
  int k = nextInt();
  long long r1 = solve(a, len, k);
  for (int i = 0; i < a.size(); ++i) {
    a[i] *= -1;
  }
  long long r2 = solve(a, len, k);
  cout << max(r1, r2) << endl;
  return 0;
}
