#include <bits/stdc++.h>
using namespace std;
const int MAXN = 222222;
long long dp[MAXN][2];
int a[MAXN], p[MAXN];
long long sum[MAXN], mm[MAXN];
int main() {
  int n, k;
  while (scanf("%d %d", &n, &k) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    sum[0] = 0;
    mm[0] = 0;
    for (int i = 1; i <= n; i++) {
      sum[i] = sum[i - 1] + a[i];
      if (sum[i] - sum[i - k] > mm[i - 1]) {
        mm[i] = sum[i] - sum[i - k];
        p[i] = i;
      } else {
        mm[i] = mm[i - 1];
        p[i] = p[i - 1];
      }
    }
    int m1 = -0x3F3F3F3F, p1 = -1, m2 = -0x3F3F3F3F, p2 = -1;
    long long ans = -1000;
    int pp1 = 0, pp2 = 0;
    for (int i = k; i <= n; i++) {
      long long v = sum[i] - sum[i - k] + mm[i - k];
      if (v > ans) {
        ans = v;
        pp1 = p[i - k];
        pp2 = i;
      }
    }
    printf("%d %d\n", pp1 - k + 1, pp2 - k + 1);
  }
}
