#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[200007];
long long tot[200007];
long long maxSum[200007 + 1];
int maxSumPos[200007 + 1];
void solution() {
  scanf("%d %d", &n, &k);
  for (int i = 0, _n = (n); i < _n; ++i) scanf("%d", a + i);
  for (int i = 0, _n = (k); i < _n; ++i) tot[0] += a[i];
  for (int i = 1; i + k - 1 < n; i++) {
    tot[i] = tot[i - 1];
    tot[i] += a[i + k - 1];
    tot[i] -= a[i - 1];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (tot[i] >= maxSum[i + 1]) {
      maxSum[i] = tot[i];
      maxSumPos[i] = i;
    } else {
      maxSum[i] = maxSum[i + 1];
      maxSumPos[i] = maxSumPos[i + 1];
    }
  }
  int a, b;
  long long maxTot = 0;
  for (int i = 0; i + 2 * k - 1 < n; i++)
    if (tot[i] + maxSum[i + k] > maxTot) {
      a = i;
      b = maxSumPos[i + k];
      maxTot = tot[i] + maxSum[i + k];
    }
  printf("%d %d\n", a + 1, b + 1);
}
int main() {
  solution();
  return 0;
}
