#include <bits/stdc++.h>
using namespace std;
int n, k, a[200005];
long long s[200005];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < k; ++i) s[k - 1] += a[i];
  for (int i = k; i < n; ++i) s[i] = s[i - 1] + a[i] - a[i - k];
  long long now = -1, ans = -1;
  int maxa, maxb, z;
  for (int i = 2 * k - 1; i < n; ++i) {
    if (s[i - k] > now) {
      now = s[i - k];
      z = i - k;
    }
    if (ans < s[i] + now) {
      ans = s[i] + now;
      maxa = z;
      maxb = i;
    }
  }
  printf("%d %d\n", maxa - k + 2, maxb - k + 2);
  return 0;
}
