#include <bits/stdc++.h>
using namespace std;
long long a[200010];
long long cs[200010], ck[200010], mk[200010];
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = n; i; i--) cs[i] = a[i], cs[i] += cs[i + 1];
  for (long long i = 1; i <= n - k + 1; i++) ck[i] = cs[i] - cs[i + k];
  long long mx = 0, pos = 0;
  for (long long i = n; i; i--) {
    if (ck[i] >= mx) {
      pos = i;
      mx = ck[i];
    }
    mk[i] = pos;
  }
  mx = 0;
  long long x = -1, y = -1;
  for (long long i = n - k; i; i--) {
    if (ck[i] + ck[mk[i + k]] >= mx) {
      mx = ck[i] + ck[mk[i + k]];
      x = i, y = mk[i + k];
    }
  }
  cout << x << ' ' << y << '\n';
  return 0;
}
