#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 100;
int n, k, ans1, ans2;
int a[maxn], d[maxn];
long long sum[maxn], summax;
int main() {
  while (~scanf("%d%d", &n, &k)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    memset(sum, 0, sizeof(sum));
    for (int i = n; i > n - k; i--) sum[n - k + 1] += a[i];
    d[n - k + 1] = n - k + 1;
    for (int i = n - k; i > 0; i--) {
      sum[i] = sum[i + 1] + a[i] - a[i + k];
      if (sum[i] >= sum[d[i + 1]])
        d[i] = i;
      else
        d[i] = d[i + 1];
    }
    summax = 0;
    ans1 = 0;
    ans2 = 0;
    for (int i = 1; i <= n - 2 * k + 1; i++)
      if (sum[i] + sum[d[i + k]] > summax) {
        summax = sum[i] + sum[d[i + k]];
        ans1 = i;
        ans2 = d[i + k];
      }
    printf("%d %d\n", ans1, ans2);
  }
  return 0;
}
