#include <bits/stdc++.h>
using namespace std;
const int ms = 2e+5 + 9;
long long vet[ms], maxi = 0, x, y, segSum[ms], seg[ms];
int n, k, ind[ms];
int main() {
  long long back, soma = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> vet[i];
  for (int i = 1; i < n; i++) vet[i] += vet[i - 1];
  for (int i = 0; i <= n - k; i++) {
    back = (i == 0) ? 0 : vet[i - 1];
    segSum[i] = vet[i + k - 1] - back;
  }
  for (int i = n - 1; i >= 0; i--) {
    vet[i] = segSum[i];
    if (segSum[i] >= segSum[i + 1]) {
      ind[i] = i;
    } else {
      segSum[i] = segSum[i + 1];
      ind[i] = ind[i + 1];
    }
  }
  for (int i = 0; i <= n - k; i++) {
    soma = vet[i];
    if (soma + segSum[i + k] > maxi) {
      x = i + 1;
      y = ind[i + k] + 1;
      maxi = soma + segSum[i + k];
    }
  }
  cout << x << " " << y;
}
