#include <bits/stdc++.h>
using namespace std;
long long int a[200005], l[200005], r[200005], c[200005], maxl, maxr, imax,
    jmax;
int main() {
  long long int n, k, i, j;
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    c[i] = c[i - 1] + a[i];
    if (i == k) {
      maxl = c[i] - c[i - k - 1];
      l[i] = i;
    }
    if (i > k) {
      if (c[i] - c[i - k] > c[l[i - 1]] - c[l[i - 1] - k]) {
        maxl = c[i] - c[i - k];
        l[i] = i;
      } else
        l[i] = l[i - 1];
    }
  }
  for (j = n - k + 1; j >= 1; j--) {
    if (j == n - k + 1) {
      maxr = c[j + k - 1] - c[j - 1];
      r[j] = j;
      continue;
    }
    if (c[j + k - 1] - c[j - 1] >= c[r[j + 1] + k - 1] - c[r[j + 1] - 1]) {
      maxr = c[j + k - 1] - c[j - 1];
      r[j] = j;
    } else
      r[j] = r[j + 1];
  }
  maxl = 0;
  maxr = 0;
  for (i = k; i <= n - k + 1; i++) {
    long long int left, right;
    left = c[l[i]] - c[l[i] - k];
    right = c[r[i + 1] + k - 1] - c[r[i + 1] - 1];
    if (left + right > maxl + maxr) {
      maxl = left;
      maxr = right;
      imax = l[i] - k + 1;
      jmax = r[i + 1];
    }
  }
  cout << imax << " " << jmax;
  return 0;
}
