#include <bits/stdc++.h>
using namespace std;
int n, m;
long long a[2 * 200010], sum[2 * 200010], ans = 0;
int dp1[2 * 200010], dp2[2 * 200010], x, y;
char s[2200];
void init() {
  memset(sum, 0, sizeof(sum));
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%I64D", &a[i]);
    a[i] = a[i] + a[i - 1];
  }
  for (int i = 1; i <= n - m + 1; i++) sum[i] = a[i + m - 1] - a[i - 1];
  dp1[m] = 1;
  for (int i = m + 1; i <= n - m + 1; i++) {
    if (sum[i - m + 1] > sum[dp1[i - 1]])
      dp1[i] = i - m + 1;
    else
      dp1[i] = dp1[i - 1];
  }
  dp2[n - m] = n - m + 1;
  for (int i = n - m - 1; i >= m; i--) {
    if (sum[i + 1] >= sum[dp2[i + 1]])
      dp2[i] = i + 1;
    else
      dp2[i] = dp2[i + 1];
  }
  for (int i = m; i <= n - m + 1; i++) {
    long long yy = sum[dp1[i]] + sum[dp2[i]];
    if (yy > ans) {
      ans = yy;
      x = dp1[i];
      y = dp2[i];
    }
  }
  printf("%d %d\n", x, y);
}
int main() {
  init();
  return 0;
}
