#include <bits/stdc++.h>
long long a[200003], s[200003];
int p[200003];
int main() {
  int n, k, i, j, l, r;
  long long mmax, ans;
  while (~scanf("%d%d", &n, &k)) {
    for (s[0] = 0, i = 1; i <= n; i++)
      scanf("%I64d", &a[i]), s[i] = s[i - 1] + a[i];
    mmax = s[n] - s[n - k], p[n - k + 1] = n - k + 1;
    for (i = n - k; i >= 1; i--) {
      if (s[i + k - 1] - s[i - 1] >= mmax)
        mmax = s[i + k - 1] - s[i - 1], p[i] = i;
      else
        p[i] = p[i + 1];
    }
    for (ans = 0, l = 1, r = k + 1, i = 1; i + 2 * k - 1 <= n; i++) {
      j = p[i + k];
      if (s[i + k - 1] - s[i - 1] + s[j + k - 1] - s[j - 1] > ans)
        ans = s[i + k - 1] - s[i - 1] + s[j + k - 1] - s[j - 1], l = i, r = j;
    }
    printf("%d %d\n", l, r);
  }
  return 0;
}
