#include <bits/stdc++.h>
using namespace std;
long long int a[200005];
long long int b[200005];
int main() {
  long long int n, k;
  cin >> n >> k;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long int i = 1; i <= n; i++) {
    b[i] = b[i - 1] + a[i];
  }
  long long int cur_mx = 0;
  long long int ind1 = 0;
  long long int ind2 = 0;
  long long int ind3 = 0;
  long long int ans = 0;
  long long int current = 0;
  for (long long int i = n - 2 * k + 1; i >= 1; --i) {
    if (b[i + 2 * k - 1] - b[i + k - 1] >= cur_mx) {
      cur_mx = b[i + 2 * k - 1] - b[i + k - 1];
      ind2 = i + k;
    }
    current = b[i + k - 1] - b[i - 1];
    if (ans <= current + cur_mx) {
      ans = current + cur_mx;
      ind1 = i;
      ind3 = ind2;
    }
  }
  cout << ind1 << " " << ind3 << endl;
  return 0;
}
