#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, a[200001] = {0}, dp[200001] = {0}, max1 = 0, max2 = 0,
                  ans1 = 0, ans2 = 0, ans3 = 0;
  cin >> n >> k;
  cin >> a[1];
  for (int i = 2; i <= n; i++) {
    long long b;
    cin >> b;
    a[i] = a[i - 1] + b;
  }
  for (int i = 1; i <= n - k + 1; i++) dp[i] = a[i + k - 1] - a[i - 1];
  for (int i = n - 2 * k + 1; i >= 1; i--) {
    if (max1 <= dp[i + k]) {
      max1 = dp[i + k];
      ans3 = i + k;
    }
    if (max1 + dp[i] >= max2) {
      max2 = max1 + dp[i];
      ans1 = i;
      ans2 = ans3;
    }
  }
  cout << ans1 << " " << ans2;
}
