#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<long long int> v(n, 0);
  vector<long long int> p(n, 0);
  cin >> v[0];
  p[0] = v[0];
  for (int i = 1; i < n; i++) {
    cin >> v[i];
    p[i] = p[i - 1] + v[i];
  }
  vector<long long int> I(n, 0);
  I[0] = p[k - 1];
  for (int i = k; i < n; i++) {
    I[i - k + 1] = p[i] - p[i - k];
  }
  long long int maxs = -1;
  int pos = -1;
  vector<pair<long long int, int> > P(n, make_pair(-1, -1));
  for (int i = k - 1; i < n; i++) {
    if (I[i - k + 1] > maxs) {
      maxs = I[i - k + 1];
      pos = i - k + 1;
    }
    P[i] = make_pair(maxs, pos);
  }
  maxs = -1;
  int a = -1, b = -1;
  for (int i = k; i < n - k + 1; i++) {
    if (P[i - 1].first + I[i] > maxs) {
      b = i;
      a = P[i - 1].second;
      maxs = P[i - 1].first + I[i];
    }
  }
  cout << a + 1 << " " << b + 1;
  return 0;
}
