#include <bits/stdc++.h>
using namespace std;
struct Data {
  long long val, a, b;
};
bool comp(Data &a, Data &b) {
  if (a.val > b.val) return true;
  if (a.val < b.val) return false;
  if (a.a < b.a) return true;
  if (a.a > b.a) return false;
  return a.b < b.b;
}
void solve() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long sum = 0LL;
  for (long long i = 0; i < k; i++) sum += a[i];
  vector<pair<long long, long long> > sums;
  sums.push_back({sum, 1});
  for (long long i = 1; i < n - k + 1; i++) {
    sum += a[i + k - 1];
    sum -= a[i - 1];
    sums.push_back({sum, i + 1});
  }
  long long sz = sums.size();
  vector<pair<long long, long long> > maxi(sz, {0, 0});
  for (long long i = sz - 1; i >= 0; i--) {
    if (i == sz - 1) {
      maxi[i] = sums[i];
    } else {
      maxi[i] = maxi[i + 1];
      if (sums[i].first >= maxi[i].first) maxi[i] = sums[i];
    }
  }
  vector<Data> ans;
  for (long long i = 0; i + 2 * k <= n; i++) {
    Data cur;
    cur.val = sums[i].first + maxi[i + k].first;
    cur.a = sums[i].second;
    cur.b = maxi[i + k].second;
    ans.push_back(cur);
  }
  sort((ans).begin(), (ans).end(), comp);
  cout << ans[0].a << " " << ans[0].b << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
