#include <bits/stdc++.h>
using namespace std;
long long bit[100001][2];
map<long long, long long> id;
map<long long, long long> revid;
void add(long long pos, long long val) {
  while (pos < 100001) {
    bit[pos][0] += 1;
    bit[pos][1] += val;
    pos += (pos & (-pos));
  }
}
long long get1(long long pos) {
  long long sum = 0;
  while (pos > 0) {
    sum += bit[pos][1];
    pos -= (pos & (-pos));
  }
  return sum;
}
long long get2(long long pos) {
  long long sum = 0;
  while (pos > 0) {
    sum += bit[pos][0];
    pos -= (pos & (-pos));
  }
  return sum;
}
void sub(long long pos, long long val) {
  while (pos < 100001) {
    bit[pos][0] -= 1;
    bit[pos][1] -= val;
    pos += (pos & (-pos));
  }
}
signed main() {
  long long n, len;
  cin >> n >> len;
  long long a[n];
  set<long long> s;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < 0) s.insert(abs(a[i]));
  }
  long long k;
  cin >> k;
  long long cnt = 0;
  for (auto it : s) {
    cnt++;
    id[it] = cnt;
    revid[cnt] = it;
  }
  long long sz = cnt;
  long long i = 0;
  long long ans = 0;
  long long sum = 0;
  cnt = 0;
  long long sumn = 0;
  for (; i < len; i++) {
    if (a[i] < 0) {
      sumn += abs(a[i]);
      cnt++;
      add(id[abs(a[i])], abs(a[i]));
    }
    sum += a[i];
  }
  long long find = cnt - k;
  long long pos = -1;
  long long l = 0, r = sz;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (get2(mid) < find) {
      l = mid + 1;
    } else {
      pos = mid;
      r = mid - 1;
    }
  }
  if (pos == -1)
    ans = max(ans, abs(sum + 2 * (sumn)));
  else if (get2(pos) > find) {
    long long find_sum = get1(pos);
    long long idf;
    l = 0, r = sz;
    while (l <= r) {
      long long mid = (l + r) / 2;
      if (get1(mid) < find_sum)
        l = mid + 1;
      else {
        idf = mid;
        r = mid - 1;
      }
    }
    long long num = revid[idf];
    long long extra = get2(idf) - find;
    ans = max(ans, abs(sum + 2 * (sumn - get1(idf) + (extra * num))));
  } else {
    ans = max(ans, abs(sum + 2 * (sumn - get1(pos))));
  }
  for (; i < n; i++) {
    sum -= a[i - len];
    if (a[i - len] < 0) {
      sumn -= abs(a[i - len]);
      sub(id[abs(a[i - len])], abs(a[i - len]));
      cnt--;
    }
    if (a[i] < 0) {
      sumn += abs(a[i]);
      cnt++;
      add(id[abs(a[i])], abs(a[i]));
    }
    sum += a[i];
    find = cnt - k;
    pos = -1;
    l = 0, r = sz;
    while (l <= r) {
      long long mid = (l + r) / 2;
      if (get2(mid) < find) {
        l = mid + 1;
      } else {
        pos = mid;
        r = mid - 1;
      }
    }
    if (pos == -1)
      ans = max(ans, abs(sum + 2 * (sumn)));
    else if (get2(pos) > find) {
      long long find_sum = get1(pos);
      long long idf;
      l = 0, r = sz;
      while (l <= r) {
        long long mid = (l + r) / 2;
        if (get1(mid) < find_sum)
          l = mid + 1;
        else {
          idf = mid;
          r = mid - 1;
        }
      }
      long long num = revid[idf];
      long long extra = get2(idf) - find;
      ans = max(ans, abs(sum + 2 * (sumn - get1(idf) + (extra * num))));
    } else {
      ans = max(ans, abs(sum + 2 * (sumn - get1(pos))));
    }
  }
  s.clear();
  id.clear();
  revid.clear();
  memset(bit, 0, sizeof(bit));
  for (long long i = 0; i < n; i++) {
    if (a[i] >= 0) s.insert(a[i]);
  }
  cnt = 0;
  for (auto it : s) {
    cnt++;
    id[it] = cnt;
    revid[cnt] = it;
  }
  sz = cnt;
  i = 0;
  sum = 0;
  cnt = 0;
  sumn = 0;
  for (; i < len; i++) {
    if (a[i] >= 0) {
      sumn += abs(a[i]);
      cnt++;
      add(id[a[i]], abs(a[i]));
    }
    sum += a[i];
  }
  find = cnt - k;
  pos = -1;
  l = 0, r = sz;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (get2(mid) < find) {
      l = mid + 1;
    } else {
      pos = mid;
      r = mid - 1;
    }
  }
  if (pos == -1) {
    ans = max(ans, abs(sum - 2 * (sumn)));
  } else if (get2(pos) > find) {
    long long find_sum = get1(pos);
    long long idf;
    l = 0, r = sz;
    while (l <= r) {
      long long mid = (l + r) / 2;
      if (get1(mid) < find_sum)
        l = mid + 1;
      else {
        idf = mid;
        r = mid - 1;
      }
    }
    long long num = revid[idf];
    long long extra = get2(idf) - find;
    ans = max(ans, abs(sum - 2 * (sumn - get1(idf) + (extra * num))));
  } else {
    ans = max(ans, abs(sum - 2 * (sumn - get1(pos))));
  }
  for (; i < n; i++) {
    sum -= a[i - len];
    if (a[i - len] >= 0) {
      sumn -= abs(a[i - len]);
      sub(id[a[i - len]], abs(a[i - len]));
      cnt--;
    }
    if (a[i] >= 0) {
      sumn += abs(a[i]);
      cnt++;
      add(id[a[i]], abs(a[i]));
    }
    sum += a[i];
    find = cnt - k;
    pos = -1;
    l = 0, r = sz;
    while (l <= r) {
      long long mid = (l + r) / 2;
      if (get2(mid) < find) {
        l = mid + 1;
      } else {
        pos = mid;
        r = mid - 1;
      }
    }
    if (pos == -1) {
      ans = max(ans, abs(sum - 2 * (sumn)));
    } else if (get2(pos) > find) {
      long long find_sum = get1(pos);
      long long idf;
      l = 0, r = sz;
      while (l <= r) {
        long long mid = (l + r) / 2;
        if (get1(mid) < find_sum)
          l = mid + 1;
        else {
          idf = mid;
          r = mid - 1;
        }
      }
      long long num = revid[idf];
      long long extra = get2(idf) - find;
      ans = max(ans, abs(sum - 2 * (sumn - get1(idf) + (extra * num))));
    } else {
      ans = max(ans, abs(sum - 2 * (sumn - get1(pos))));
    }
  }
  cout << ans << "\n";
}
