#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int i, j, k, n;
  cin >> n >> k;
  vector<long long int> v(n + 1);
  for (i = 1; i < n + 1; i++) cin >> v[i];
  vector<long long int> pre(n + 100, 0);
  for (i = 1; i < n + 1; i++) pre[i] = pre[i - 1] + v[i];
  vector<long long int> lau(n + 100);
  for (i = 1; i < n - k + 2; i++) {
    lau[i] = pre[i + k - 1] - pre[i - 1];
  }
  vector<long long int> lau_mx(n + 100), lau_mx_ind(n + 100);
  for (i = n - k + 1; i > 0; i--) {
    if (lau[i] >= lau_mx[i + 1]) {
      lau_mx[i] = lau[i];
      lau_mx_ind[i] = i;
    } else
      lau_mx[i] = lau_mx[i + 1], lau_mx_ind[i] = lau_mx_ind[i + 1];
  }
  long long int ans = 0, a, b;
  for (i = 1; i < n - (2 * k) + 2; i++) {
    if (ans < lau[i] + lau_mx[i + k]) {
      ans = lau[i] + lau_mx[i + k];
      a = i, b = lau_mx_ind[i + k];
    }
  }
  cout << a << " " << b << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
