#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long arrPre[n];
  arrPre[0] = arr[0];
  for (long long i = 1; i < n; i++) arrPre[i] = arr[i] + arrPre[i - 1];
  vector<long long> tillNextK(n, 0);
  for (long long i = 0; i + k - 1 < n; i++) {
    long long id1 = 0;
    long long id2 = arrPre[i + k - 1];
    if (i > 0) id1 = arrPre[i - 1];
    tillNextK[i] = id2 - id1;
  }
  vector<long long> fromRight(n, 0);
  long long maxVal = -1;
  long long idx = n - 1;
  for (long long i = n - 1; i >= 0; i--) {
    if (maxVal <= tillNextK[i]) {
      maxVal = tillNextK[i];
      idx = i;
    }
    fromRight[i] = idx;
  }
  maxVal = -1;
  long long a = 0;
  long long b = 0;
  for (long long i = 0; i + k < n; i++) {
    if (maxVal < (tillNextK[i] + tillNextK[fromRight[i + k]])) {
      a = i;
      b = fromRight[i + k];
      maxVal = (tillNextK[i] + tillNextK[fromRight[i + k]]);
    }
  }
  cout << a + 1 << " " << b + 1 << endl;
  return 0;
}
