#include <bits/stdc++.h>
int data[200005], aidx[200005];
int64_t asum[200005];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int _k = (0), _n = (n - 1), i = _k; i <= _n; ++i) {
    scanf("%d", &data[i]);
  }
  int first = 0, last = k - 1, ma = 0;
  int64_t sum = 0, msum = 0;
  for (int _k = (first), _n = (last), i = _k; i <= _n; ++i) sum += data[i];
  ma = first;
  msum = sum;
  aidx[last] = ma;
  asum[last] = msum;
  ++last;
  while (last < n) {
    sum = sum + data[last] - data[first];
    if (sum > msum) {
      ma = first + 1;
      msum = sum;
    }
    aidx[last] = ma;
    asum[last] = msum;
    ++first;
    ++last;
  }
  first = k;
  last = 2 * k - 1;
  sum = 0;
  for (int _k = (first), _n = (last), i = _k; i <= _n; ++i) sum += data[i];
  int mb = first;
  ma = aidx[first - 1];
  int64_t mcsum = sum + asum[first - 1];
  ++last;
  while (last < n) {
    sum = sum + data[last] - data[first];
    if (sum + asum[first] > mcsum) {
      ma = aidx[first];
      mcsum = sum + asum[first];
      mb = first + 1;
    }
    ++first;
    ++last;
  }
  printf("%d %d", ma + 1, mb + 1);
  return 0;
}
