#include <bits/stdc++.h>
using namespace std;
long long n, len, k;
struct tree_o {
  long long sum;
  set<long long, greater<long long> > unique_val;
  map<long long, long long> mask;
  vector<long long> curr_val;
  vector<long long> ind_to_val;
  vector<pair<long long, long long> > tre;
  void init() {
    int i = 0;
    ind_to_val.resize(n, 0);
    for (set<long long>::iterator j = unique_val.begin(); j != unique_val.end();
         j++, i++) {
      mask[*j] = i;
      ind_to_val[i] = *j;
    }
    curr_val.resize(n, 0);
    tre.resize(n * 5, make_pair(0, 0));
  };
  void build(int tr, int v = 1, int tl = 0) {
    if (tl == tr) {
      tre[v] = make_pair(curr_val[tl], ind_to_val[tl] * curr_val[tl]);
      this->sum += ind_to_val[tl] * curr_val[tl];
    } else {
      long long med = (tl + tr) / 2;
      build(med, 2 * v, tl);
      build(tr, 2 * v + 1, med + 1);
      tre[v] = make_pair(tre[2 * v].first + tre[2 * v + 1].first,
                         tre[2 * v].second + tre[2 * v + 1].second);
    }
  };
  void update(int tr, int ind, int val, int v = 1, int tl = 0) {
    if (tl == tr) {
      curr_val[ind] += val;
      tre[v] = make_pair(curr_val[ind], ind_to_val[ind] * curr_val[ind]);
      sum += val * ind_to_val[ind];
    } else {
      int med = (tr + tl) / 2;
      if (ind <= med) {
        tre[v].first -= tre[2 * v].first;
        tre[v].second -= tre[2 * v].second;
        update(med, ind, val, 2 * v, tl);
        tre[v].first += tre[2 * v].first;
        tre[v].second += tre[2 * v].second;
      } else {
        tre[v].first -= tre[2 * v + 1].first;
        tre[v].second -= tre[2 * v + 1].second;
        update(tr, ind, val, 2 * v + 1, med + 1);
        tre[v].first += tre[2 * v + 1].first;
        tre[v].second += tre[2 * v + 1].second;
      }
    }
  };
  pair<long long, long long> max_sum(int tr, int count_z, int v = 1,
                                     int tl = 0) {
    if (count_z == 0)
      return make_pair(0, 0);
    else if (tl == tr && tre[v].first > count_z) {
      return make_pair(count_z, ind_to_val[tl] * count_z);
    } else if (tre[v].first <= count_z) {
      return tre[v];
    } else {
      long long med = (tr + tl) / 2;
      pair<long long, long long> l_v = max_sum(med, count_z, 2 * v, tl),
                                 r_v = make_pair(0, 0);
      if (l_v.first < count_z) {
        r_v = max_sum(tr, count_z - l_v.first, 2 * v + 1, med + 1);
      }
      return make_pair(l_v.first + r_v.first, l_v.second + r_v.second);
    }
  };
};
int main() {
  vector<long long> a;
  tree_o neg, pos;
  cin >> n >> len;
  a.resize(n);
  neg.sum = 0;
  pos.sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < 0) {
      neg.unique_val.insert(-a[i]);
    } else {
      pos.unique_val.insert(a[i]);
    }
  }
  cin >> k;
  neg.init();
  pos.init();
  for (int i = 0; i < len; i++) {
    if (a[i] < 0) {
      neg.curr_val[neg.mask[-a[i]]]++;
    } else {
      pos.curr_val[pos.mask[a[i]]]++;
    }
  }
  neg.build(n - 1);
  pos.build(n - 1);
  pair<long long, long long> len_pos = pos.max_sum(n - 1, k),
                             len_neg = neg.max_sum(n - 1, k),
                             n_pos = pos.max_sum(n - 1, n),
                             n_neg = neg.max_sum(n - 1, n);
  long long ans =
      max((n_neg.second + len_pos.second - (pos.sum - len_pos.second) < 0
               ? -n_neg.second + len_pos.second - (pos.sum - len_pos.second)
               : n_neg.second + len_pos.second - (pos.sum - len_pos.second)),
          (n_pos.second + len_neg.second - (neg.sum - len_neg.second) < 0
               ? -n_pos.second + len_neg.second - (neg.sum - len_neg.second)
               : n_pos.second + len_neg.second - (neg.sum - len_neg.second)));
  for (int i = 1; i + (len - 1) < n; i++) {
    if (a[i - 1] < 0) {
      neg.update(n - 1, neg.mask[-a[i - 1]], -1);
    } else {
      pos.update(n - 1, pos.mask[a[i - 1]], -1);
    }
    if (a[i + len - 1] < 0) {
      neg.update(n - 1, neg.mask[-a[i + len - 1]], 1);
    } else {
      pos.update(n - 1, pos.mask[a[i + len - 1]], 1);
    }
    len_pos = pos.max_sum(n - 1, k), len_neg = neg.max_sum(n - 1, k),
    n_pos = pos.max_sum(n - 1, n), n_neg = neg.max_sum(n - 1, n);
    ans = max(
        ans,
        max((n_neg.second + len_pos.second - (pos.sum - len_pos.second) < 0
                 ? -n_neg.second + len_pos.second - (pos.sum - len_pos.second)
                 : n_neg.second + len_pos.second - (pos.sum - len_pos.second)),
            (n_pos.second + len_neg.second - (neg.sum - len_neg.second) < 0
                 ? -n_pos.second + len_neg.second - (neg.sum - len_neg.second)
                 : n_pos.second + len_neg.second -
                       (neg.sum - len_neg.second))));
  }
  cout << ans;
  return 0;
}
