#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, i;
  scanf("%d", &n);
  scanf("%d", &k);
  long long arr[300000] = {0}, high[300000] = {0};
  for (i = 0; i < n; i++) scanf("%lld", &arr[i]);
  for (i = 0; i < k; i++) high[0] += arr[i];
  for (i = 1; i < n - k + 1; i++) {
    high[i] = (high[i - 1] + arr[i + k - 1] - arr[i - 1]);
  }
  long long ans = 0, ans2 = 0;
  int id1 = 0, id2 = k;
  multiset<long long> check;
  for (i = k; i < n - k + 1; i++) {
    check.insert(high[i]);
  }
  for (i = 0; i < n - 2 * k + 1; i++) {
    set<long long>::iterator it;
    it = check.end();
    it--;
    if (ans < (high[i] + *it)) {
      id1 = i;
      ans = high[i] + *it;
      ans2 = *it;
    }
    check.erase(check.find(high[i + k]));
  }
  for (i = id1 + k; i < n - k + 1; i++) {
    if (ans2 == high[i]) {
      id2 = i;
      break;
    }
  }
  id1 += 1;
  id2 += 1;
  cout << id1 << " " << id2 << endl;
  return 0;
}
