#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int INF = 1e9 + 7;
const int N = 1000010;
const double pi = 3.1415926;
int n, k;
int a[200010], idx1[200010], idx2[200010];
long long sum[200010], m1[200010], m2[200010];
int main() {
  while (~scanf("%d%d", &n, &k)) {
    sum[0] = 0;
    memset(m1, 0, sizeof(m1));
    ;
    memset(m2, 0, sizeof(m2));
    ;
    int l, r;
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      ;
      sum[i] = sum[i - 1] + a[i];
    }
    for (int i = 1; i <= n - 2 * k + 1; i++) {
      if (sum[i + k - 1] - sum[i - 1] > m1[i + k - 2]) {
        m1[i + k - 1] = sum[i + k - 1] - sum[i - 1];
        idx1[i + k - 1] = i;
      } else {
        m1[i + k - 1] = m1[i + k - 2];
        idx1[i + k - 1] = idx1[i + k - 2];
      }
    }
    for (int i = n - k + 1; i >= k + 1; i--) {
      if (sum[i + k - 1] - sum[i - 1] >= m2[i + 1]) {
        m2[i] = sum[i + k - 1] - sum[i - 1];
        idx2[i] = i;
      } else {
        m2[i] = m2[i + 1];
        idx2[i] = idx2[i + 1];
      }
    }
    for (int i = k; i <= n - k; i++) {
      if (m1[i] + m2[i + 1] > ans) {
        ans = m1[i] + m2[i + 1];
        l = idx1[i];
        r = idx2[i + 1];
      }
    }
    printf("%d %d\n", l, r);
  }
  return 0;
}
