#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int k;
  cin >> n >> k;
  long long array[n];
  long long w[n - k + 1];
  long long m[n - k + 1];
  for (int i = 0; i < n; i++) cin >> array[i];
  w[0] = 0;
  for (int i = 0; i < k; i++) w[0] += array[i];
  int end = k;
  int beg = 0;
  int i = 1;
  while (end < n) {
    w[i] = w[i - 1] + array[end++] - array[beg++];
    i++;
  }
  m[n - k] = n - k;
  for (i = n - k - 1; i >= 0; i--) {
    if (w[i] >= w[m[i + 1]])
      m[i] = i;
    else
      m[i] = m[i + 1];
  }
  long long maxC = 0;
  int a = 0;
  int b = 0;
  for (i = 0; i < n - k; i++) {
    if (i + k < (n - k + 1)) {
      if (maxC < w[i] + w[m[i + k]]) {
        maxC = w[i] + w[m[i + k]];
        a = i;
        b = m[i + k];
      }
    }
  }
  cout << a + 1 << " " << b + 1 << endl;
  return 0;
}
