#include <bits/stdc++.h>
using namespace std;
long long a[1000 * 1000];
long long s[1000 * 1000];
int main() {
  long long n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i < k) s[0] += a[i];
  }
  for (int i = 1; i <= n - k; i++) s[i] = s[i - 1] - a[i - 1] + a[i + k - 1];
  long long max1 = 0, max2 = 0, p = 0, p1 = 0, p2 = 0;
  for (int i = 0; i <= n - k; i++) {
    if (s[i] > max1) {
      max1 = s[i];
      p = i + 1;
    }
    if (max1 + s[i + k] > max2) {
      max2 = max1 + s[i + k];
      p1 = p;
      p2 = i + k + 1;
    }
  }
  cout << p1 << " " << p2;
}
