#include <bits/stdc++.h>
const long long INF = 1e18;
const long long N = 1e6 + 5;
const long long MOD = 1e9 + 7;
using namespace std;
long long POWER(long long base, long long expo) {
  long long ret = 1;
  while (expo) {
    if (expo & 1) ret = ret * base;
    expo >>= 1;
    base = base * base;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long test_case = 1;
  while (test_case--) {
    long long n, k;
    cin >> n >> k;
    long long a[n + 1];
    for (long long i = 1; i <= n; i++) cin >> a[i];
    multiset<pair<long long, long long>, greater<pair<long long, long long> > >
        s;
    multiset<pair<long long, long long>,
             greater<pair<long long, long long> > >::iterator it;
    vector<long long> pre(n + 1, 0);
    long long sum = 0;
    for (long long i = 1; i <= n; i++) {
      sum += a[i];
      if (i < k) continue;
      if (i == k)
        pre[i - k + 1] = sum;
      else {
        sum -= a[i - k];
        pre[i - k + 1] = sum;
      }
    }
    for (long long i = k + 1; i <= n - k + 1; i++) s.insert({pre[i], -i});
    long long x, y, ans = -INF;
    for (long long i = 1; i <= n - (2 * k) + 1; i++) {
      pair<long long, long long> p = *s.begin();
      if (pre[i] + p.first > ans) {
        ans = pre[i] + p.first;
        x = i;
        y = (-1) * p.second;
      }
      s.erase({pre[i + k], (-1) * (i + k)});
    }
    cout << x << " " << y;
  }
  return 0;
}
