#include <bits/stdc++.h>
using namespace std;
string imp = "Impossible\n";
const int N = 1e5 + 5;
long long MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int tests = 1;
  while (tests--) {
    long long n, k;
    cin >> n >> k;
    vector<long long> v(n);
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
    }
    vector<pair<long long, long long> > stmax(n - k + 1);
    long long cs = 0;
    for (long long i = n - 1; i >= n - 1 - (k - 1); i--) {
      cs += v[i];
    }
    long long ms = cs;
    long long mr = n - k;
    stmax[n - k] = {ms, n - k};
    for (long long i = n - k - 1; i >= 0; i--) {
      cs += v[i] - v[i + k];
      if (ms <= cs) {
        ms = cs;
        mr = i;
      }
      stmax[i] = {ms, mr};
    }
    cs = 0;
    for (long long i = 0; i < k; i++) {
      cs += v[i];
    }
    long long mabs = 0, ml = -1;
    mr = -1;
    ms = cs;
    int curl;
    mabs = max(mabs, ms + stmax[k].first);
    curl = 0;
    ml = 0;
    mr = stmax[k].second;
    for (long long i = k; i < n - k; i++) {
      cs += v[i] - v[i - k];
      if (ms < cs) {
        ms = cs;
        curl = i - k + 1;
      }
      if (ms + stmax[i + 1].first > mabs) {
        mabs = ms + stmax[i + 1].first;
        ml = curl;
        mr = stmax[i + 1].second;
      }
    }
    cout << ml + 1 << " " << mr + 1;
  }
  return 0;
}
