#include <bits/stdc++.h>
using namespace std;
int n, m, mm, k, ans, t;
long long a[300005], sum[300005];
long long f[300005][64];
long long maxx(long long x1, long long x2) { return x1 < x2 ? x2 : x1; }
void init() {
  int i, j;
  mm = n - k + 1;
  for (i = 1; i <= mm; i++) {
    f[i][0] = sum[i];
  }
  for (j = 1; (1 << j) <= mm; j++) {
    for (i = 1; i + j - 1 <= mm; i++) {
      f[i][j] = maxx(f[i][j - 1], f[i + (1 << (j - 1))][j - 1]);
    }
  }
}
long long query(int l, int r) {
  int k = 0;
  while (1 << (k + 1) <= r - l + 1) k++;
  return maxx(f[l][k], f[r - (1 << k) + 1][k]);
}
int main() {
  int i, j, s, e;
  long long ma, tmp;
  scanf("%d%d", &n, &k);
  sum[1] = 0;
  for (i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    if (i <= k) sum[1] += a[i];
  }
  for (i = 2; i <= n - k + 1; i++) {
    sum[i] = sum[i - 1] - a[i - 1] + a[i + k - 1];
  }
  init();
  m = n - 2 * k + 1;
  ma = -1;
  for (i = 1; i <= m; i++) {
    tmp = sum[i] + query(i + k, n - k + 1);
    if (tmp > ma) {
      s = i;
      ma = tmp;
    }
  }
  tmp = ma - sum[s];
  for (i = s + k; i <= n - k + 1; i++) {
    if (sum[i] == tmp) {
      e = i;
      break;
    }
  }
  printf("%d %d\n", s, e);
  return 0;
}
